MATIC Price: $1.01 (-3.57%)
Gas: 162 GWei
 

Overview

MATIC Balance

Polygon PoS Chain LogoPolygon PoS Chain LogoPolygon PoS Chain Logo0 MATIC

MATIC Value

$0.00

Sponsored

Transaction Hash
Method
Block
From
To
Value
0x60a06040374660072022-12-30 15:48:10453 days ago1672415290IN
 Create: HyperLPFactory
0 MATIC0.1513243263.66492088

Parent Txn Hash Block From To Value
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
HyperLPFactory

Compiler Version
v0.8.10+commit.fc410830

Optimization Enabled:
Yes with 1 runs

Other Settings:
default evmVersion
File 1 of 25 : HyperLPFactory.sol
// SPDX-License-Identifier: MIT

/***
 *      ______             _______   __
 *     /      \           |       \ |  \
 *    |  $$$$$$\ __    __ | $$$$$$$\| $$  ______    _______  ______ ____    ______
 *    | $$$\| $$|  \  /  \| $$__/ $$| $$ |      \  /       \|      \    \  |      \
 *    | $$$$\ $$ \$$\/  $$| $$    $$| $$  \$$$$$$\|  $$$$$$$| $$$$$$\$$$$\  \$$$$$$\
 *    | $$\$$\$$  >$$  $$ | $$$$$$$ | $$ /      $$ \$$    \ | $$ | $$ | $$ /      $$
 *    | $$_\$$$$ /  $$$$\ | $$      | $$|  $$$$$$$ _\$$$$$$\| $$ | $$ | $$|  $$$$$$$
 *     \$$  \$$$|  $$ \$$\| $$      | $$ \$$    $$|       $$| $$ | $$ | $$ \$$    $$
 *      \$$$$$$  \$$   \$$ \$$       \$$  \$$$$$$$ \$$$$$$$  \$$  \$$  \$$  \$$$$$$$
 *
 *
 *
 */

pragma solidity ^0.8.4;

import {
    IUniswapV3Factory
} from "@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol";
import {IUniswapV3TickSpacing} from "./interfaces/IUniswapV3TickSpacing.sol";
import {IHyperLPFactory, TYPES} from "./interfaces/IHyper.sol";
import {IHyperLPoolStorage} from "./interfaces/IHyperStorage.sol";
import {HyperLPFactoryStorage} from "./abstract/HyperLPFactoryStorage.sol";
import {EIP173Proxy} from "./vendor/proxy/EIP173Proxy.sol";
import {IEIP173Proxy} from "./interfaces/IEIP173Proxy.sol";
import {
    IERC20Metadata
} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import {Context} from "@openzeppelin/contracts/utils/Context.sol";
import {
    EnumerableSet
} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import {EnumerableSetMap} from "./utils/EnumerableSetMap.sol";

contract HyperLPFactory is HyperLPFactoryStorage, IHyperLPFactory, Context {
    using EnumerableSet for EnumerableSet.Bytes32Set;
    using EnumerableSet for EnumerableSet.AddressSet;
    using EnumerableSetMap for EnumerableSetMap.Bytes32ToAddressSetMap;

    constructor(address _uniswapV3Factory)
        HyperLPFactoryStorage(_uniswapV3Factory)
    {} // solhint-disable-line no-empty-blocks

    /// @notice createPool creates a new instance of a HyperLP token on a specified
    /// UniswapV3Pool. The msg.sender is the initial manager of the pool and will
    /// forever be associated with the HyperLP pool as it's `deployer`
    /// @param attributes The attributes of pool
    /// @return pool the address of the newly created HyperLP pool (proxy)
    function createPool(TYPES.HPoolAttributes calldata attributes)
        external
        override
        returns (address pool)
    {
        (address token0, address token1) =
            _getTokenOrder(attributes.tokenA, attributes.tokenB);
        pool = _createPool(
            token0,
            token1,
            attributes.uniFee,
            attributes.lowerTick,
            attributes.upperTick,
            attributes.manager,
            attributes.managerFee
        );
        _deployers.add(_msgSender());
        _trustedPools[pool] = true;
        bytes32 poolKey = _getPoolKey(token0, token1, attributes.uniFee);
        EnumerableSetMap.Bytes32ToAddressSetMap storage pools =
            _pools[_msgSender()];
        pools.set(poolKey, pool);
    }

    function _createPool(
        address token0,
        address token1,
        uint24 uniFee,
        int24 lowerTick,
        int24 upperTick,
        address manager,
        uint16 managerFee
    ) private returns (address pool) {
        pool = address(new EIP173Proxy(poolImplementation, address(this), ""));

        string memory name = "HyperPools Uniswap LP";
        try this.getTokenName(token0, token1) returns (string memory result) {
            name = result;
        } catch {} // solhint-disable-line no-empty-blocks

        address uniPool =
            IUniswapV3Factory(factory).getPool(token0, token1, uniFee);
        require(uniPool != address(0), "uniswap pool does not exist");
        require(
            _validateTickSpacing(uniPool, lowerTick, upperTick),
            "tickSpacing mismatch"
        );

        IHyperLPoolStorage(pool).initialize(
            name,
            "HyperLP",
            uniPool,
            managerFee,
            lowerTick,
            upperTick,
            manager
        );

        emit PoolCreated(uniPool, manager, pool);
    }

    function _getPoolKey(
        address token0,
        address token1,
        uint24 uniFee
    ) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked(token0, token1, uniFee));
    }

    function _validateTickSpacing(
        address uniPool,
        int24 lowerTick,
        int24 upperTick
    ) internal view returns (bool) {
        int24 spacing = IUniswapV3TickSpacing(uniPool).tickSpacing();
        return
            lowerTick < upperTick &&
            lowerTick % spacing == 0 &&
            upperTick % spacing == 0;
    }

    function getTokenName(address token0, address token1)
        external
        view
        returns (string memory)
    {
        string memory symbol0 = IERC20Metadata(token0).symbol();
        string memory symbol1 = IERC20Metadata(token1).symbol();

        return _append("HyperPools Uniswap ", symbol0, "/", symbol1, " LP");
    }

    function upgradePools(address[] memory pools) external onlyManager {
        for (uint256 i = 0; i < pools.length; i++) {
            IEIP173Proxy(pools[i]).upgradeTo(poolImplementation);
        }
    }

    function upgradePoolsAndCall(address[] memory pools, bytes[] calldata datas)
        external
        onlyManager
    {
        require(pools.length == datas.length, "mismatching array length");
        for (uint256 i = 0; i < pools.length; i++) {
            IEIP173Proxy(pools[i]).upgradeToAndCall(
                poolImplementation,
                datas[i]
            );
        }
    }

    function makePoolsImmutable(address[] memory pools) external onlyManager {
        for (uint256 i = 0; i < pools.length; i++) {
            IEIP173Proxy(pools[i]).transferProxyAdmin(address(0));
        }
    }

    /// @notice isPoolImmutable checks if a certain HyperLP pool is "immutable" i.e. that the
    /// proxyAdmin is the zero address and thus the underlying implementation cannot be upgraded
    /// @param pool address of the HyperLP pool
    /// @return bool signaling if pool is immutable (true) or not (false)
    function isPoolImmutable(address pool) external view returns (bool) {
        return address(0) == getProxyAdmin(pool);
    }

    /// @notice getHyperPools gets all the Hyper pools deployed by HyperPools's
    /// default deployer address (since anyone can deploy and manage HyperPools pools)
    /// @return list of HyperPools managed Hyper pool addresses
    function getHyperPools(TYPES.UPoolAttributes calldata attributes)
        external
        view
        returns (address[] memory)
    {
        return getPools(hyperpoolsDeployer, attributes);
    }

    /// @notice getDeployers fetches all addresses that have deployed a HyperLP pool
    /// @return deployers the list of deployer addresses
    function getDeployers() public view returns (address[] memory) {
        uint256 length = numDeployers();
        address[] memory deployers = new address[](length);
        for (uint256 i = 0; i < length; i++) {
            deployers[i] = _getDeployer(i);
        }

        return deployers;
    }

    /// @notice getPools fetches all the HyperLP pool addresses deployed by `deployer`
    /// @param deployer address that has potentially deployed HyperLP pools
    /// @return pools the list of HyperLP pool addresses deployed by `deployer`
    function getPools(
        address deployer,
        TYPES.UPoolAttributes calldata attributes
    ) public view override returns (address[] memory) {
        (address token0, address token1) =
            _getTokenOrder(attributes.tokenA, attributes.tokenB);
        bytes32 poolKey = _getPoolKey(token0, token1, attributes.uniFee);
        uint256 length = numDeployerPools(deployer, attributes);
        address[] memory pools = new address[](length);
        for (uint256 i = 0; i < length; i++) {
            pools[i] = _getPool(deployer, poolKey, i);
        }

        return pools;
    }

    /// @notice numPools counts the total number of HyperLP pools in existence
    /// @return result total number of HyperLP pools deployed
    function numPools(TYPES.UPoolAttributes calldata attributes)
        public
        view
        override
        returns (uint256 result)
    {
        address[] memory deployers = getDeployers();
        for (uint256 i = 0; i < deployers.length; i++) {
            result += numDeployerPools(deployers[i], attributes);
        }
    }

    /// @notice verifies is pool is trsuted
    /// @param pool address of HyperLP pool to verify
    /// @return true if trusted otherwise false
    function isTrustedPool(address pool) external view override returns (bool) {
        return _trustedPools[pool];
    }

    /// @notice numDeployers counts the total number of HyperLP pool deployer addresses
    /// @return total number of HyperLP pool deployer addresses
    function numDeployers() public view returns (uint256) {
        return _deployers.length();
    }

    /// @notice numPools counts the total number of HyperLP pools deployed by `deployer`
    /// @param deployer deployer address
    /// @return total number of HyperLP pools deployed by `deployer`
    function numDeployerPools(
        address deployer,
        TYPES.UPoolAttributes calldata attributes
    ) public view override returns (uint256) {
        (address token0, address token1) =
            _getTokenOrder(attributes.tokenA, attributes.tokenB);
        bytes32 poolKey = _getPoolKey(token0, token1, attributes.uniFee);
        return _pools[deployer].length(poolKey);
    }

    /// @notice getProxyAdmin gets the current address who controls the underlying implementation
    /// of a HyperLP pool.
    /// For most all pools either this contract address or the zero address will
    /// be the proxyAdmin. If the admin is the zero address the pool's implementation is naturally
    /// no longer upgradable (no one owns the zero address).
    /// @param pool address of the HyperLP pool
    /// @return address that controls the HyperLP implementation (has power to upgrade it)
    function getProxyAdmin(address pool) public view returns (address) {
        return IEIP173Proxy(pool).proxyAdmin();
    }

    function _getDeployer(uint256 index) internal view returns (address) {
        return _deployers.at(index);
    }

    function _getPool(
        address deployer,
        bytes32 poolKey,
        uint256 index
    ) internal view returns (address _pool) {
        _pool = address(
            uint160(uint256(_pools[deployer].get(poolKey).at(index)))
        );
    }

    function _getTokenOrder(address tokenA, address tokenB)
        internal
        pure
        returns (address token0, address token1)
    {
        require(tokenA != tokenB, "same token");
        (token0, token1) = tokenA < tokenB
            ? (tokenA, tokenB)
            : (tokenB, tokenA);
        require(token0 != address(0), "no address zero");
    }

    function _append(
        string memory a,
        string memory b,
        string memory c,
        string memory d,
        string memory e
    ) internal pure returns (string memory) {
        return string(abi.encodePacked(a, b, c, d, e));
    }
}

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

/// @title The interface for the Uniswap V3 Factory
/// @notice The Uniswap V3 Factory facilitates creation of Uniswap V3 pools and control over the protocol fees
interface IUniswapV3Factory {
    /// @notice Emitted when the owner of the factory is changed
    /// @param oldOwner The owner before the owner was changed
    /// @param newOwner The owner after the owner was changed
    event OwnerChanged(address indexed oldOwner, address indexed newOwner);

    /// @notice Emitted when a pool is created
    /// @param token0 The first token of the pool by address sort order
    /// @param token1 The second token of the pool by address sort order
    /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip
    /// @param tickSpacing The minimum number of ticks between initialized ticks
    /// @param pool The address of the created pool
    event PoolCreated(
        address indexed token0,
        address indexed token1,
        uint24 indexed fee,
        int24 tickSpacing,
        address pool
    );

    /// @notice Emitted when a new fee amount is enabled for pool creation via the factory
    /// @param fee The enabled fee, denominated in hundredths of a bip
    /// @param tickSpacing The minimum number of ticks between initialized ticks for pools created with the given fee
    event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing);

    /// @notice Returns the current owner of the factory
    /// @dev Can be changed by the current owner via setOwner
    /// @return The address of the factory owner
    function owner() external view returns (address);

    /// @notice Returns the tick spacing for a given fee amount, if enabled, or 0 if not enabled
    /// @dev A fee amount can never be removed, so this value should be hard coded or cached in the calling context
    /// @param fee The enabled fee, denominated in hundredths of a bip. Returns 0 in case of unenabled fee
    /// @return The tick spacing
    function feeAmountTickSpacing(uint24 fee) external view returns (int24);

    /// @notice Returns the pool address for a given pair of tokens and a fee, or address 0 if it does not exist
    /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order
    /// @param tokenA The contract address of either token0 or token1
    /// @param tokenB The contract address of the other token
    /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip
    /// @return pool The pool address
    function getPool(
        address tokenA,
        address tokenB,
        uint24 fee
    ) external view returns (address pool);

    /// @notice Creates a pool for the given two tokens and fee
    /// @param tokenA One of the two tokens in the desired pool
    /// @param tokenB The other of the two tokens in the desired pool
    /// @param fee The desired fee for the pool
    /// @dev tokenA and tokenB may be passed in either order: token0/token1 or token1/token0. tickSpacing is retrieved
    /// from the fee. The call will revert if the pool already exists, the fee is invalid, or the token arguments
    /// are invalid.
    /// @return pool The address of the newly created pool
    function createPool(
        address tokenA,
        address tokenB,
        uint24 fee
    ) external returns (address pool);

    /// @notice Updates the owner of the factory
    /// @dev Must be called by the current owner
    /// @param _owner The new owner of the factory
    function setOwner(address _owner) external;

    /// @notice Enables a fee amount with the given tickSpacing
    /// @dev Fee amounts may never be removed once enabled
    /// @param fee The fee amount to enable, denominated in hundredths of a bip (i.e. 1e-6)
    /// @param tickSpacing The spacing between ticks to be enforced for all pools created with the given fee amount
    function enableFeeAmount(uint24 fee, int24 tickSpacing) external;
}

File 3 of 25 : IUniswapV3TickSpacing.sol
// SPDX-License-Identifier: MIT

/***
 *      ______             _______   __
 *     /      \           |       \ |  \
 *    |  $$$$$$\ __    __ | $$$$$$$\| $$  ______    _______  ______ ____    ______
 *    | $$$\| $$|  \  /  \| $$__/ $$| $$ |      \  /       \|      \    \  |      \
 *    | $$$$\ $$ \$$\/  $$| $$    $$| $$  \$$$$$$\|  $$$$$$$| $$$$$$\$$$$\  \$$$$$$\
 *    | $$\$$\$$  >$$  $$ | $$$$$$$ | $$ /      $$ \$$    \ | $$ | $$ | $$ /      $$
 *    | $$_\$$$$ /  $$$$\ | $$      | $$|  $$$$$$$ _\$$$$$$\| $$ | $$ | $$|  $$$$$$$
 *     \$$  \$$$|  $$ \$$\| $$      | $$ \$$    $$|       $$| $$ | $$ | $$ \$$    $$
 *      \$$$$$$  \$$   \$$ \$$       \$$  \$$$$$$$ \$$$$$$$  \$$  \$$  \$$  \$$$$$$$
 *
 *
 *
 */

pragma solidity ^0.8.4;

interface IUniswapV3TickSpacing {
    function tickSpacing() external view returns (int24);
}

File 4 of 25 : IHyper.sol
// SPDX-License-Identifier: MIT

/***
 *      ______             _______   __
 *     /      \           |       \ |  \
 *    |  $$$$$$\ __    __ | $$$$$$$\| $$  ______    _______  ______ ____    ______
 *    | $$$\| $$|  \  /  \| $$__/ $$| $$ |      \  /       \|      \    \  |      \
 *    | $$$$\ $$ \$$\/  $$| $$    $$| $$  \$$$$$$\|  $$$$$$$| $$$$$$\$$$$\  \$$$$$$\
 *    | $$\$$\$$  >$$  $$ | $$$$$$$ | $$ /      $$ \$$    \ | $$ | $$ | $$ /      $$
 *    | $$_\$$$$ /  $$$$\ | $$      | $$|  $$$$$$$ _\$$$$$$\| $$ | $$ | $$|  $$$$$$$
 *     \$$  \$$$|  $$ \$$\| $$      | $$ \$$    $$|       $$| $$ | $$ | $$ \$$    $$
 *      \$$$$$$  \$$   \$$ \$$       \$$  \$$$$$$$ \$$$$$$$  \$$  \$$  \$$  \$$$$$$$
 *
 *
 *
 */

pragma solidity ^0.8.4;

library TYPES {
    struct UPoolAttributes {
        address tokenA;
        address tokenB;
        uint24 uniFee;
    }

    struct HPoolAttributes {
        address tokenA;
        address tokenB;
        uint24 uniFee;
        int24 lowerTick;
        int24 upperTick;
        address manager;
        uint16 managerFee;
    }
}

interface IHyperLPFactory {
    event PoolCreated(
        address indexed uniPool,
        address indexed manager,
        address indexed pool
    );

    function createPool(TYPES.HPoolAttributes calldata attributes)
        external
        returns (address pool);

    function getPools(
        address deployer,
        TYPES.UPoolAttributes calldata attributes
    ) external view returns (address[] memory);

    function numPools(TYPES.UPoolAttributes calldata attributes)
        external
        view
        returns (uint256);

    function numDeployerPools(
        address deployer,
        TYPES.UPoolAttributes calldata attributes
    ) external view returns (uint256);

    function isTrustedPool(address pool) external view returns (bool);
}

interface IHyperLPool {
    function getMintAmounts(uint256 amount0Max, uint256 amount1Max)
        external
        view
        returns (
            uint256 amount0,
            uint256 amount1,
            uint256 mintAmount,
            uint160 sqrtRatioX96
        );

    function mint(
        uint256 amount0Max,
        uint256 amount1Max,
        address receiver
    )
        external
        returns (
            uint256 amount0,
            uint256 amount1,
            uint256 mintAmount,
            uint128 liquidityMinted
        );

    function burn(uint256 burnAmount, address receiver)
        external
        returns (
            uint256 amount0,
            uint256 amount1,
            uint128 liquidityBurned
        );
}

File 5 of 25 : IHyperStorage.sol
// SPDX-License-Identifier: MIT

/***
 *      ______             _______   __
 *     /      \           |       \ |  \
 *    |  $$$$$$\ __    __ | $$$$$$$\| $$  ______    _______  ______ ____    ______
 *    | $$$\| $$|  \  /  \| $$__/ $$| $$ |      \  /       \|      \    \  |      \
 *    | $$$$\ $$ \$$\/  $$| $$    $$| $$  \$$$$$$\|  $$$$$$$| $$$$$$\$$$$\  \$$$$$$\
 *    | $$\$$\$$  >$$  $$ | $$$$$$$ | $$ /      $$ \$$    \ | $$ | $$ | $$ /      $$
 *    | $$_\$$$$ /  $$$$\ | $$      | $$|  $$$$$$$ _\$$$$$$\| $$ | $$ | $$|  $$$$$$$
 *     \$$  \$$$|  $$ \$$\| $$      | $$ \$$    $$|       $$| $$ | $$ | $$ \$$    $$
 *      \$$$$$$  \$$   \$$ \$$       \$$  \$$$$$$$ \$$$$$$$  \$$  \$$  \$$  \$$$$$$$
 *
 *
 *
 */

pragma solidity ^0.8.4;

import {
    IUniswapV3Pool
} from "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";

interface IHyperLPoolFactoryStorage {
    function factory() external view returns (address);
}

interface IHyperLPoolStorage {
    function initialize(
        string memory _name,
        string memory _symbol,
        address _pool,
        uint16 _managerFeeBPS,
        int24 _lowerTick,
        int24 _upperTick,
        address _manager_
    ) external;

    function pool() external view returns (IUniswapV3Pool);

    function token0() external view returns (IERC20);

    function token1() external view returns (IERC20);

    function lowerTick() external view returns (int24);

    function upperTick() external view returns (int24);
}

File 6 of 25 : HyperLPFactoryStorage.sol
// SPDX-License-Identifier: MIT

/***
 *      ______             _______   __
 *     /      \           |       \ |  \
 *    |  $$$$$$\ __    __ | $$$$$$$\| $$  ______    _______  ______ ____    ______
 *    | $$$\| $$|  \  /  \| $$__/ $$| $$ |      \  /       \|      \    \  |      \
 *    | $$$$\ $$ \$$\/  $$| $$    $$| $$  \$$$$$$\|  $$$$$$$| $$$$$$\$$$$\  \$$$$$$\
 *    | $$\$$\$$  >$$  $$ | $$$$$$$ | $$ /      $$ \$$    \ | $$ | $$ | $$ /      $$
 *    | $$_\$$$$ /  $$$$\ | $$      | $$|  $$$$$$$ _\$$$$$$\| $$ | $$ | $$|  $$$$$$$
 *     \$$  \$$$|  $$ \$$\| $$      | $$ \$$    $$|       $$| $$ | $$ | $$ \$$    $$
 *      \$$$$$$  \$$   \$$ \$$       \$$  \$$$$$$$ \$$$$$$$  \$$  \$$  \$$  \$$$$$$$
 *
 *
 *
 */

pragma solidity ^0.8.4;

import {IHyperLPoolFactoryStorage} from "../interfaces/IHyperStorage.sol";

import {OwnableUninitialized} from "./OwnableUninitialized.sol";
import {
    Initializable
} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import {
    EnumerableSet
} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";

import {EnumerableSetMap} from "../utils/EnumerableSetMap.sol";

// solhint-disable-next-line max-states-count
abstract contract HyperLPFactoryStorage is
    OwnableUninitialized, /* XXXX DONT MODIFY ORDERING XXXX */
    Initializable,
    IHyperLPoolFactoryStorage
    // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:
    // XXXX DONT MODIFY ORDERING XXXX
{
    // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX
    // solhint-disable-next-line const-name-snakecase
    string public constant version = "1.0.0";
    address public immutable override factory;
    address public poolImplementation;
    address public hyperpoolsDeployer;
    EnumerableSet.AddressSet internal _deployers;
    mapping(address => EnumerableSetMap.Bytes32ToAddressSetMap) internal _pools;
    mapping(address => bool) internal _trustedPools;

    // APPPEND ADDITIONAL STATE VARS BELOW:
    // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX

    event UpdatePoolImplementation(
        address previousImplementation,
        address newImplementation
    );

    event UpdateHyperPoolsDeployer(
        address previosHyperPoolsDeployer,
        address newHyperPoolsDeployer
    );

    event PoolTrustToggled(address pool, bool isTrusted);

    constructor(address _uniswapV3Factory) {
        factory = _uniswapV3Factory;
    }

    function initialize(
        address _implementation,
        address _hyperpoolsDeployer,
        address _manager_
    ) external initializer {
        poolImplementation = _implementation;
        hyperpoolsDeployer = _hyperpoolsDeployer;
        _manager = _manager_;
    }

    function setPoolImplementation(address nextImplementation)
        external
        onlyManager
    {
        emit UpdatePoolImplementation(poolImplementation, nextImplementation);
        poolImplementation = nextImplementation;
    }

    function setHyperPoolsDeployer(address nextHyperPoolsDeployer)
        external
        onlyManager
    {
        emit UpdateHyperPoolsDeployer(
            hyperpoolsDeployer,
            nextHyperPoolsDeployer
        );
        hyperpoolsDeployer = nextHyperPoolsDeployer;
    }

    function toggleTrustedPool(address pool) external onlyManager {
        bool isTrusted = !_trustedPools[pool];
        _trustedPools[pool] = isTrusted;
        emit PoolTrustToggled(pool, isTrusted);
    }
}

File 7 of 25 : EIP173Proxy.sol
// SPDX-License-Identifier: MIT

/***
 *      ______             _______   __
 *     /      \           |       \ |  \
 *    |  $$$$$$\ __    __ | $$$$$$$\| $$  ______    _______  ______ ____    ______
 *    | $$$\| $$|  \  /  \| $$__/ $$| $$ |      \  /       \|      \    \  |      \
 *    | $$$$\ $$ \$$\/  $$| $$    $$| $$  \$$$$$$\|  $$$$$$$| $$$$$$\$$$$\  \$$$$$$\
 *    | $$\$$\$$  >$$  $$ | $$$$$$$ | $$ /      $$ \$$    \ | $$ | $$ | $$ /      $$
 *    | $$_\$$$$ /  $$$$\ | $$      | $$|  $$$$$$$ _\$$$$$$\| $$ | $$ | $$|  $$$$$$$
 *     \$$  \$$$|  $$ \$$\| $$      | $$ \$$    $$|       $$| $$ | $$ | $$ \$$    $$
 *      \$$$$$$  \$$   \$$ \$$       \$$  \$$$$$$$ \$$$$$$$  \$$  \$$  \$$  \$$$$$$$
 *
 *
 *
 */

pragma solidity ^0.8.4;

import "./Proxy.sol";

interface ERC165 {
    function supportsInterface(bytes4 id) external view returns (bool);
}

///@notice Proxy implementing EIP173 for ownership management
contract EIP173Proxy is Proxy {
    // ////////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////

    event ProxyAdminTransferred(
        address indexed previousAdmin,
        address indexed newAdmin
    );

    // /////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////////////

    constructor(
        address implementationAddress,
        address adminAddress,
        bytes memory data
    ) payable {
        _setImplementation(implementationAddress, data);
        _setProxyAdmin(adminAddress);
    }

    // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////

    function proxyAdmin() external view returns (address) {
        return _proxyAdmin();
    }

    function supportsInterface(bytes4 id) external view returns (bool) {
        if (id == 0x01ffc9a7 || id == 0x7f5828d0) {
            return true;
        }
        if (id == 0xFFFFFFFF) {
            return false;
        }

        ERC165 implementation;
        // solhint-disable-next-line security/no-inline-assembly
        assembly {
            implementation := sload(
                0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc
            )
        }

        // Technically this is not standard compliant as ERC-165 require 30,000 gas which that call cannot ensure
        // because it is itself inside `supportsInterface` that might only get 30,000 gas.
        // In practise this is unlikely to be an issue.
        try implementation.supportsInterface(id) returns (bool support) {
            return support;
        } catch {
            return false;
        }
    }

    function transferProxyAdmin(address newAdmin) external onlyProxyAdmin {
        _setProxyAdmin(newAdmin);
    }

    function upgradeTo(address newImplementation) external onlyProxyAdmin {
        _setImplementation(newImplementation, "");
    }

    function upgradeToAndCall(address newImplementation, bytes calldata data)
        external
        payable
        onlyProxyAdmin
    {
        _setImplementation(newImplementation, data);
    }

    // /////////////////////// MODIFIERS ////////////////////////////////////////////////////////////////////////

    modifier onlyProxyAdmin() {
        require(msg.sender == _proxyAdmin(), "NOT_AUTHORIZED");
        _;
    }

    // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////

    function _proxyAdmin() internal view returns (address adminAddress) {
        // solhint-disable-next-line security/no-inline-assembly
        assembly {
            adminAddress := sload(
                0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103
            )
        }
    }

    function _setProxyAdmin(address newAdmin) internal {
        address previousAdmin = _proxyAdmin();
        // solhint-disable-next-line security/no-inline-assembly
        assembly {
            sstore(
                0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,
                newAdmin
            )
        }
        emit ProxyAdminTransferred(previousAdmin, newAdmin);
    }
}

File 8 of 25 : IEIP173Proxy.sol
// SPDX-License-Identifier: MIT

/***
 *      ______             _______   __
 *     /      \           |       \ |  \
 *    |  $$$$$$\ __    __ | $$$$$$$\| $$  ______    _______  ______ ____    ______
 *    | $$$\| $$|  \  /  \| $$__/ $$| $$ |      \  /       \|      \    \  |      \
 *    | $$$$\ $$ \$$\/  $$| $$    $$| $$  \$$$$$$\|  $$$$$$$| $$$$$$\$$$$\  \$$$$$$\
 *    | $$\$$\$$  >$$  $$ | $$$$$$$ | $$ /      $$ \$$    \ | $$ | $$ | $$ /      $$
 *    | $$_\$$$$ /  $$$$\ | $$      | $$|  $$$$$$$ _\$$$$$$\| $$ | $$ | $$|  $$$$$$$
 *     \$$  \$$$|  $$ \$$\| $$      | $$ \$$    $$|       $$| $$ | $$ | $$ \$$    $$
 *      \$$$$$$  \$$   \$$ \$$       \$$  \$$$$$$$ \$$$$$$$  \$$  \$$  \$$  \$$$$$$$
 *
 *
 *
 */

pragma solidity ^0.8.4;

interface IEIP173Proxy {
    function proxyAdmin() external view returns (address);

    function transferProxyAdmin(address newAdmin) external;

    function upgradeTo(address newImplementation) external;

    function upgradeToAndCall(address newImplementation, bytes calldata data)
        external
        payable;
}

File 9 of 25 : 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 10 of 25 : 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 11 of 25 : EnumerableSet.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/structs/EnumerableSet.sol)

pragma solidity ^0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 *
 * [WARNING]
 * ====
 *  Trying to delete such a structure from storage will likely result in data corruption, rendering the structure unusable.
 *  See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
 *
 *  In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an array of EnumerableSet.
 * ====
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;
        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping(bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) {
            // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            if (lastIndex != toDeleteIndex) {
                bytes32 lastValue = set._values[lastIndex];

                // Move the last value to the index where the value to delete is
                set._values[toDeleteIndex] = lastValue;
                // Update the index for the moved value
                set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex
            }

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        return set._values[index];
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function _values(Set storage set) private view returns (bytes32[] memory) {
        return set._values;
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
        return _values(set._inner);
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(AddressSet storage set) internal view returns (address[] memory) {
        bytes32[] memory store = _values(set._inner);
        address[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(UintSet storage set) internal view returns (uint256[] memory) {
        bytes32[] memory store = _values(set._inner);
        uint256[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }
}

File 12 of 25 : EnumerableSetMap.sol
// SPDX-License-Identifier: MIT

/***
 *      ______             _______   __
 *     /      \           |       \ |  \
 *    |  $$$$$$\ __    __ | $$$$$$$\| $$  ______    _______  ______ ____    ______
 *    | $$$\| $$|  \  /  \| $$__/ $$| $$ |      \  /       \|      \    \  |      \
 *    | $$$$\ $$ \$$\/  $$| $$    $$| $$  \$$$$$$\|  $$$$$$$| $$$$$$\$$$$\  \$$$$$$\
 *    | $$\$$\$$  >$$  $$ | $$$$$$$ | $$ /      $$ \$$    \ | $$ | $$ | $$ /      $$
 *    | $$_\$$$$ /  $$$$\ | $$      | $$|  $$$$$$$ _\$$$$$$\| $$ | $$ | $$|  $$$$$$$
 *     \$$  \$$$|  $$ \$$\| $$      | $$ \$$    $$|       $$| $$ | $$ | $$ \$$    $$
 *      \$$$$$$  \$$   \$$ \$$       \$$  \$$$$$$$ \$$$$$$$  \$$  \$$  \$$  \$$$$$$$
 *
 *
 *
 */

pragma solidity ^0.8.4;

import {
    EnumerableSet
} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";

import {
    EnumerableMap
} from "@openzeppelin/contracts/utils/structs/EnumerableMap.sol";

/**
 * @dev Library for managing an enumerable variant of Solidity's
 * https://solidity.readthedocs.io/en/latest/types.html#mapping-types[`mapping`]
 * type.
 *
 * Maps have the following properties:
 *
 * - Entries are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Entries are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSetMap for EnumerableSetMap.Bytes32ToAddressSetMap;
 *
 *     // Declare a set state variable
 *     EnumerableSetMap.Bytes32ToAddressSetMap private myMap;
 * }
 * ```
 *
 * The following map types are supported:
 *
 * - `bytes32 -> EnumerableSet.Bytes32Set` (`Bytes32ToAddressSetMap`)
 *
 * [WARNING]
 * ====
 *  Trying to delete such a structure from storage will likely result in data corruption,
 *  rendering the structure unusable.
 *  See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
 *
 *  In order to clean an EnumerableMap, you can either remove all elements one by one or create
 *  a fresh instance using an array of EnumerableMap.
 * ====
 */
library EnumerableSetMap {
    using EnumerableSet for EnumerableSet.Bytes32Set;

    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Map type with
    // bytes32 keys and values.
    // The Map implementation uses private functions, and user-facing
    // implementations (such as Uint256ToAddressMap) are just wrappers around
    // the underlying Map.
    // This means that we can only create new EnumerableMaps for types that fit
    // in bytes32.

    struct Bytes32ToBytes32SetMap {
        // Storage of keys
        EnumerableSet.Bytes32Set _keys;
        mapping(bytes32 => EnumerableSet.Bytes32Set) _values;
    }

    /**
     * @dev Adds a key-value pair to a map, or updates the value for an existing
     * key. O(1).
     *
     * Returns true if the key & value was added to the set-map, that is if it was not
     * already present.
     */
    function set(
        Bytes32ToBytes32SetMap storage map,
        bytes32 key,
        bytes32 value
    ) internal returns (bool) {
        map._keys.add(key);
        return map._values[key].add(value);
    }

    /**
     * @dev Removes a key-value pair from a map. O(1).
     *
     * Returns true if the key & value was removed from the set-map, that is if it was present.
     */
    function remove(
        Bytes32ToBytes32SetMap storage map,
        bytes32 key,
        bytes32 value
    ) internal returns (bool) {
        return map._values[key].remove(value);
    }

    /**
     * @dev Returns true if the key & value is in the set-map. O(1).
     */
    function contains(
        Bytes32ToBytes32SetMap storage map,
        bytes32 key,
        bytes32 value
    ) internal view returns (bool) {
        return map._values[key].contains(value);
    }

    /**
     * @dev Returns the number of key-value pairs in the map. O(1).
     */
    function length(Bytes32ToBytes32SetMap storage map)
        internal
        view
        returns (uint256 result)
    {
        for (uint256 i = 0; i < map._keys.length(); i++) {
            result += length(map, map._keys.at(i));
        }
    }

    /**
     * @dev Returns the number of key-value pairs in the map. O(1).
     */
    function length(Bytes32ToBytes32SetMap storage map, bytes32 key)
        internal
        view
        returns (uint256)
    {
        return map._values[key].length();
    }

    /**
     * @dev Returns the key-value pair stored at position `index` in the map. O(1).
     *
     * Note that there are no guarantees on the ordering of entries inside the
     * array, and it may change when more entries are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Bytes32ToBytes32SetMap storage map, uint256 index)
        internal
        view
        returns (bytes32, EnumerableSet.Bytes32Set storage)
    {
        bytes32 key = map._keys.at(index);
        return (key, map._values[key]);
    }

    /**
     * @dev Tries to returns the value associated with `key`.  O(1).
     * Does not revert if `key` is not in the map.
     */
    function tryGet(Bytes32ToBytes32SetMap storage map, bytes32 key)
        internal
        view
        returns (bool, EnumerableSet.Bytes32Set storage)
    {
        EnumerableSet.Bytes32Set storage value = map._values[key];
        return (value.length() != 0, value);
    }

    /**
     * @dev Returns the value associated with `key`.  O(1).
     *
     * Requirements:
     *
     * - `key` must be in the map.
     */
    function get(Bytes32ToBytes32SetMap storage map, bytes32 key)
        internal
        view
        returns (EnumerableSet.Bytes32Set storage)
    {
        EnumerableSet.Bytes32Set storage value = map._values[key];
        require(value.length() != 0, "EnumerableSetMap: nonexistent key");
        return value;
    }

    /**
     * @dev Same as {_get}, with a custom error message when `key` is not in the map.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {_tryGet}.
     */
    function get(
        Bytes32ToBytes32SetMap storage map,
        bytes32 key,
        string memory errorMessage
    ) internal view returns (EnumerableSet.Bytes32Set storage) {
        EnumerableSet.Bytes32Set storage value = map._values[key];
        require(value.length() != 0, errorMessage);
        return value;
    }

    // Bytes32ToAddressSetMap

    struct Bytes32ToAddressSetMap {
        Bytes32ToBytes32SetMap _inner;
    }

    /**
     * @dev Adds a key-value pair to a map, or updates the value for an existing
     * key. O(1).
     *
     * Returns true if the key was added to the map, that is if it was not
     * already present.
     */
    function set(
        Bytes32ToAddressSetMap storage map,
        bytes32 key,
        address value
    ) internal returns (bool) {
        return set(map._inner, key, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the key was removed from the map, that is if it was present.
     */
    function remove(
        Bytes32ToAddressSetMap storage map,
        bytes32 key,
        address value
    ) internal returns (bool) {
        return remove(map._inner, key, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the key is in the map. O(1).
     */
    function contains(
        Bytes32ToAddressSetMap storage map,
        bytes32 key,
        address value
    ) internal view returns (bool) {
        return contains(map._inner, key, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of elements in the map. O(1).
     */
    function length(Bytes32ToAddressSetMap storage map)
        internal
        view
        returns (uint256)
    {
        return length(map._inner);
    }

    /**
     * @dev Returns the number of elements in the map. O(1).
     */
    function length(Bytes32ToAddressSetMap storage map, bytes32 key)
        internal
        view
        returns (uint256)
    {
        return length(map._inner, key);
    }

    /**
     * @dev Returns the element stored at position `index` in the set. O(1).
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Bytes32ToAddressSetMap storage map, uint256 index)
        internal
        view
        returns (bytes32, EnumerableSet.Bytes32Set storage)
    {
        return at(map._inner, index);
    }

    /**
     * @dev Tries to returns the value associated with `key`.  O(1).
     * Does not revert if `key` is not in the map.
     *
     * _Available since v3.4._
     */
    function tryGet(Bytes32ToAddressSetMap storage map, bytes32 key)
        internal
        view
        returns (bool, EnumerableSet.Bytes32Set storage)
    {
        return tryGet(map._inner, key);
    }

    /**
     * @dev Returns the value associated with `key`.  O(1).
     *
     * Requirements:
     *
     * - `key` must be in the map.
     */
    function get(Bytes32ToAddressSetMap storage map, bytes32 key)
        internal
        view
        returns (EnumerableSet.Bytes32Set storage)
    {
        return get(map._inner, key);
    }

    /**
     * @dev Same as {get}, with a custom error message when `key` is not in the map.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryGet}.
     */
    function get(
        Bytes32ToAddressSetMap storage map,
        bytes32 key,
        string memory errorMessage
    ) internal view returns (EnumerableSet.Bytes32Set storage) {
        return get(map._inner, key, errorMessage);
    }
}

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

import './pool/IUniswapV3PoolImmutables.sol';
import './pool/IUniswapV3PoolState.sol';
import './pool/IUniswapV3PoolDerivedState.sol';
import './pool/IUniswapV3PoolActions.sol';
import './pool/IUniswapV3PoolOwnerActions.sol';
import './pool/IUniswapV3PoolEvents.sol';

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

}

File 14 of 25 : 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 15 of 25 : 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 16 of 25 : IUniswapV3PoolState.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Pool state that can change
/// @notice These methods compose the pool's state, and can change with any frequency including multiple times
/// per transaction
interface IUniswapV3PoolState {
    /// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas
    /// when accessed externally.
    /// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value
    /// tick The current tick of the pool, i.e. according to the last tick transition that was run.
    /// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick
    /// boundary.
    /// observationIndex The index of the last oracle observation that was written,
    /// observationCardinality The current maximum number of observations stored in the pool,
    /// observationCardinalityNext The next maximum number of observations, to be updated when the observation.
    /// feeProtocol The protocol fee for both tokens of the pool.
    /// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0
    /// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee.
    /// unlocked Whether the pool is currently locked to reentrancy
    function slot0()
        external
        view
        returns (
            uint160 sqrtPriceX96,
            int24 tick,
            uint16 observationIndex,
            uint16 observationCardinality,
            uint16 observationCardinalityNext,
            uint8 feeProtocol,
            bool unlocked
        );

    /// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool
    /// @dev This value can overflow the uint256
    function feeGrowthGlobal0X128() external view returns (uint256);

    /// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool
    /// @dev This value can overflow the uint256
    function feeGrowthGlobal1X128() external view returns (uint256);

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

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

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

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

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

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

File 17 of 25 : 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 18 of 25 : 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 19 of 25 : 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 20 of 25 : 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 21 of 25 : OwnableUninitialized.sol
// SPDX-License-Identifier: MIT

/***
 *      ______             _______   __
 *     /      \           |       \ |  \
 *    |  $$$$$$\ __    __ | $$$$$$$\| $$  ______    _______  ______ ____    ______
 *    | $$$\| $$|  \  /  \| $$__/ $$| $$ |      \  /       \|      \    \  |      \
 *    | $$$$\ $$ \$$\/  $$| $$    $$| $$  \$$$$$$\|  $$$$$$$| $$$$$$\$$$$\  \$$$$$$\
 *    | $$\$$\$$  >$$  $$ | $$$$$$$ | $$ /      $$ \$$    \ | $$ | $$ | $$ /      $$
 *    | $$_\$$$$ /  $$$$\ | $$      | $$|  $$$$$$$ _\$$$$$$\| $$ | $$ | $$|  $$$$$$$
 *     \$$  \$$$|  $$ \$$\| $$      | $$ \$$    $$|       $$| $$ | $$ | $$ \$$    $$
 *      \$$$$$$  \$$   \$$ \$$       \$$  \$$$$$$$ \$$$$$$$  \$$  \$$  \$$  \$$$$$$$
 *
 *
 *
 */

pragma solidity ^0.8.4;

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an manager) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the manager account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyManager`, which can be applied to your functions to restrict their use to
 * the manager.
 */
/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO HyperLPoolStorage
/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO HyperLPoolStorage
abstract contract OwnableUninitialized {
    address internal _manager;

    event OwnershipTransferred(
        address indexed previousManager,
        address indexed newManager
    );

    /// @dev Initializes the contract setting the deployer as the initial manager.
    /// CONSTRUCTOR EMPTY - USE INITIALIZIABLE INSTEAD
    // solhint-disable-next-line no-empty-blocks
    constructor() {}

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

    /**
     * @dev Throws if called by any account other than the manager.
     */
    modifier onlyManager() {
        require(manager() == msg.sender, "Ownable: caller is not the manager");
        _;
    }

    /**
     * @dev Leaves the contract without manager. It will not be possible to call
     * `onlyManager` functions anymore. Can only be called by the current manager.
     *
     * NOTE: Renouncing ownership will leave the contract without an manager,
     * thereby removing any functionality that is only available to the manager.
     */
    function renounceOwnership() public virtual onlyManager {
        emit OwnershipTransferred(_manager, address(0));
        _manager = address(0);
    }

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

File 22 of 25 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.2;

import "../../utils/AddressUpgradeable.sol";

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
 * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
 * case an upgrade adds a module that needs to be initialized.
 *
 * For example:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * contract MyToken is ERC20Upgradeable {
 *     function initialize() initializer public {
 *         __ERC20_init("MyToken", "MTK");
 *     }
 * }
 * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
 *     function initializeV2() reinitializer(2) public {
 *         __ERC20Permit_init("MyToken");
 *     }
 * }
 * ```
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
 * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() {
 *     _disableInitializers();
 * }
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     * @custom:oz-retyped-from bool
     */
    uint8 private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Triggered when the contract has been initialized or reinitialized.
     */
    event Initialized(uint8 version);

    /**
     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
     * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`.
     */
    modifier initializer() {
        bool isTopLevelCall = !_initializing;
        require(
            (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
            "Initializable: contract is already initialized"
        );
        _initialized = 1;
        if (isTopLevelCall) {
            _initializing = true;
        }
        _;
        if (isTopLevelCall) {
            _initializing = false;
            emit Initialized(1);
        }
    }

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original
     * initialization step. This is essential to configure modules that are added through upgrades and that require
     * initialization.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     */
    modifier reinitializer(uint8 version) {
        require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
        _initialized = version;
        _initializing = true;
        _;
        _initializing = false;
        emit Initialized(version);
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} and {reinitializer} modifiers, directly or indirectly.
     */
    modifier onlyInitializing() {
        require(_initializing, "Initializable: contract is not initializing");
        _;
    }

    /**
     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called
     * through proxies.
     */
    function _disableInitializers() internal virtual {
        require(!_initializing, "Initializable: contract is initializing");
        if (_initialized < type(uint8).max) {
            _initialized = type(uint8).max;
            emit Initialized(type(uint8).max);
        }
    }
}

File 23 of 25 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library AddressUpgradeable {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [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 functionCall(target, data, "Address: low-level call failed");
    }

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

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

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

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(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) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason 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 {
            // 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 24 of 25 : EnumerableMap.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/structs/EnumerableMap.sol)

pragma solidity ^0.8.0;

import "./EnumerableSet.sol";

/**
 * @dev Library for managing an enumerable variant of Solidity's
 * https://solidity.readthedocs.io/en/latest/types.html#mapping-types[`mapping`]
 * type.
 *
 * Maps have the following properties:
 *
 * - Entries are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Entries are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableMap for EnumerableMap.UintToAddressMap;
 *
 *     // Declare a set state variable
 *     EnumerableMap.UintToAddressMap private myMap;
 * }
 * ```
 *
 * The following map types are supported:
 *
 * - `uint256 -> address` (`UintToAddressMap`) since v3.0.0
 * - `address -> uint256` (`AddressToUintMap`) since v4.6.0
 * - `bytes32 -> bytes32` (`Bytes32ToBytes32`) since v4.6.0
 * - `uint256 -> uint256` (`UintToUintMap`) since v4.7.0
 * - `bytes32 -> uint256` (`Bytes32ToUintMap`) since v4.7.0
 *
 * [WARNING]
 * ====
 *  Trying to delete such a structure from storage will likely result in data corruption, rendering the structure unusable.
 *  See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
 *
 *  In order to clean an EnumerableMap, you can either remove all elements one by one or create a fresh instance using an array of EnumerableMap.
 * ====
 */
library EnumerableMap {
    using EnumerableSet for EnumerableSet.Bytes32Set;

    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Map type with
    // bytes32 keys and values.
    // The Map implementation uses private functions, and user-facing
    // implementations (such as Uint256ToAddressMap) are just wrappers around
    // the underlying Map.
    // This means that we can only create new EnumerableMaps for types that fit
    // in bytes32.

    struct Bytes32ToBytes32Map {
        // Storage of keys
        EnumerableSet.Bytes32Set _keys;
        mapping(bytes32 => bytes32) _values;
    }

    /**
     * @dev Adds a key-value pair to a map, or updates the value for an existing
     * key. O(1).
     *
     * Returns true if the key was added to the map, that is if it was not
     * already present.
     */
    function set(
        Bytes32ToBytes32Map storage map,
        bytes32 key,
        bytes32 value
    ) internal returns (bool) {
        map._values[key] = value;
        return map._keys.add(key);
    }

    /**
     * @dev Removes a key-value pair from a map. O(1).
     *
     * Returns true if the key was removed from the map, that is if it was present.
     */
    function remove(Bytes32ToBytes32Map storage map, bytes32 key) internal returns (bool) {
        delete map._values[key];
        return map._keys.remove(key);
    }

    /**
     * @dev Returns true if the key is in the map. O(1).
     */
    function contains(Bytes32ToBytes32Map storage map, bytes32 key) internal view returns (bool) {
        return map._keys.contains(key);
    }

    /**
     * @dev Returns the number of key-value pairs in the map. O(1).
     */
    function length(Bytes32ToBytes32Map storage map) internal view returns (uint256) {
        return map._keys.length();
    }

    /**
     * @dev Returns the key-value pair stored at position `index` in the map. O(1).
     *
     * Note that there are no guarantees on the ordering of entries inside the
     * array, and it may change when more entries are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Bytes32ToBytes32Map storage map, uint256 index) internal view returns (bytes32, bytes32) {
        bytes32 key = map._keys.at(index);
        return (key, map._values[key]);
    }

    /**
     * @dev Tries to returns the value associated with `key`.  O(1).
     * Does not revert if `key` is not in the map.
     */
    function tryGet(Bytes32ToBytes32Map storage map, bytes32 key) internal view returns (bool, bytes32) {
        bytes32 value = map._values[key];
        if (value == bytes32(0)) {
            return (contains(map, key), bytes32(0));
        } else {
            return (true, value);
        }
    }

    /**
     * @dev Returns the value associated with `key`.  O(1).
     *
     * Requirements:
     *
     * - `key` must be in the map.
     */
    function get(Bytes32ToBytes32Map storage map, bytes32 key) internal view returns (bytes32) {
        bytes32 value = map._values[key];
        require(value != 0 || contains(map, key), "EnumerableMap: nonexistent key");
        return value;
    }

    /**
     * @dev Same as {_get}, with a custom error message when `key` is not in the map.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {_tryGet}.
     */
    function get(
        Bytes32ToBytes32Map storage map,
        bytes32 key,
        string memory errorMessage
    ) internal view returns (bytes32) {
        bytes32 value = map._values[key];
        require(value != 0 || contains(map, key), errorMessage);
        return value;
    }

    // UintToUintMap

    struct UintToUintMap {
        Bytes32ToBytes32Map _inner;
    }

    /**
     * @dev Adds a key-value pair to a map, or updates the value for an existing
     * key. O(1).
     *
     * Returns true if the key was added to the map, that is if it was not
     * already present.
     */
    function set(
        UintToUintMap storage map,
        uint256 key,
        uint256 value
    ) internal returns (bool) {
        return set(map._inner, bytes32(key), bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the key was removed from the map, that is if it was present.
     */
    function remove(UintToUintMap storage map, uint256 key) internal returns (bool) {
        return remove(map._inner, bytes32(key));
    }

    /**
     * @dev Returns true if the key is in the map. O(1).
     */
    function contains(UintToUintMap storage map, uint256 key) internal view returns (bool) {
        return contains(map._inner, bytes32(key));
    }

    /**
     * @dev Returns the number of elements in the map. O(1).
     */
    function length(UintToUintMap storage map) internal view returns (uint256) {
        return length(map._inner);
    }

    /**
     * @dev Returns the element stored at position `index` in the set. O(1).
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(UintToUintMap storage map, uint256 index) internal view returns (uint256, uint256) {
        (bytes32 key, bytes32 value) = at(map._inner, index);
        return (uint256(key), uint256(value));
    }

    /**
     * @dev Tries to returns the value associated with `key`.  O(1).
     * Does not revert if `key` is not in the map.
     */
    function tryGet(UintToUintMap storage map, uint256 key) internal view returns (bool, uint256) {
        (bool success, bytes32 value) = tryGet(map._inner, bytes32(key));
        return (success, uint256(value));
    }

    /**
     * @dev Returns the value associated with `key`.  O(1).
     *
     * Requirements:
     *
     * - `key` must be in the map.
     */
    function get(UintToUintMap storage map, uint256 key) internal view returns (uint256) {
        return uint256(get(map._inner, bytes32(key)));
    }

    /**
     * @dev Same as {get}, with a custom error message when `key` is not in the map.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryGet}.
     */
    function get(
        UintToUintMap storage map,
        uint256 key,
        string memory errorMessage
    ) internal view returns (uint256) {
        return uint256(get(map._inner, bytes32(key), errorMessage));
    }

    // UintToAddressMap

    struct UintToAddressMap {
        Bytes32ToBytes32Map _inner;
    }

    /**
     * @dev Adds a key-value pair to a map, or updates the value for an existing
     * key. O(1).
     *
     * Returns true if the key was added to the map, that is if it was not
     * already present.
     */
    function set(
        UintToAddressMap storage map,
        uint256 key,
        address value
    ) internal returns (bool) {
        return set(map._inner, bytes32(key), bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the key was removed from the map, that is if it was present.
     */
    function remove(UintToAddressMap storage map, uint256 key) internal returns (bool) {
        return remove(map._inner, bytes32(key));
    }

    /**
     * @dev Returns true if the key is in the map. O(1).
     */
    function contains(UintToAddressMap storage map, uint256 key) internal view returns (bool) {
        return contains(map._inner, bytes32(key));
    }

    /**
     * @dev Returns the number of elements in the map. O(1).
     */
    function length(UintToAddressMap storage map) internal view returns (uint256) {
        return length(map._inner);
    }

    /**
     * @dev Returns the element stored at position `index` in the set. O(1).
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(UintToAddressMap storage map, uint256 index) internal view returns (uint256, address) {
        (bytes32 key, bytes32 value) = at(map._inner, index);
        return (uint256(key), address(uint160(uint256(value))));
    }

    /**
     * @dev Tries to returns the value associated with `key`.  O(1).
     * Does not revert if `key` is not in the map.
     *
     * _Available since v3.4._
     */
    function tryGet(UintToAddressMap storage map, uint256 key) internal view returns (bool, address) {
        (bool success, bytes32 value) = tryGet(map._inner, bytes32(key));
        return (success, address(uint160(uint256(value))));
    }

    /**
     * @dev Returns the value associated with `key`.  O(1).
     *
     * Requirements:
     *
     * - `key` must be in the map.
     */
    function get(UintToAddressMap storage map, uint256 key) internal view returns (address) {
        return address(uint160(uint256(get(map._inner, bytes32(key)))));
    }

    /**
     * @dev Same as {get}, with a custom error message when `key` is not in the map.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryGet}.
     */
    function get(
        UintToAddressMap storage map,
        uint256 key,
        string memory errorMessage
    ) internal view returns (address) {
        return address(uint160(uint256(get(map._inner, bytes32(key), errorMessage))));
    }

    // AddressToUintMap

    struct AddressToUintMap {
        Bytes32ToBytes32Map _inner;
    }

    /**
     * @dev Adds a key-value pair to a map, or updates the value for an existing
     * key. O(1).
     *
     * Returns true if the key was added to the map, that is if it was not
     * already present.
     */
    function set(
        AddressToUintMap storage map,
        address key,
        uint256 value
    ) internal returns (bool) {
        return set(map._inner, bytes32(uint256(uint160(key))), bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the key was removed from the map, that is if it was present.
     */
    function remove(AddressToUintMap storage map, address key) internal returns (bool) {
        return remove(map._inner, bytes32(uint256(uint160(key))));
    }

    /**
     * @dev Returns true if the key is in the map. O(1).
     */
    function contains(AddressToUintMap storage map, address key) internal view returns (bool) {
        return contains(map._inner, bytes32(uint256(uint160(key))));
    }

    /**
     * @dev Returns the number of elements in the map. O(1).
     */
    function length(AddressToUintMap storage map) internal view returns (uint256) {
        return length(map._inner);
    }

    /**
     * @dev Returns the element stored at position `index` in the set. O(1).
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(AddressToUintMap storage map, uint256 index) internal view returns (address, uint256) {
        (bytes32 key, bytes32 value) = at(map._inner, index);
        return (address(uint160(uint256(key))), uint256(value));
    }

    /**
     * @dev Tries to returns the value associated with `key`.  O(1).
     * Does not revert if `key` is not in the map.
     */
    function tryGet(AddressToUintMap storage map, address key) internal view returns (bool, uint256) {
        (bool success, bytes32 value) = tryGet(map._inner, bytes32(uint256(uint160(key))));
        return (success, uint256(value));
    }

    /**
     * @dev Returns the value associated with `key`.  O(1).
     *
     * Requirements:
     *
     * - `key` must be in the map.
     */
    function get(AddressToUintMap storage map, address key) internal view returns (uint256) {
        return uint256(get(map._inner, bytes32(uint256(uint160(key)))));
    }

    /**
     * @dev Same as {get}, with a custom error message when `key` is not in the map.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryGet}.
     */
    function get(
        AddressToUintMap storage map,
        address key,
        string memory errorMessage
    ) internal view returns (uint256) {
        return uint256(get(map._inner, bytes32(uint256(uint160(key))), errorMessage));
    }

    // Bytes32ToUintMap

    struct Bytes32ToUintMap {
        Bytes32ToBytes32Map _inner;
    }

    /**
     * @dev Adds a key-value pair to a map, or updates the value for an existing
     * key. O(1).
     *
     * Returns true if the key was added to the map, that is if it was not
     * already present.
     */
    function set(
        Bytes32ToUintMap storage map,
        bytes32 key,
        uint256 value
    ) internal returns (bool) {
        return set(map._inner, key, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the key was removed from the map, that is if it was present.
     */
    function remove(Bytes32ToUintMap storage map, bytes32 key) internal returns (bool) {
        return remove(map._inner, key);
    }

    /**
     * @dev Returns true if the key is in the map. O(1).
     */
    function contains(Bytes32ToUintMap storage map, bytes32 key) internal view returns (bool) {
        return contains(map._inner, key);
    }

    /**
     * @dev Returns the number of elements in the map. O(1).
     */
    function length(Bytes32ToUintMap storage map) internal view returns (uint256) {
        return length(map._inner);
    }

    /**
     * @dev Returns the element stored at position `index` in the set. O(1).
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Bytes32ToUintMap storage map, uint256 index) internal view returns (bytes32, uint256) {
        (bytes32 key, bytes32 value) = at(map._inner, index);
        return (key, uint256(value));
    }

    /**
     * @dev Tries to returns the value associated with `key`.  O(1).
     * Does not revert if `key` is not in the map.
     */
    function tryGet(Bytes32ToUintMap storage map, bytes32 key) internal view returns (bool, uint256) {
        (bool success, bytes32 value) = tryGet(map._inner, key);
        return (success, uint256(value));
    }

    /**
     * @dev Returns the value associated with `key`.  O(1).
     *
     * Requirements:
     *
     * - `key` must be in the map.
     */
    function get(Bytes32ToUintMap storage map, bytes32 key) internal view returns (uint256) {
        return uint256(get(map._inner, key));
    }

    /**
     * @dev Same as {get}, with a custom error message when `key` is not in the map.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryGet}.
     */
    function get(
        Bytes32ToUintMap storage map,
        bytes32 key,
        string memory errorMessage
    ) internal view returns (uint256) {
        return uint256(get(map._inner, key, errorMessage));
    }
}

File 25 of 25 : Proxy.sol
// SPDX-License-Identifier: MIT

/***
 *      ______             _______   __
 *     /      \           |       \ |  \
 *    |  $$$$$$\ __    __ | $$$$$$$\| $$  ______    _______  ______ ____    ______
 *    | $$$\| $$|  \  /  \| $$__/ $$| $$ |      \  /       \|      \    \  |      \
 *    | $$$$\ $$ \$$\/  $$| $$    $$| $$  \$$$$$$\|  $$$$$$$| $$$$$$\$$$$\  \$$$$$$\
 *    | $$\$$\$$  >$$  $$ | $$$$$$$ | $$ /      $$ \$$    \ | $$ | $$ | $$ /      $$
 *    | $$_\$$$$ /  $$$$\ | $$      | $$|  $$$$$$$ _\$$$$$$\| $$ | $$ | $$|  $$$$$$$
 *     \$$  \$$$|  $$ \$$\| $$      | $$ \$$    $$|       $$| $$ | $$ | $$ \$$    $$
 *      \$$$$$$  \$$   \$$ \$$       \$$  \$$$$$$$ \$$$$$$$  \$$  \$$  \$$  \$$$$$$$
 *
 *
 *
 */

pragma solidity ^0.8.4;

// EIP-1967
abstract contract Proxy {
    // /////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////////

    event ProxyImplementationUpdated(
        address indexed previousImplementation,
        address indexed newImplementation
    );

    // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////

    // prettier-ignore
    receive() external payable virtual {
        revert("ETHER_REJECTED"); // explicit reject by default
    }

    fallback() external payable {
        _fallback();
    }

    // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////

    function _fallback() internal {
        // solhint-disable-next-line security/no-inline-assembly
        assembly {
            let implementationAddress := sload(
                0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc
            )
            calldatacopy(0x0, 0x0, calldatasize())
            let success := delegatecall(
                gas(),
                implementationAddress,
                0x0,
                calldatasize(),
                0,
                0
            )
            let retSz := returndatasize()
            returndatacopy(0, 0, retSz)
            switch success
                case 0 {
                    revert(0, retSz)
                }
                default {
                    return(0, retSz)
                }
        }
    }

    function _setImplementation(address newImplementation, bytes memory data)
        internal
    {
        address previousImplementation;
        // solhint-disable-next-line security/no-inline-assembly
        assembly {
            previousImplementation := sload(
                0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc
            )
        }

        // solhint-disable-next-line security/no-inline-assembly
        assembly {
            sstore(
                0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc,
                newImplementation
            )
        }

        emit ProxyImplementationUpdated(
            previousImplementation,
            newImplementation
        );

        if (data.length > 0) {
            (bool success, ) = newImplementation.delegatecall(data);
            if (!success) {
                assembly {
                    // This assembly ensure the revert contains the exact string data
                    let returnDataSize := returndatasize()
                    returndatacopy(0, 0, returnDataSize)
                    revert(0, returnDataSize)
                }
            }
        }
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 1
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "metadata": {
    "useLiteralContent": true
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_uniswapV3Factory","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"uniPool","type":"address"},{"indexed":true,"internalType":"address","name":"manager","type":"address"},{"indexed":true,"internalType":"address","name":"pool","type":"address"}],"name":"PoolCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"pool","type":"address"},{"indexed":false,"internalType":"bool","name":"isTrusted","type":"bool"}],"name":"PoolTrustToggled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previosHyperPoolsDeployer","type":"address"},{"indexed":false,"internalType":"address","name":"newHyperPoolsDeployer","type":"address"}],"name":"UpdateHyperPoolsDeployer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousImplementation","type":"address"},{"indexed":false,"internalType":"address","name":"newImplementation","type":"address"}],"name":"UpdatePoolImplementation","type":"event"},{"inputs":[{"components":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"uint24","name":"uniFee","type":"uint24"},{"internalType":"int24","name":"lowerTick","type":"int24"},{"internalType":"int24","name":"upperTick","type":"int24"},{"internalType":"address","name":"manager","type":"address"},{"internalType":"uint16","name":"managerFee","type":"uint16"}],"internalType":"struct TYPES.HPoolAttributes","name":"attributes","type":"tuple"}],"name":"createPool","outputs":[{"internalType":"address","name":"pool","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"factory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDeployers","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"uint24","name":"uniFee","type":"uint24"}],"internalType":"struct TYPES.UPoolAttributes","name":"attributes","type":"tuple"}],"name":"getHyperPools","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"deployer","type":"address"},{"components":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"uint24","name":"uniFee","type":"uint24"}],"internalType":"struct TYPES.UPoolAttributes","name":"attributes","type":"tuple"}],"name":"getPools","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"pool","type":"address"}],"name":"getProxyAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token0","type":"address"},{"internalType":"address","name":"token1","type":"address"}],"name":"getTokenName","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"hyperpoolsDeployer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_implementation","type":"address"},{"internalType":"address","name":"_hyperpoolsDeployer","type":"address"},{"internalType":"address","name":"_manager_","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"pool","type":"address"}],"name":"isPoolImmutable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"pool","type":"address"}],"name":"isTrustedPool","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"pools","type":"address[]"}],"name":"makePoolsImmutable","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"deployer","type":"address"},{"components":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"uint24","name":"uniFee","type":"uint24"}],"internalType":"struct TYPES.UPoolAttributes","name":"attributes","type":"tuple"}],"name":"numDeployerPools","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"numDeployers","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"uint24","name":"uniFee","type":"uint24"}],"internalType":"struct TYPES.UPoolAttributes","name":"attributes","type":"tuple"}],"name":"numPools","outputs":[{"internalType":"uint256","name":"result","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolImplementation","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"nextHyperPoolsDeployer","type":"address"}],"name":"setHyperPoolsDeployer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"nextImplementation","type":"address"}],"name":"setPoolImplementation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"pool","type":"address"}],"name":"toggleTrustedPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"pools","type":"address[]"}],"name":"upgradePools","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"pools","type":"address[]"},{"internalType":"bytes[]","name":"datas","type":"bytes[]"}],"name":"upgradePoolsAndCall","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"version","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]

60a060405234801561001057600080fd5b5060405162002ab338038062002ab383398101604081905261003191610042565b6001600160a01b0316608052610072565b60006020828403121561005457600080fd5b81516001600160a01b038116811461006b57600080fd5b9392505050565b608051612a1e620000956000396000818161034f01526113c90152612a1e6000f3fe60806040523480156200001157600080fd5b50600436106200014d5760003560e01c806254fe5b146200015257806305b27387146200017c578063098eddb114620001955780630997d80c146200019f5780630dfc574b14620001c5578063178c165014620001dc5780631b48340b14620001f0578063260fc2b814620002305780632f4e86ad146200024757806340aee041146200025e57806346f67f501462000275578063481c6a75146200029b5780634a5024d814620002a557806354fd4d5014620002bc578063607c12b514620002f0578063715018a614620002fa57806395d807f11462000304578063bd30dfb9146200031b578063c0c53b8b1462000332578063c45a01551462000349578063c568804b1462000371578063cefa77991462000388578063d6f74898146200039c578063f2fde38b14620003b3578063f3b7dead14620003ca575b600080fd5b6200016962000163366004620018a0565b620003e1565b6040519081526020015b60405180910390f35b620001936200018d366004620018d8565b6200044f565b005b62000169620004f5565b620001b6620001b0366004620018f8565b62000508565b6040516200017391906200190b565b62000193620001d6366004620019fb565b62000674565b600254620001b6906001600160a01b031681565b6200021f62000201366004620018d8565b6001600160a01b031660009081526006602052604090205460ff1690565b604051901515815260200162000173565b620001936200024136600462001a9c565b620007dc565b6200019362000258366004620018d8565b620008b6565b620001936200026f36600462001a9c565b62000955565b6200028c62000286366004620018a0565b62000a33565b60405162000173919062001ad4565b620001b662000a54565b62000169620002b636600462001b23565b62000a63565b620002e1604051806040016040528060058152602001640312e302e360dc1b81525081565b60405162000173919062001bbb565b6200028c62000aca565b6200019362000b84565b6200021f62000315366004620018d8565b62000bf1565b620002e16200032c36600462001bd0565b62000c0e565b620001936200034336600462001c0e565b62000d61565b620001b67f000000000000000000000000000000000000000000000000000000000000000081565b6200028c6200038236600462001b23565b62000ecb565b600154620001b6906001600160a01b031681565b62000193620003ad366004620018d8565b62000fc5565b62000193620003c4366004620018d8565b62001064565b620001b6620003db366004620018d8565b6200114b565b600080620003ee62000aca565b905060005b815181101562000448576200042582828151811062000416576200041662001c60565b60200260200101518562000a63565b62000431908462001c8c565b9250806200043f8162001ca7565b915050620003f3565b5050919050565b336200045a62000a54565b6001600160a01b0316146200048c5760405162461bcd60e51b8152600401620004839062001cc5565b60405180910390fd5b6001600160a01b038116600081815260066020908152604091829020805460ff81161560ff1990911681179091558251938452908301819052917fdca0d1d4731f59ebf7291aeb85511a7a8be4aa64c8df0ddd8ba7efc21030484b910160405180910390a15050565b6000620005036003620011b2565b905090565b60008080620005376200051f6020860186620018d8565b620005316040870160208801620018d8565b620011bd565b9092509050620005a2828262000554606088016040890162001d07565b620005666080890160608a0162001d3e565b6200057860a08a0160808b0162001d3e565b6200058a60c08b0160a08c01620018d8565b6200059c60e08c0160c08d0162001d5e565b6200128c565b9250620005b1600333620015a6565b506001600160a01b038316600090815260066020526040808220805460ff191660011790556200064b9084908490620005f19060608a01908a0162001d07565b6040516001600160601b0319606085811b8216602084015284901b1660348201526001600160e81b031960e883901b166048820152600090604b016040516020818303038152906040528051906020012090509392505050565b3360009081526005602052604090209091506200066a818387620015c4565b5050505050919050565b336200067f62000a54565b6001600160a01b031614620006a85760405162461bcd60e51b8152600401620004839062001cc5565b82518114620006f55760405162461bcd60e51b81526020600482015260186024820152770dad2e6dac2e8c6d0d2dcce40c2e4e4c2f240d8cadccee8d60431b604482015260640162000483565b60005b8351811015620007d65783818151811062000717576200071762001c60565b60200260200101516001600160a01b0316634f1ef286600160009054906101000a90046001600160a01b031685858581811062000758576200075862001c60565b90506020028101906200076c919062001d84565b6040518463ffffffff1660e01b81526004016200078c9392919062001dcd565b600060405180830381600087803b158015620007a757600080fd5b505af1158015620007bc573d6000803e3d6000fd5b505050508080620007cd9062001ca7565b915050620006f8565b50505050565b33620007e762000a54565b6001600160a01b031614620008105760405162461bcd60e51b8152600401620004839062001cc5565b60005b8151811015620008b25781818151811062000832576200083262001c60565b60200260200101516001600160a01b0316638356ca4f60006040518263ffffffff1660e01b81526004016200086891906200190b565b600060405180830381600087803b1580156200088357600080fd5b505af115801562000898573d6000803e3d6000fd5b505050508080620008a99062001ca7565b91505062000813565b5050565b33620008c162000a54565b6001600160a01b031614620008ea5760405162461bcd60e51b8152600401620004839062001cc5565b6002546040517fe9ef9a4474cae871569ffc4e09190efe64e243cb8749a5f10a0dec3bb7d3d123916200092b916001600160a01b0390911690849062001e0d565b60405180910390a1600280546001600160a01b0319166001600160a01b0392909216919091179055565b336200096062000a54565b6001600160a01b031614620009895760405162461bcd60e51b8152600401620004839062001cc5565b60005b8151811015620008b257818181518110620009ab57620009ab62001c60565b6020908102919091010151600154604051631b2ce7f360e11b81526001600160a01b0392831692633659cfe692620009e9929116906004016200190b565b600060405180830381600087803b15801562000a0457600080fd5b505af115801562000a19573d6000803e3d6000fd5b50505050808062000a2a9062001ca7565b9150506200098c565b60025460609062000a4e906001600160a01b03168362000ecb565b92915050565b6000546001600160a01b031690565b6000808062000a7a6200051f6020860186620018d8565b9092509050600062000a998383620005f16060890160408a0162001d07565b6001600160a01b038716600090815260056020526040902090915062000ac09082620015e4565b9695505050505050565b6060600062000ad8620004f5565b90506000816001600160401b0381111562000af75762000af76200191f565b60405190808252806020026020018201604052801562000b21578160200160208202803683370190505b50905060005b8281101562000b7d5762000b3b81620015f2565b82828151811062000b505762000b5062001c60565b6001600160a01b03909216602092830291909101909101528062000b748162001ca7565b91505062000b27565b5092915050565b3362000b8f62000a54565b6001600160a01b03161462000bb85760405162461bcd60e51b8152600401620004839062001cc5565b600080546040516001600160a01b0390911690600080516020620029c9833981519152908390a3600080546001600160a01b0319169055565b600062000bfe826200114b565b6001600160a01b03161592915050565b60606000836001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000c51573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000c7b919081019062001e27565b90506000836001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000cbe573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000ce8919081019062001e27565b905062000d58604051806040016040528060138152602001720243cb832b92837b7b639902ab734b9bbb0b81606d1b81525083604051806040016040528060018152602001602f60f81b81525084604051806040016040528060038152602001620204c560ec1b81525062001601565b95945050505050565b600054600160a81b900460ff161580801562000d8a57506000546001600160a01b90910460ff16105b8062000dad5750303b15801562000dad5750600054600160a01b900460ff166001145b62000e125760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840162000483565b6000805460ff60a01b1916600160a01b179055801562000e40576000805460ff60a81b1916600160a81b1790555b600180546001600160a01b038087166001600160a01b0319928316179092556002805486841690831617905560008054928516929091169190911790558015620007d6576000805460ff60a81b19169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150505050565b606060008062000ee36200051f6020860186620018d8565b9092509050600062000f028383620005f16060890160408a0162001d07565b9050600062000f12878762000a63565b90506000816001600160401b0381111562000f315762000f316200191f565b60405190808252806020026020018201604052801562000f5b578160200160208202803683370190505b50905060005b8281101562000fb95762000f7789858362001638565b82828151811062000f8c5762000f8c62001c60565b6001600160a01b03909216602092830291909101909101528062000fb08162001ca7565b91505062000f61565b50979650505050505050565b3362000fd062000a54565b6001600160a01b03161462000ff95760405162461bcd60e51b8152600401620004839062001cc5565b6001546040517f0617fd31aa5ab95ec80eefc1eb61a2c477aa419d1d761b4e46f5f077e47852aa916200103a916001600160a01b0390911690849062001e0d565b60405180910390a1600180546001600160a01b0319166001600160a01b0392909216919091179055565b336200106f62000a54565b6001600160a01b031614620010985760405162461bcd60e51b8152600401620004839062001cc5565b6001600160a01b038116620011015760405162461bcd60e51b815260206004820152602860248201527f4f776e61626c653a206e6577206d616e6167657220697320746865207a65726f604482015267206164647265737360c01b606482015260840162000483565b600080546040516001600160a01b0380851693921691600080516020620029c983398151915291a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000816001600160a01b0316633e47158c6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200118c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000a4e919062001ec5565b600062000a4e825490565b600080826001600160a01b0316846001600160a01b03161415620012115760405162461bcd60e51b815260206004820152600a60248201526939b0b6b2903a37b5b2b760b11b604482015260640162000483565b826001600160a01b0316846001600160a01b0316106200123357828462001236565b83835b90925090506001600160a01b038216620012855760405162461bcd60e51b815260206004820152600f60248201526e6e6f2061646472657373207a65726f60881b604482015260640162000483565b9250929050565b6001546040516000916001600160a01b0316903090620012ac9062001879565b6001600160a01b03928316815291166020820152606060408201819052600090820152608001604051809103906000f080158015620012ef573d6000803e3d6000fd5b50604080518082018252601581527404879706572506f6f6c7320556e6973776170204c5605c1b6020820152905163bd30dfb960e01b815291925090309063bd30dfb99062001345908c908c9060040162001e0d565b600060405180830381865afa9250505080156200138657506040513d6000823e601f3d908101601f1916820160405262001383919081019062001e27565b60015b620013915762001394565b90505b604051630b4c774160e11b81526001600160a01b038a81166004830152898116602483015262ffffff891660448301526000917f000000000000000000000000000000000000000000000000000000000000000090911690631698ee8290606401602060405180830381865afa15801562001413573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001439919062001ec5565b90506001600160a01b038116620014915760405162461bcd60e51b815260206004820152601b60248201527a1d5b9a5cddd85c081c1bdbdb08191bd95cc81b9bdd08195e1a5cdd602a1b604482015260640162000483565b6200149e8188886200166a565b620014e35760405162461bcd60e51b81526020600482015260146024820152730e8d2c6d6a6e0c2c6d2dcce40dad2e6dac2e8c6d60631b604482015260640162000483565b60405163e25e15e360e01b81526001600160a01b0384169063e25e15e3906200151b908590859089908d908d908d9060040162001ee5565b600060405180830381600087803b1580156200153657600080fd5b505af11580156200154b573d6000803e3d6000fd5b50505050826001600160a01b0316856001600160a01b0316826001600160a01b03167f9c5d829b9b23efc461f9aeef91979ec04bb903feb3bee4f26d22114abfc7335b60405160405180910390a45050979650505050505050565b6000620015bd836001600160a01b03841662001717565b9392505050565b6000620015dc84846001600160a01b03851662001769565b949350505050565b6000620015bd838362001794565b600062000a4e600383620017af565b606085858585856040516020016200161e95949392919062001f5c565b604051602081830303815290604052905095945050505050565b6001600160a01b0383166000908152600560205260408120620015dc908390620016639086620017bd565b90620017af565b600080846001600160a01b031663d0c93a7c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015620016ac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620016d2919062001fd1565b90508260020b8460020b128015620016f65750620016f1818562001ff1565b60020b155b801562000d5857506200170a818462001ff1565b60020b1595945050505050565b6000818152600183016020526040812054620017605750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915562000a4e565b50600062000a4e565b6000620017778484620017cb565b5060008381526002850160205260409020620015dc9083620017cb565b60008181526002830160205260408120620015bd90620011b2565b6000620015bd8383620017d9565b6000620015bd838362001806565b6000620015bd838362001717565b6000826000018281548110620017f357620017f362001c60565b9060005260206000200154905092915050565b600081815260028301602052604081206200182181620011b2565b620015bd5760405162461bcd60e51b815260206004820152602160248201527f456e756d657261626c655365744d61703a206e6f6e6578697374656e74206b656044820152607960f81b606482015260840162000483565b6109a6806200202383390190565b6000606082840312156200189a57600080fd5b50919050565b600060608284031215620018b357600080fd5b620015bd838362001887565b6001600160a01b0381168114620018d557600080fd5b50565b600060208284031215620018eb57600080fd5b8135620015bd81620018bf565b600060e082840312156200189a57600080fd5b6001600160a01b0391909116815260200190565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156200196057620019606200191f565b604052919050565b600082601f8301126200197a57600080fd5b813560206001600160401b038211156200199857620019986200191f565b8160051b620019a982820162001935565b9283528481018201928281019087851115620019c457600080fd5b83870192505b84831015620019f0578235620019e081620018bf565b82529183019190830190620019ca565b979650505050505050565b60008060006040848603121562001a1157600080fd5b83356001600160401b038082111562001a2957600080fd5b62001a378783880162001968565b9450602086013591508082111562001a4e57600080fd5b818601915086601f83011262001a6357600080fd5b81358181111562001a7357600080fd5b8760208260051b850101111562001a8957600080fd5b6020830194508093505050509250925092565b60006020828403121562001aaf57600080fd5b81356001600160401b0381111562001ac657600080fd5b620015dc8482850162001968565b6020808252825182820181905260009190848201906040850190845b8181101562001b175783516001600160a01b03168352928401929184019160010162001af0565b50909695505050505050565b6000806080838503121562001b3757600080fd5b823562001b4481620018bf565b915062001b55846020850162001887565b90509250929050565b60005b8381101562001b7b57818101518382015260200162001b61565b83811115620007d65750506000910152565b6000815180845262001ba781602086016020860162001b5e565b601f01601f19169290920160200192915050565b602081526000620015bd602083018462001b8d565b6000806040838503121562001be457600080fd5b823562001bf181620018bf565b9150602083013562001c0381620018bf565b809150509250929050565b60008060006060848603121562001c2457600080fd5b833562001c3181620018bf565b9250602084013562001c4381620018bf565b9150604084013562001c5581620018bf565b809150509250925092565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000821982111562001ca25762001ca262001c76565b500190565b600060001982141562001cbe5762001cbe62001c76565b5060010190565b60208082526022908201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206d616e616760408201526132b960f11b606082015260800190565b60006020828403121562001d1a57600080fd5b813562ffffff81168114620015bd57600080fd5b8060020b8114620018d557600080fd5b60006020828403121562001d5157600080fd5b8135620015bd8162001d2e565b60006020828403121562001d7157600080fd5b813561ffff81168114620015bd57600080fd5b6000808335601e1984360301811262001d9c57600080fd5b8301803591506001600160401b0382111562001db757600080fd5b6020019150368190038213156200128557600080fd5b6001600160a01b03841681526040602082018190528101829052818360608301376000818301606090810191909152601f909201601f1916010192915050565b6001600160a01b0392831681529116602082015260400190565b60006020828403121562001e3a57600080fd5b81516001600160401b038082111562001e5257600080fd5b818401915084601f83011262001e6757600080fd5b81518181111562001e7c5762001e7c6200191f565b62001e91601f8201601f191660200162001935565b915080825285602082850101111562001ea957600080fd5b62001ebc81602084016020860162001b5e565b50949350505050565b60006020828403121562001ed857600080fd5b8151620015bd81620018bf565b60e08152600062001efa60e083018962001b8d565b82810360208401526007815266048797065724c560cc1b60208201526040810191505060018060a01b03808816604084015261ffff871660608401528560020b60808401528460020b60a084015280841660c084015250979650505050505050565b6000865162001f70818460208b0162001b5e565b86519083019062001f86818360208b0162001b5e565b865191019062001f9b818360208a0162001b5e565b855191019062001fb081836020890162001b5e565b845191019062001fc581836020880162001b5e565b01979650505050505050565b60006020828403121562001fe457600080fd5b8151620015bd8162001d2e565b60008260020b806200201357634e487b7160e01b600052601260045260246000fd5b808360020b079150509291505056fe60806040526040516109a63803806109a6833981016040819052610022916101e6565b61002c838261003d565b61003582610119565b5050506102d2565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610114576000836001600160a01b0316836040516100be91906102b6565b600060405180830381855af49150503d80600081146100f9576040519150601f19603f3d011682016040523d82523d6000602084013e6100fe565b606091505b5050905080610112573d806000803e806000fd5b505b505050565b60006101316000805160206109868339815191525490565b90508160008051602061098683398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80516001600160a01b038116811461019f57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156101d55781810151838201526020016101bd565b838111156101125750506000910152565b6000806000606084860312156101fb57600080fd5b61020484610188565b925061021260208501610188565b60408501519092506001600160401b038082111561022f57600080fd5b818601915086601f83011261024357600080fd5b815181811115610255576102556101a4565b604051601f8201601f19908116603f0116810190838211818310171561027d5761027d6101a4565b8160405282815289602084870101111561029657600080fd5b6102a78360208301602088016101ba565b80955050505050509250925092565b600082516102c88184602087016101ba565b9190910192915050565b6106a5806102e16000396000f3fe60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046104c7565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb36600461050d565b61026f565b3480156100fc57600080fd5b506101056102c3565b6040516001600160a01b0390911681526020016100c7565b61009961012b366004610528565b6102d2565b34801561013c57600080fd5b5061009961014b36600461050d565b61034f565b6000805160206106508339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831614156101e157506000919050565b600080516020610650833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa92505050801561025b575060408051601f3d908101601f19168201909252610258918101906105aa565b60015b6102685750600092915050565b9392505050565b610277610390565b6001600160a01b0316336001600160a01b0316146102a75760405162461bcd60e51b8152600401610088906105cc565b6102c081604051806020016040528060008152506103a3565b50565b60006102cd610390565b905090565b6102da610390565b6001600160a01b0316336001600160a01b03161461030a5760405162461bcd60e51b8152600401610088906105cc565b61034a8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103a392505050565b505050565b610357610390565b6001600160a01b0316336001600160a01b0316146103875760405162461bcd60e51b8152600401610088906105cc565b6102c081610466565b6000805160206106308339815191525490565b6000805160206106508339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a381511561034a576000836001600160a01b03168360405161041291906105f4565b600060405180830381855af49150503d806000811461044d576040519150601f19603f3d011682016040523d82523d6000602084013e610452565b606091505b5050905080610183573d806000803e806000fd5b6000610470610390565b90508160008051602061063083398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b6000602082840312156104d957600080fd5b81356001600160e01b03198116811461026857600080fd5b80356001600160a01b038116811461050857600080fd5b919050565b60006020828403121561051f57600080fd5b610268826104f1565b60008060006040848603121561053d57600080fd5b610546846104f1565b925060208401356001600160401b038082111561056257600080fd5b818601915086601f83011261057657600080fd5b81358181111561058557600080fd5b87602082850101111561059757600080fd5b6020830194508093505050509250925092565b6000602082840312156105bc57600080fd5b8151801515811461026857600080fd5b6020808252600e908201526d1393d517d055551213d49256915160921b604082015260600190565b6000825160005b8181101561061557602081860181015185830152016105fb565b81811115610624576000828501525b50919091019291505056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca26469706673582212201e466a60e25c54a0962d15d802a1679b7fda211dceaeef75fa48f47d1b61f8b764736f6c634300080a0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61038be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0a26469706673582212209daf7908152c2f4eccdc060c84a55c2f5505f7fa743b1bdfcf96498457a1ac0764736f6c634300080a00330000000000000000000000001f98431c8ad98523631ae4a59f267346ea31f984

Deployed Bytecode

0x60806040523480156200001157600080fd5b50600436106200014d5760003560e01c806254fe5b146200015257806305b27387146200017c578063098eddb114620001955780630997d80c146200019f5780630dfc574b14620001c5578063178c165014620001dc5780631b48340b14620001f0578063260fc2b814620002305780632f4e86ad146200024757806340aee041146200025e57806346f67f501462000275578063481c6a75146200029b5780634a5024d814620002a557806354fd4d5014620002bc578063607c12b514620002f0578063715018a614620002fa57806395d807f11462000304578063bd30dfb9146200031b578063c0c53b8b1462000332578063c45a01551462000349578063c568804b1462000371578063cefa77991462000388578063d6f74898146200039c578063f2fde38b14620003b3578063f3b7dead14620003ca575b600080fd5b6200016962000163366004620018a0565b620003e1565b6040519081526020015b60405180910390f35b620001936200018d366004620018d8565b6200044f565b005b62000169620004f5565b620001b6620001b0366004620018f8565b62000508565b6040516200017391906200190b565b62000193620001d6366004620019fb565b62000674565b600254620001b6906001600160a01b031681565b6200021f62000201366004620018d8565b6001600160a01b031660009081526006602052604090205460ff1690565b604051901515815260200162000173565b620001936200024136600462001a9c565b620007dc565b6200019362000258366004620018d8565b620008b6565b620001936200026f36600462001a9c565b62000955565b6200028c62000286366004620018a0565b62000a33565b60405162000173919062001ad4565b620001b662000a54565b62000169620002b636600462001b23565b62000a63565b620002e1604051806040016040528060058152602001640312e302e360dc1b81525081565b60405162000173919062001bbb565b6200028c62000aca565b6200019362000b84565b6200021f62000315366004620018d8565b62000bf1565b620002e16200032c36600462001bd0565b62000c0e565b620001936200034336600462001c0e565b62000d61565b620001b67f0000000000000000000000001f98431c8ad98523631ae4a59f267346ea31f98481565b6200028c6200038236600462001b23565b62000ecb565b600154620001b6906001600160a01b031681565b62000193620003ad366004620018d8565b62000fc5565b62000193620003c4366004620018d8565b62001064565b620001b6620003db366004620018d8565b6200114b565b600080620003ee62000aca565b905060005b815181101562000448576200042582828151811062000416576200041662001c60565b60200260200101518562000a63565b62000431908462001c8c565b9250806200043f8162001ca7565b915050620003f3565b5050919050565b336200045a62000a54565b6001600160a01b0316146200048c5760405162461bcd60e51b8152600401620004839062001cc5565b60405180910390fd5b6001600160a01b038116600081815260066020908152604091829020805460ff81161560ff1990911681179091558251938452908301819052917fdca0d1d4731f59ebf7291aeb85511a7a8be4aa64c8df0ddd8ba7efc21030484b910160405180910390a15050565b6000620005036003620011b2565b905090565b60008080620005376200051f6020860186620018d8565b620005316040870160208801620018d8565b620011bd565b9092509050620005a2828262000554606088016040890162001d07565b620005666080890160608a0162001d3e565b6200057860a08a0160808b0162001d3e565b6200058a60c08b0160a08c01620018d8565b6200059c60e08c0160c08d0162001d5e565b6200128c565b9250620005b1600333620015a6565b506001600160a01b038316600090815260066020526040808220805460ff191660011790556200064b9084908490620005f19060608a01908a0162001d07565b6040516001600160601b0319606085811b8216602084015284901b1660348201526001600160e81b031960e883901b166048820152600090604b016040516020818303038152906040528051906020012090509392505050565b3360009081526005602052604090209091506200066a818387620015c4565b5050505050919050565b336200067f62000a54565b6001600160a01b031614620006a85760405162461bcd60e51b8152600401620004839062001cc5565b82518114620006f55760405162461bcd60e51b81526020600482015260186024820152770dad2e6dac2e8c6d0d2dcce40c2e4e4c2f240d8cadccee8d60431b604482015260640162000483565b60005b8351811015620007d65783818151811062000717576200071762001c60565b60200260200101516001600160a01b0316634f1ef286600160009054906101000a90046001600160a01b031685858581811062000758576200075862001c60565b90506020028101906200076c919062001d84565b6040518463ffffffff1660e01b81526004016200078c9392919062001dcd565b600060405180830381600087803b158015620007a757600080fd5b505af1158015620007bc573d6000803e3d6000fd5b505050508080620007cd9062001ca7565b915050620006f8565b50505050565b33620007e762000a54565b6001600160a01b031614620008105760405162461bcd60e51b8152600401620004839062001cc5565b60005b8151811015620008b25781818151811062000832576200083262001c60565b60200260200101516001600160a01b0316638356ca4f60006040518263ffffffff1660e01b81526004016200086891906200190b565b600060405180830381600087803b1580156200088357600080fd5b505af115801562000898573d6000803e3d6000fd5b505050508080620008a99062001ca7565b91505062000813565b5050565b33620008c162000a54565b6001600160a01b031614620008ea5760405162461bcd60e51b8152600401620004839062001cc5565b6002546040517fe9ef9a4474cae871569ffc4e09190efe64e243cb8749a5f10a0dec3bb7d3d123916200092b916001600160a01b0390911690849062001e0d565b60405180910390a1600280546001600160a01b0319166001600160a01b0392909216919091179055565b336200096062000a54565b6001600160a01b031614620009895760405162461bcd60e51b8152600401620004839062001cc5565b60005b8151811015620008b257818181518110620009ab57620009ab62001c60565b6020908102919091010151600154604051631b2ce7f360e11b81526001600160a01b0392831692633659cfe692620009e9929116906004016200190b565b600060405180830381600087803b15801562000a0457600080fd5b505af115801562000a19573d6000803e3d6000fd5b50505050808062000a2a9062001ca7565b9150506200098c565b60025460609062000a4e906001600160a01b03168362000ecb565b92915050565b6000546001600160a01b031690565b6000808062000a7a6200051f6020860186620018d8565b9092509050600062000a998383620005f16060890160408a0162001d07565b6001600160a01b038716600090815260056020526040902090915062000ac09082620015e4565b9695505050505050565b6060600062000ad8620004f5565b90506000816001600160401b0381111562000af75762000af76200191f565b60405190808252806020026020018201604052801562000b21578160200160208202803683370190505b50905060005b8281101562000b7d5762000b3b81620015f2565b82828151811062000b505762000b5062001c60565b6001600160a01b03909216602092830291909101909101528062000b748162001ca7565b91505062000b27565b5092915050565b3362000b8f62000a54565b6001600160a01b03161462000bb85760405162461bcd60e51b8152600401620004839062001cc5565b600080546040516001600160a01b0390911690600080516020620029c9833981519152908390a3600080546001600160a01b0319169055565b600062000bfe826200114b565b6001600160a01b03161592915050565b60606000836001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000c51573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000c7b919081019062001e27565b90506000836001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000cbe573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000ce8919081019062001e27565b905062000d58604051806040016040528060138152602001720243cb832b92837b7b639902ab734b9bbb0b81606d1b81525083604051806040016040528060018152602001602f60f81b81525084604051806040016040528060038152602001620204c560ec1b81525062001601565b95945050505050565b600054600160a81b900460ff161580801562000d8a57506000546001600160a01b90910460ff16105b8062000dad5750303b15801562000dad5750600054600160a01b900460ff166001145b62000e125760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840162000483565b6000805460ff60a01b1916600160a01b179055801562000e40576000805460ff60a81b1916600160a81b1790555b600180546001600160a01b038087166001600160a01b0319928316179092556002805486841690831617905560008054928516929091169190911790558015620007d6576000805460ff60a81b19169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150505050565b606060008062000ee36200051f6020860186620018d8565b9092509050600062000f028383620005f16060890160408a0162001d07565b9050600062000f12878762000a63565b90506000816001600160401b0381111562000f315762000f316200191f565b60405190808252806020026020018201604052801562000f5b578160200160208202803683370190505b50905060005b8281101562000fb95762000f7789858362001638565b82828151811062000f8c5762000f8c62001c60565b6001600160a01b03909216602092830291909101909101528062000fb08162001ca7565b91505062000f61565b50979650505050505050565b3362000fd062000a54565b6001600160a01b03161462000ff95760405162461bcd60e51b8152600401620004839062001cc5565b6001546040517f0617fd31aa5ab95ec80eefc1eb61a2c477aa419d1d761b4e46f5f077e47852aa916200103a916001600160a01b0390911690849062001e0d565b60405180910390a1600180546001600160a01b0319166001600160a01b0392909216919091179055565b336200106f62000a54565b6001600160a01b031614620010985760405162461bcd60e51b8152600401620004839062001cc5565b6001600160a01b038116620011015760405162461bcd60e51b815260206004820152602860248201527f4f776e61626c653a206e6577206d616e6167657220697320746865207a65726f604482015267206164647265737360c01b606482015260840162000483565b600080546040516001600160a01b0380851693921691600080516020620029c983398151915291a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000816001600160a01b0316633e47158c6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200118c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000a4e919062001ec5565b600062000a4e825490565b600080826001600160a01b0316846001600160a01b03161415620012115760405162461bcd60e51b815260206004820152600a60248201526939b0b6b2903a37b5b2b760b11b604482015260640162000483565b826001600160a01b0316846001600160a01b0316106200123357828462001236565b83835b90925090506001600160a01b038216620012855760405162461bcd60e51b815260206004820152600f60248201526e6e6f2061646472657373207a65726f60881b604482015260640162000483565b9250929050565b6001546040516000916001600160a01b0316903090620012ac9062001879565b6001600160a01b03928316815291166020820152606060408201819052600090820152608001604051809103906000f080158015620012ef573d6000803e3d6000fd5b50604080518082018252601581527404879706572506f6f6c7320556e6973776170204c5605c1b6020820152905163bd30dfb960e01b815291925090309063bd30dfb99062001345908c908c9060040162001e0d565b600060405180830381865afa9250505080156200138657506040513d6000823e601f3d908101601f1916820160405262001383919081019062001e27565b60015b620013915762001394565b90505b604051630b4c774160e11b81526001600160a01b038a81166004830152898116602483015262ffffff891660448301526000917f0000000000000000000000001f98431c8ad98523631ae4a59f267346ea31f98490911690631698ee8290606401602060405180830381865afa15801562001413573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001439919062001ec5565b90506001600160a01b038116620014915760405162461bcd60e51b815260206004820152601b60248201527a1d5b9a5cddd85c081c1bdbdb08191bd95cc81b9bdd08195e1a5cdd602a1b604482015260640162000483565b6200149e8188886200166a565b620014e35760405162461bcd60e51b81526020600482015260146024820152730e8d2c6d6a6e0c2c6d2dcce40dad2e6dac2e8c6d60631b604482015260640162000483565b60405163e25e15e360e01b81526001600160a01b0384169063e25e15e3906200151b908590859089908d908d908d9060040162001ee5565b600060405180830381600087803b1580156200153657600080fd5b505af11580156200154b573d6000803e3d6000fd5b50505050826001600160a01b0316856001600160a01b0316826001600160a01b03167f9c5d829b9b23efc461f9aeef91979ec04bb903feb3bee4f26d22114abfc7335b60405160405180910390a45050979650505050505050565b6000620015bd836001600160a01b03841662001717565b9392505050565b6000620015dc84846001600160a01b03851662001769565b949350505050565b6000620015bd838362001794565b600062000a4e600383620017af565b606085858585856040516020016200161e95949392919062001f5c565b604051602081830303815290604052905095945050505050565b6001600160a01b0383166000908152600560205260408120620015dc908390620016639086620017bd565b90620017af565b600080846001600160a01b031663d0c93a7c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015620016ac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620016d2919062001fd1565b90508260020b8460020b128015620016f65750620016f1818562001ff1565b60020b155b801562000d5857506200170a818462001ff1565b60020b1595945050505050565b6000818152600183016020526040812054620017605750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915562000a4e565b50600062000a4e565b6000620017778484620017cb565b5060008381526002850160205260409020620015dc9083620017cb565b60008181526002830160205260408120620015bd90620011b2565b6000620015bd8383620017d9565b6000620015bd838362001806565b6000620015bd838362001717565b6000826000018281548110620017f357620017f362001c60565b9060005260206000200154905092915050565b600081815260028301602052604081206200182181620011b2565b620015bd5760405162461bcd60e51b815260206004820152602160248201527f456e756d657261626c655365744d61703a206e6f6e6578697374656e74206b656044820152607960f81b606482015260840162000483565b6109a6806200202383390190565b6000606082840312156200189a57600080fd5b50919050565b600060608284031215620018b357600080fd5b620015bd838362001887565b6001600160a01b0381168114620018d557600080fd5b50565b600060208284031215620018eb57600080fd5b8135620015bd81620018bf565b600060e082840312156200189a57600080fd5b6001600160a01b0391909116815260200190565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156200196057620019606200191f565b604052919050565b600082601f8301126200197a57600080fd5b813560206001600160401b038211156200199857620019986200191f565b8160051b620019a982820162001935565b9283528481018201928281019087851115620019c457600080fd5b83870192505b84831015620019f0578235620019e081620018bf565b82529183019190830190620019ca565b979650505050505050565b60008060006040848603121562001a1157600080fd5b83356001600160401b038082111562001a2957600080fd5b62001a378783880162001968565b9450602086013591508082111562001a4e57600080fd5b818601915086601f83011262001a6357600080fd5b81358181111562001a7357600080fd5b8760208260051b850101111562001a8957600080fd5b6020830194508093505050509250925092565b60006020828403121562001aaf57600080fd5b81356001600160401b0381111562001ac657600080fd5b620015dc8482850162001968565b6020808252825182820181905260009190848201906040850190845b8181101562001b175783516001600160a01b03168352928401929184019160010162001af0565b50909695505050505050565b6000806080838503121562001b3757600080fd5b823562001b4481620018bf565b915062001b55846020850162001887565b90509250929050565b60005b8381101562001b7b57818101518382015260200162001b61565b83811115620007d65750506000910152565b6000815180845262001ba781602086016020860162001b5e565b601f01601f19169290920160200192915050565b602081526000620015bd602083018462001b8d565b6000806040838503121562001be457600080fd5b823562001bf181620018bf565b9150602083013562001c0381620018bf565b809150509250929050565b60008060006060848603121562001c2457600080fd5b833562001c3181620018bf565b9250602084013562001c4381620018bf565b9150604084013562001c5581620018bf565b809150509250925092565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000821982111562001ca25762001ca262001c76565b500190565b600060001982141562001cbe5762001cbe62001c76565b5060010190565b60208082526022908201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206d616e616760408201526132b960f11b606082015260800190565b60006020828403121562001d1a57600080fd5b813562ffffff81168114620015bd57600080fd5b8060020b8114620018d557600080fd5b60006020828403121562001d5157600080fd5b8135620015bd8162001d2e565b60006020828403121562001d7157600080fd5b813561ffff81168114620015bd57600080fd5b6000808335601e1984360301811262001d9c57600080fd5b8301803591506001600160401b0382111562001db757600080fd5b6020019150368190038213156200128557600080fd5b6001600160a01b03841681526040602082018190528101829052818360608301376000818301606090810191909152601f909201601f1916010192915050565b6001600160a01b0392831681529116602082015260400190565b60006020828403121562001e3a57600080fd5b81516001600160401b038082111562001e5257600080fd5b818401915084601f83011262001e6757600080fd5b81518181111562001e7c5762001e7c6200191f565b62001e91601f8201601f191660200162001935565b915080825285602082850101111562001ea957600080fd5b62001ebc81602084016020860162001b5e565b50949350505050565b60006020828403121562001ed857600080fd5b8151620015bd81620018bf565b60e08152600062001efa60e083018962001b8d565b82810360208401526007815266048797065724c560cc1b60208201526040810191505060018060a01b03808816604084015261ffff871660608401528560020b60808401528460020b60a084015280841660c084015250979650505050505050565b6000865162001f70818460208b0162001b5e565b86519083019062001f86818360208b0162001b5e565b865191019062001f9b818360208a0162001b5e565b855191019062001fb081836020890162001b5e565b845191019062001fc581836020880162001b5e565b01979650505050505050565b60006020828403121562001fe457600080fd5b8151620015bd8162001d2e565b60008260020b806200201357634e487b7160e01b600052601260045260246000fd5b808360020b079150509291505056fe60806040526040516109a63803806109a6833981016040819052610022916101e6565b61002c838261003d565b61003582610119565b5050506102d2565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a3815115610114576000836001600160a01b0316836040516100be91906102b6565b600060405180830381855af49150503d80600081146100f9576040519150601f19603f3d011682016040523d82523d6000602084013e6100fe565b606091505b5050905080610112573d806000803e806000fd5b505b505050565b60006101316000805160206109868339815191525490565b90508160008051602061098683398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b80516001600160a01b038116811461019f57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156101d55781810151838201526020016101bd565b838111156101125750506000910152565b6000806000606084860312156101fb57600080fd5b61020484610188565b925061021260208501610188565b60408501519092506001600160401b038082111561022f57600080fd5b818601915086601f83011261024357600080fd5b815181811115610255576102556101a4565b604051601f8201601f19908116603f0116810190838211818310171561027d5761027d6101a4565b8160405282815289602084870101111561029657600080fd5b6102a78360208301602088016101ba565b80955050505050509250925092565b600082516102c88184602087016101ba565b9190910192915050565b6106a5806102e16000396000f3fe60806040526004361061004e5760003560e01c806301ffc9a71461009b5780633659cfe6146100d05780633e47158c146100f05780634f1ef2861461011d5780638356ca4f1461013057610091565b366100915760405162461bcd60e51b815260206004820152600e60248201526d115512115497d491529150d5115160921b60448201526064015b60405180910390fd5b610099610150565b005b3480156100a757600080fd5b506100bb6100b63660046104c7565b610189565b60405190151581526020015b60405180910390f35b3480156100dc57600080fd5b506100996100eb36600461050d565b61026f565b3480156100fc57600080fd5b506101056102c3565b6040516001600160a01b0390911681526020016100c7565b61009961012b366004610528565b6102d2565b34801561013c57600080fd5b5061009961014b36600461050d565b61034f565b6000805160206106508339815191525460003681823780813683855af491503d8082833e82801561017f578183f35b8183fd5b50505050565b60006301ffc9a760e01b6001600160e01b0319831614806101ba57506307f5828d60e41b6001600160e01b03198316145b156101c757506001919050565b6001600160e01b031980831614156101e157506000919050565b600080516020610650833981519152546040516301ffc9a760e01b81526001600160e01b0319841660048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa92505050801561025b575060408051601f3d908101601f19168201909252610258918101906105aa565b60015b6102685750600092915050565b9392505050565b610277610390565b6001600160a01b0316336001600160a01b0316146102a75760405162461bcd60e51b8152600401610088906105cc565b6102c081604051806020016040528060008152506103a3565b50565b60006102cd610390565b905090565b6102da610390565b6001600160a01b0316336001600160a01b03161461030a5760405162461bcd60e51b8152600401610088906105cc565b61034a8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103a392505050565b505050565b610357610390565b6001600160a01b0316336001600160a01b0316146103875760405162461bcd60e51b8152600401610088906105cc565b6102c081610466565b6000805160206106308339815191525490565b6000805160206106508339815191528054908390556040516001600160a01b0380851691908316907f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829690600090a381511561034a576000836001600160a01b03168360405161041291906105f4565b600060405180830381855af49150503d806000811461044d576040519150601f19603f3d011682016040523d82523d6000602084013e610452565b606091505b5050905080610183573d806000803e806000fd5b6000610470610390565b90508160008051602061063083398151915255816001600160a01b0316816001600160a01b03167fdf435d422321da6b195902d70fc417c06a32f88379c20dd8f2a8da07088cec2960405160405180910390a35050565b6000602082840312156104d957600080fd5b81356001600160e01b03198116811461026857600080fd5b80356001600160a01b038116811461050857600080fd5b919050565b60006020828403121561051f57600080fd5b610268826104f1565b60008060006040848603121561053d57600080fd5b610546846104f1565b925060208401356001600160401b038082111561056257600080fd5b818601915086601f83011261057657600080fd5b81358181111561058557600080fd5b87602082850101111561059757600080fd5b6020830194508093505050509250925092565b6000602082840312156105bc57600080fd5b8151801515811461026857600080fd5b6020808252600e908201526d1393d517d055551213d49256915160921b604082015260600190565b6000825160005b8181101561061557602081860181015185830152016105fb565b81811115610624576000828501525b50919091019291505056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca26469706673582212201e466a60e25c54a0962d15d802a1679b7fda211dceaeef75fa48f47d1b61f8b764736f6c634300080a0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61038be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0a26469706673582212209daf7908152c2f4eccdc060c84a55c2f5505f7fa743b1bdfcf96498457a1ac0764736f6c634300080a0033

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

0000000000000000000000001f98431c8ad98523631ae4a59f267346ea31f984

-----Decoded View---------------
Arg [0] : _uniswapV3Factory (address): 0x1F98431c8aD98523631AE4a59f267346ea31F984

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000001f98431c8ad98523631ae4a59f267346ea31f984


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Txn Hash Block Value Eth2 PubKey Valid
View All Deposits
[ 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.