ETH Price: $3,032.03 (-1.41%)

Contract

0x750dCAdcA8e9e7f9702c85383119ea8034450993
 

Overview

ETH Balance

0 ETH

ETH Value

$0.00

Sponsored

Transaction Hash
Method
Block
From
To
Value
0x6080604060220292022-04-19 15:42:48728 days ago1650382968IN
 Create: PriceFeed
0 ETH0.000002470.001

Latest 25 internal transactions (View All)

Advanced mode:
Parent Txn Hash Block From To Value
1075583442023-07-30 11:11:05262 days ago1690715465
0x750dCAdc...034450993
0 ETH
1075583442023-07-30 11:11:05262 days ago1690715465
0x750dCAdc...034450993
0 ETH
1075583442023-07-30 11:11:05262 days ago1690715465
0x750dCAdc...034450993
0 ETH
1075573012023-07-30 10:36:19262 days ago1690713379
0x750dCAdc...034450993
0 ETH
1075573012023-07-30 10:36:19262 days ago1690713379
0x750dCAdc...034450993
0 ETH
1075573012023-07-30 10:36:19262 days ago1690713379
0x750dCAdc...034450993
0 ETH
1075573012023-07-30 10:36:19262 days ago1690713379
0x750dCAdc...034450993
0 ETH
1075573012023-07-30 10:36:19262 days ago1690713379
0x750dCAdc...034450993
0 ETH
1075573012023-07-30 10:36:19262 days ago1690713379
0x750dCAdc...034450993
0 ETH
1075573012023-07-30 10:36:19262 days ago1690713379
0x750dCAdc...034450993
0 ETH
1075573012023-07-30 10:36:19262 days ago1690713379
0x750dCAdc...034450993
0 ETH
1075573012023-07-30 10:36:19262 days ago1690713379
0x750dCAdc...034450993
0 ETH
1075573012023-07-30 10:36:19262 days ago1690713379
0x750dCAdc...034450993
0 ETH
1075573012023-07-30 10:36:19262 days ago1690713379
0x750dCAdc...034450993
0 ETH
1075572762023-07-30 10:35:29262 days ago1690713329
0x750dCAdc...034450993
0 ETH
1075572762023-07-30 10:35:29262 days ago1690713329
0x750dCAdc...034450993
0 ETH
1075572762023-07-30 10:35:29262 days ago1690713329
0x750dCAdc...034450993
0 ETH
1075572762023-07-30 10:35:29262 days ago1690713329
0x750dCAdc...034450993
0 ETH
1075572762023-07-30 10:35:29262 days ago1690713329
0x750dCAdc...034450993
0 ETH
1075572762023-07-30 10:35:29262 days ago1690713329
0x750dCAdc...034450993
0 ETH
1075572762023-07-30 10:35:29262 days ago1690713329
0x750dCAdc...034450993
0 ETH
1075572762023-07-30 10:35:29262 days ago1690713329
0x750dCAdc...034450993
0 ETH
1075572762023-07-30 10:35:29262 days ago1690713329
0x750dCAdc...034450993
0 ETH
1075572762023-07-30 10:35:29262 days ago1690713329
0x750dCAdc...034450993
0 ETH
1075572762023-07-30 10:35:29262 days ago1690713329
0x750dCAdc...034450993
0 ETH
View All Internal Transactions

Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
PriceFeed

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 16 : PriceFeed.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

// Inheritance
import "../utils/proxy/solidity-0.8.0/ProxyOwned.sol";
import "../utils/libraries/UniswapMath.sol";

// Libraries
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-4.4.1/utils/math/SafeMath.sol";

// Internal references
// AggregatorInterface from Chainlink represents a decentralized pricing network for a single currency key
import "@chainlink/contracts-0.0.10/src/v0.5/interfaces/AggregatorV2V3Interface.sol";

import "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol";

contract PriceFeed is Initializable, ProxyOwned {
    using SafeMath for uint;

    // Decentralized oracle networks that feed into pricing aggregators
    mapping(bytes32 => AggregatorV2V3Interface) public aggregators;

    mapping(bytes32 => uint8) public currencyKeyDecimals;

    bytes32[] public aggregatorKeys;

    // List of currency keys for convenient iteration
    bytes32[] public currencyKeys;
    mapping(bytes32 => IUniswapV3Pool) public pools;

    int56 public twapInterval;

    struct RateAndUpdatedTime {
        uint216 rate;
        uint40 time;
    }

    address public _ETH;
    address public _wETH;

    mapping(bytes32 => bool) public useLastTickForTWAP;

    function initialize(address _owner) external initializer {
        setOwner(_owner);
        twapInterval = 300;
    }

    /* ========== MUTATIVE FUNCTIONS ========== */
    function addAggregator(bytes32 currencyKey, address aggregatorAddress) external onlyOwner {
        AggregatorV2V3Interface aggregator = AggregatorV2V3Interface(aggregatorAddress);
        require(aggregator.latestRound() >= 0, "Given Aggregator is invalid");
        uint8 decimals = aggregator.decimals();
        require(decimals <= 18, "Aggregator decimals should be lower or equal to 18");
        if (address(aggregators[currencyKey]) == address(0)) {
            currencyKeys.push(currencyKey);
        }
        aggregators[currencyKey] = aggregator;
        currencyKeyDecimals[currencyKey] = decimals;
        emit AggregatorAdded(currencyKey, address(aggregator));
    }

    function addPool(bytes32 currencyKey, address currencyAddress, address poolAddress) external onlyOwner {
        // check if aggregator exists for given currency key
        AggregatorV2V3Interface aggregator = aggregators[currencyKey];
        require(address(aggregator) == address(0), "Aggregator already exists for key");

        IUniswapV3Pool pool = IUniswapV3Pool(poolAddress);
        address token0 = pool.token0();
        address token1 = pool.token1();
        bool token0valid = token0 == _wETH || token0 == _ETH;
        bool token1valid = token1 == _wETH || token1 == _ETH;

        // check if one of tokens is wETH or ETH
        require(token0valid || token1valid, "Pool not valid: ETH is not an asset");
        // check if currency is asset in given
        require(currencyAddress == token0 || currencyAddress == token1, "Pool not valid: currency is not an asset");
        (uint160 sqrtPriceX96, , , , , , ) = pool.slot0();
        require(sqrtPriceX96 > 0, "Pool not valid");
        if (address(pools[currencyKey]) == address(0)) {
            currencyKeys.push(currencyKey);
        }
        pools[currencyKey] = pool;
        currencyKeyDecimals[currencyKey] = 18;
        emit PoolAdded(currencyKey, address(pool));
    }

    function removeAggregator(bytes32 currencyKey) external onlyOwner {
        address aggregator = address(aggregators[currencyKey]);
        require(aggregator != address(0), "No aggregator exists for key");
        delete aggregators[currencyKey];
        delete currencyKeyDecimals[currencyKey];

        bool wasRemoved = removeFromArray(currencyKey, currencyKeys);

        if (wasRemoved) {
            emit AggregatorRemoved(currencyKey, aggregator);
        }
    }

    function removePool(bytes32 currencyKey) external onlyOwner {
        address pool = address(pools[currencyKey]);
        require(pool != address(0), "No pool exists for key");
        delete pools[currencyKey];

        bool wasRemoved = removeFromArray(currencyKey, currencyKeys);
        if (wasRemoved) {
            emit PoolRemoved(currencyKey, pool);
        }
    }

    function getRates() external view returns (uint[] memory rates) {
        uint count = 0;
        rates = new uint[](currencyKeys.length);
        for (uint i = 0; i < currencyKeys.length; i++) {
            bytes32 currencyKey = currencyKeys[i];
            rates[count++] = _getRateAndUpdatedTime(currencyKey).rate;
        }
    }

    function getCurrencies() external view returns (bytes32[] memory) {
        return currencyKeys;
    }

    function rateForCurrency(bytes32 currencyKey) external view returns (uint) {
        return _getRateAndUpdatedTime(currencyKey).rate;
    }

    function rateAndUpdatedTime(bytes32 currencyKey) external view returns (uint rate, uint time) {
        RateAndUpdatedTime memory rateAndTime = _getRateAndUpdatedTime(currencyKey);
        return (rateAndTime.rate, rateAndTime.time);
    }

    function removeFromArray(bytes32 entry, bytes32[] storage array) internal returns (bool) {
        for (uint i = 0; i < array.length; i++) {
            if (array[i] == entry) {
                delete array[i];
                array[i] = array[array.length - 1];
                array.pop();
                return true;
            }
        }
        return false;
    }

    function setTwapInterval(int56 _twapInterval) external onlyOwner {
        twapInterval = _twapInterval;
        emit TwapIntervalChanged(_twapInterval);
    }

    function setLastTickForTWAP(bytes32 _currencyKey) external onlyOwner {
        useLastTickForTWAP[_currencyKey] = !useLastTickForTWAP[_currencyKey];
        emit LastTickForTWAPChanged(_currencyKey);
    }

    function setWETH(address token) external onlyOwner {
        _wETH = token;
        emit AddressChangedwETH(token);
    }

    function setETH(address token) external onlyOwner {
        _ETH = token;
        emit AddressChangedETH(token);
    }

    function _formatAnswer(bytes32 currencyKey, int256 rate) internal view returns (uint) {
        require(rate >= 0, "Negative rate not supported");
        if (currencyKeyDecimals[currencyKey] > 0) {
            uint multiplier = 10**uint(SafeMath.sub(18, currencyKeyDecimals[currencyKey]));
            return uint(uint(rate).mul(multiplier));
        }
        return uint(rate);
    }

    function _getRateAndUpdatedTime(bytes32 currencyKey) internal view returns (RateAndUpdatedTime memory) {
        AggregatorV2V3Interface aggregator = aggregators[currencyKey];
        IUniswapV3Pool pool = pools[currencyKey];
        require(address(aggregator) != address(0) || address(pool) != address(0), "No aggregator or pool exists for key");

        if (aggregator != AggregatorV2V3Interface(address(0))) {
            return _getAggregatorRate(address(aggregator), currencyKey);
        } else {
            require(address(aggregators["ETH"]) != address(0), "Price for ETH does not exist");
            uint256 ratio = _getPriceFromSqrtPrice(_getTwap(address(pool), currencyKey));
            uint256 ethPrice = _getAggregatorRate(address(aggregators["ETH"]), "ETH").rate * 10**18; 
            address token0 = pool.token0();
            uint answer;

            if(token0 == _ETH || token0 == _wETH) {
                answer = ethPrice / ratio;
            } else {
                answer = ethPrice * ratio;
            }
            return
                RateAndUpdatedTime({
                    rate: uint216(_formatAnswer(currencyKey, int256(answer))),
                    time: uint40(block.timestamp)
                });
        }
    }

    function _getAggregatorRate(address aggregator, bytes32 currencyKey) internal view returns (RateAndUpdatedTime memory ) {
        // this view from the aggregator is the most gas efficient but it can throw when there's no data,
        // so let's call it low-level to suppress any reverts
        bytes memory payload = abi.encodeWithSignature("latestRoundData()");
        // solhint-disable avoid-low-level-calls
        (bool success, bytes memory returnData) = aggregator.staticcall(payload);

        if (success) {
            (, int256 answer, , uint256 updatedAt, ) = abi.decode(
                returnData,
                (uint80, int256, uint256, uint256, uint80)
            );
            return RateAndUpdatedTime({rate: uint216(_formatAnswer(currencyKey, answer)), time: uint40(updatedAt)});
        }
    }

    function _getTwap(address pool, bytes32 currencyKey) internal view returns (uint160 sqrtPriceX96) {
        if (twapInterval == 0 || useLastTickForTWAP[currencyKey]) {
            // return the current price
            (sqrtPriceX96, , , , , , ) = IUniswapV3Pool(pool).slot0();
        } else {
            uint32[] memory secondsAgos = new uint32[](2);
            secondsAgos[0] = uint32(uint56(twapInterval));
            secondsAgos[1] = 0; // to (now)

            (int56[] memory tickCumulatives, ) = IUniswapV3Pool(pool).observe(secondsAgos);
            // tick(imprecise as it's an integer) to price
            sqrtPriceX96 = UniswapMath.getSqrtRatioAtTick(int24((tickCumulatives[1] - tickCumulatives[0]) / twapInterval));
        }
    }

    function _getPriceFromSqrtPrice(uint160 sqrtPriceX96) internal pure returns (uint256 priceX96) {
        uint256 price = UniswapMath.mulDiv(sqrtPriceX96, sqrtPriceX96, UniswapMath.Q96);
        return UniswapMath.mulDiv(price, 10**18, UniswapMath.Q96);
    }

    function transferCurrencyKeys() external onlyOwner {
        require(currencyKeys.length == 0, "Currency keys is not empty");
        for (uint i = 0; i < aggregatorKeys.length; i++) {
            currencyKeys[i] = aggregatorKeys[i];
        }
    }

    /* ========== EVENTS ========== */
    event AggregatorAdded(bytes32 currencyKey, address aggregator);
    event AggregatorRemoved(bytes32 currencyKey, address aggregator);
    event PoolAdded(bytes32 currencyKey, address pool);
    event PoolRemoved(bytes32 currencyKey, address pool);
    event AddressChangedETH(address token);
    event AddressChangedwETH(address token);
    event LastTickForTWAPChanged(bytes32 currencyKey);
    event TwapIntervalChanged(int56 twapInterval);
}

File 2 of 16 : ProxyOwned.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

// Clone of syntetix contract without constructor
contract ProxyOwned {
    address public owner;
    address public nominatedOwner;
    bool private _initialized;
    bool private _transferredAtInit;

    function setOwner(address _owner) public {
        require(_owner != address(0), "Owner address cannot be 0");
        require(!_initialized, "Already initialized, use nominateNewOwner");
        _initialized = true;
        owner = _owner;
        emit OwnerChanged(address(0), _owner);
    }

    function nominateNewOwner(address _owner) external onlyOwner {
        nominatedOwner = _owner;
        emit OwnerNominated(_owner);
    }

    function acceptOwnership() external {
        require(msg.sender == nominatedOwner, "You must be nominated before you can accept ownership");
        emit OwnerChanged(owner, nominatedOwner);
        owner = nominatedOwner;
        nominatedOwner = address(0);
    }

    function transferOwnershipAtInit(address proxyAddress) external onlyOwner {
        require(proxyAddress != address(0), "Invalid address");
        require(!_transferredAtInit, "Already transferred");
        owner = proxyAddress;
        _transferredAtInit = true;
        emit OwnerChanged(owner, proxyAddress);
    }

    modifier onlyOwner {
        _onlyOwner();
        _;
    }

    function _onlyOwner() private view {
        require(msg.sender == owner, "Only the contract owner may perform this action");
    }

    event OwnerNominated(address newOwner);
    event OwnerChanged(address oldOwner, address newOwner);
}

File 3 of 16 : UniswapMath.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/// @title Math library for computing sqrt prices from ticks and vice versa; Contains 512-bit math functions
/// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision;
/// Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports
/// prices between 2**-128 and 2**128
/// @dev Handles "phantom overflow" i.e., allows multiplication and division where an intermediate value overflows 256 bits

library UniswapMath {
    uint256 internal constant Q192 = 0x1000000000000000000000000000000000000000000000000;
    uint256 internal constant Q96 = 0x1000000000000000000000000;

    /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128
    int24 internal constant MIN_TICK = -887272;
    /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128
    int24 internal constant MAX_TICK = -MIN_TICK;

    /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK)
    uint160 internal constant MIN_SQRT_RATIO = 4295128739;
    /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK)
    uint160 internal constant MAX_SQRT_RATIO = 1461446703485210103287273052203988822378723970342;

    /// @notice Calculates floor(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
    /// @param a The multiplicand
    /// @param b The multiplier
    /// @param denominator The divisor
    /// @return result The 256-bit result
    /// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv
    function mulDiv(
        uint256 a,
        uint256 b,
        uint256 denominator
    ) internal pure returns (uint256 result) {
        // 512-bit multiply [prod1 prod0] = a * b
        // Compute the product mod 2**256 and mod 2**256 - 1
        // then use the Chinese Remainder Theorem to reconstruct
        // the 512 bit result. The result is stored in two 256
        // variables such that product = prod1 * 2**256 + prod0
        uint256 prod0; // Least significant 256 bits of the product
        uint256 prod1; // Most significant 256 bits of the product
        assembly {
            let mm := mulmod(a, b, not(0))
            prod0 := mul(a, b)
            prod1 := sub(sub(mm, prod0), lt(mm, prod0))
        }

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

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

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

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

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

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

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

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

    /// @notice Calculates sqrt(1.0001^tick) * 2^96
    /// @dev Throws if |tick| > max tick
    /// @param tick The input tick for the above formula
    /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0)
    /// at the given tick
    function getSqrtRatioAtTick(int24 tick) internal pure returns (uint160 sqrtPriceX96) {
        uint256 absTick = tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick));
        require(absTick <= uint256(int256(MAX_TICK)), 'T');

        uint256 ratio = absTick & 0x1 != 0 ? 0xfffcb933bd6fad37aa2d162d1a594001 : 0x100000000000000000000000000000000;
        if (absTick & 0x2 != 0) ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128;
        if (absTick & 0x4 != 0) ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128;
        if (absTick & 0x8 != 0) ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128;
        if (absTick & 0x10 != 0) ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128;
        if (absTick & 0x20 != 0) ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128;
        if (absTick & 0x40 != 0) ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128;
        if (absTick & 0x80 != 0) ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128;
        if (absTick & 0x100 != 0) ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128;
        if (absTick & 0x200 != 0) ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128;
        if (absTick & 0x400 != 0) ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128;
        if (absTick & 0x800 != 0) ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128;
        if (absTick & 0x1000 != 0) ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128;
        if (absTick & 0x2000 != 0) ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128;
        if (absTick & 0x4000 != 0) ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128;
        if (absTick & 0x8000 != 0) ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128;
        if (absTick & 0x10000 != 0) ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128;
        if (absTick & 0x20000 != 0) ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128;
        if (absTick & 0x40000 != 0) ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128;
        if (absTick & 0x80000 != 0) ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128;

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

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

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

        uint256 r = ratio;
        uint256 msb = 0;

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

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

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

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

        int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number

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

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

File 4 of 16 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (proxy/utils/Initializable.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {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 initialize the implementation contract, you can either invoke the
 * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() initializer {}
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     */
    bool private _initialized;

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

    /**
     * @dev Modifier to protect an initializer function from being invoked twice.
     */
    modifier initializer() {
        // If the contract is initializing we ignore whether _initialized is set in order to support multiple
        // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the
        // contract may have been reentered.
        require(_initializing ? _isConstructor() : !_initialized, "Initializable: contract is already initialized");

        bool isTopLevelCall = !_initializing;
        if (isTopLevelCall) {
            _initializing = true;
            _initialized = true;
        }

        _;

        if (isTopLevelCall) {
            _initializing = false;
        }
    }

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

    function _isConstructor() private view returns (bool) {
        return !AddressUpgradeable.isContract(address(this));
    }
}

File 5 of 16 : SafeMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/math/SafeMath.sol)

pragma solidity ^0.8.0;

// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.

/**
 * @dev Wrappers over Solidity's arithmetic operations.
 *
 * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
 * now has built in overflow checking.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
            // benefit is lost if 'b' is also tested.
            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
            if (a == 0) return (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a % b);
        }
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        return a + b;
    }

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

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        return a * b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator.
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return a / b;
    }

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

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b <= a, errorMessage);
            return a - b;
        }
    }

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

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a % b;
        }
    }
}

File 6 of 16 : AggregatorV2V3Interface.sol
pragma solidity >=0.5.0;

import "./AggregatorInterface.sol";
import "./AggregatorV3Interface.sol";

/**
 * @title The V2 & V3 Aggregator Interface
 * @notice Solidity V0.5 does not allow interfaces to inherit from other
 * interfaces so this contract is a combination of v0.5 AggregatorInterface.sol
 * and v0.5 AggregatorV3Interface.sol.
 */
interface AggregatorV2V3Interface {
  //
  // V2 Interface:
  //
  function latestAnswer() external view returns (int256);
  function latestTimestamp() external view returns (uint256);
  function latestRound() external view returns (uint256);
  function getAnswer(uint256 roundId) external view returns (int256);
  function getTimestamp(uint256 roundId) external view returns (uint256);

  event AnswerUpdated(int256 indexed current, uint256 indexed roundId, uint256 timestamp);
  event NewRound(uint256 indexed roundId, address indexed startedBy, uint256 startedAt);

  //
  // V3 Interface:
  //
  function decimals() external view returns (uint8);
  function description() external view returns (string memory);
  function version() external view returns (uint256);

  // getRoundData and latestRoundData should both raise "No data present"
  // if they do not have data to report, instead of returning unset values
  // which could be misinterpreted as actual reported values.
  function getRoundData(uint80 _roundId)
    external
    view
    returns (
      uint80 roundId,
      int256 answer,
      uint256 startedAt,
      uint256 updatedAt,
      uint80 answeredInRound
    );
  function latestRoundData()
    external
    view
    returns (
      uint80 roundId,
      int256 answer,
      uint256 startedAt,
      uint256 updatedAt,
      uint80 answeredInRound
    );

}

File 7 of 16 : 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 8 of 16 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)

pragma solidity ^0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library AddressUpgradeable {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (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

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 9 of 16 : AggregatorInterface.sol
pragma solidity >=0.5.0;

interface AggregatorInterface {
  function latestAnswer() external view returns (int256);
  function latestTimestamp() external view returns (uint256);
  function latestRound() external view returns (uint256);
  function getAnswer(uint256 roundId) external view returns (int256);
  function getTimestamp(uint256 roundId) external view returns (uint256);

  event AnswerUpdated(int256 indexed current, uint256 indexed roundId, uint256 timestamp);
  event NewRound(uint256 indexed roundId, address indexed startedBy, uint256 startedAt);
}

File 10 of 16 : AggregatorV3Interface.sol
pragma solidity >=0.5.0;

interface AggregatorV3Interface {

  function decimals() external view returns (uint8);
  function description() external view returns (string memory);
  function version() external view returns (uint256);

  // getRoundData and latestRoundData should both raise "No data present"
  // if they do not have data to report, instead of returning unset values
  // which could be misinterpreted as actual reported values.
  function getRoundData(uint80 _roundId)
    external
    view
    returns (
      uint80 roundId,
      int256 answer,
      uint256 startedAt,
      uint256 updatedAt,
      uint80 answeredInRound
    );
  function latestRoundData()
    external
    view
    returns (
      uint80 roundId,
      int256 answer,
      uint256 startedAt,
      uint256 updatedAt,
      uint80 answeredInRound
    );

}

File 11 of 16 : 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 12 of 16 : 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 13 of 16 : 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 14 of 16 : 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 15 of 16 : 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 16 of 16 : 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);
}

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

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"}],"name":"AddressChangedETH","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"}],"name":"AddressChangedwETH","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"currencyKey","type":"bytes32"},{"indexed":false,"internalType":"address","name":"aggregator","type":"address"}],"name":"AggregatorAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"currencyKey","type":"bytes32"},{"indexed":false,"internalType":"address","name":"aggregator","type":"address"}],"name":"AggregatorRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"currencyKey","type":"bytes32"}],"name":"LastTickForTWAPChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldOwner","type":"address"},{"indexed":false,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerNominated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"currencyKey","type":"bytes32"},{"indexed":false,"internalType":"address","name":"pool","type":"address"}],"name":"PoolAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"currencyKey","type":"bytes32"},{"indexed":false,"internalType":"address","name":"pool","type":"address"}],"name":"PoolRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"int56","name":"twapInterval","type":"int56"}],"name":"TwapIntervalChanged","type":"event"},{"inputs":[],"name":"_ETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_wETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"currencyKey","type":"bytes32"},{"internalType":"address","name":"aggregatorAddress","type":"address"}],"name":"addAggregator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"currencyKey","type":"bytes32"},{"internalType":"address","name":"currencyAddress","type":"address"},{"internalType":"address","name":"poolAddress","type":"address"}],"name":"addPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"aggregatorKeys","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"aggregators","outputs":[{"internalType":"contract AggregatorV2V3Interface","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"currencyKeyDecimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"currencyKeys","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrencies","outputs":[{"internalType":"bytes32[]","name":"","type":"bytes32[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRates","outputs":[{"internalType":"uint256[]","name":"rates","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"nominateNewOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"nominatedOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"pools","outputs":[{"internalType":"contract IUniswapV3Pool","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"currencyKey","type":"bytes32"}],"name":"rateAndUpdatedTime","outputs":[{"internalType":"uint256","name":"rate","type":"uint256"},{"internalType":"uint256","name":"time","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"currencyKey","type":"bytes32"}],"name":"rateForCurrency","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"currencyKey","type":"bytes32"}],"name":"removeAggregator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"currencyKey","type":"bytes32"}],"name":"removePool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"setETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_currencyKey","type":"bytes32"}],"name":"setLastTickForTWAP","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"setOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"int56","name":"_twapInterval","type":"int56"}],"name":"setTwapInterval","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"setWETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"transferCurrencyKeys","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"proxyAddress","type":"address"}],"name":"transferOwnershipAtInit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"twapInterval","outputs":[{"internalType":"int56","name":"","type":"int56"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"useLastTickForTWAP","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b50612bdd806100206000396000f3fe608060405234801561001057600080fd5b50600436106101cf5760003560e01c806379ba509711610104578063b295ad34116100a2578063c3b83f5f11610071578063c3b83f5f1461043a578063c4d66de81461044d578063e4d8f8a614610460578063e69bd3fa1461047357600080fd5b8063b295ad34146103b6578063b40ee76d146103eb578063b5217bb4146103fe578063c0c7df6f1461042757600080fd5b806399a440f6116100de57806399a440f6146103755780639accab5514610388578063a0f3087f14610390578063ac82f608146103a357600080fd5b806379ba5097146103415780637a5a2a98146103495780638da5cb5b1461035c57600080fd5b806346461240116101715780635b769f3c1161014b5780635b769f3c146102d65780635db99af2146102e957806361c661de146103035780637103353e1461031857600080fd5b806346461240146102825780634f72def61461028a57806353a47bb7146102ab57600080fd5b80633b824b8c116101ad5780633b824b8c1461020f5780633c1d5df0146102225780633f0e084f146102475780634308a94f1461025a57600080fd5b806313af4035146101d45780631627540c146101e95780632bed9e0c146101fc575b600080fd5b6101e76101e2366004612503565b6104a6565b005b6101e76101f7366004612503565b6105e6565b6101e761020a366004612601565b61063c565b6101e761021d366004612648565b610732565b60075461022f9060060b81565b60405160069190910b81526020015b60405180910390f35b6101e7610255366004612619565b610b8f565b61026d610268366004612601565b610e12565b6040805192835260208301919091520161023e565b6101e7610e45565b61029d610298366004612601565b610f18565b60405190815260200161023e565b6001546102be906001600160a01b031681565b6040516001600160a01b03909116815260200161023e565b6101e76102e4366004612503565b610f39565b6007546102be90600160381b90046001600160a01b031681565b61030b610f8f565b60405161023e91906127f7565b6102be610326366004612601565b6002602052600090815260409020546001600160a01b031681565b6101e7610fe7565b6101e7610357366004612503565b6110e4565b6000546102be906201000090046001600160a01b031681565b61029d610383366004612601565b61114a565b61030b61115a565b6101e761039e366004612601565b611253565b61029d6103b1366004612601565b6112ab565b6103d96103c4366004612601565b60036020526000908152604090205460ff1681565b60405160ff909116815260200161023e565b6101e76103f9366004612689565b6112c6565b6102be61040c366004612601565b6006602052600090815260409020546001600160a01b031681565b6008546102be906001600160a01b031681565b6101e7610448366004612503565b611323565b6101e761045b366004612503565b61143c565b6101e761046e366004612601565b611513565b610496610481366004612601565b60096020526000908152604090205460ff1681565b604051901515815260200161023e565b6001600160a01b0381166105015760405162461bcd60e51b815260206004820152601960248201527f4f776e657220616464726573732063616e6e6f7420626520300000000000000060448201526064015b60405180910390fd5b600154600160a01b900460ff161561056d5760405162461bcd60e51b815260206004820152602960248201527f416c726561647920696e697469616c697a65642c20757365206e6f6d696e617460448201526832a732bba7bbb732b960b91b60648201526084016104f8565b6001805460ff60a01b1916600160a01b179055600080546001600160a01b03831662010000810262010000600160b01b03199092169190911782556040805192835260208301919091527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c91015b60405180910390a150565b6105ee6115e6565b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce22906020016105db565b6106446115e6565b6000818152600260205260409020546001600160a01b0316806106a95760405162461bcd60e51b815260206004820152601c60248201527f4e6f2061676772656761746f722065786973747320666f72206b65790000000060448201526064016104f8565b600082815260026020908152604080832080546001600160a01b031916905560039091528120805460ff191690556106e2836005611660565b9050801561072d57604080518481526001600160a01b03841660208201527fec70e890fc7db7de4059b114c9093a1f41283d18ffcfbcac45566feea4d4f77791015b60405180910390a15b505050565b61073a6115e6565b6000838152600260205260409020546001600160a01b031680156107aa5760405162461bcd60e51b815260206004820152602160248201527f41676772656761746f7220616c72656164792065786973747320666f72206b656044820152607960f81b60648201526084016104f8565b60008290506000816001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b1580156107ea57600080fd5b505afa1580156107fe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610822919061251f565b90506000826001600160a01b031663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b15801561085f57600080fd5b505afa158015610873573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610897919061251f565b6008549091506000906001600160a01b03848116911614806108cd57506007546001600160a01b03848116600160381b90920416145b6008549091506000906001600160a01b038481169116148061090357506007546001600160a01b03848116600160381b90920416145b9050818061090e5750805b6109665760405162461bcd60e51b815260206004820152602360248201527f506f6f6c206e6f742076616c69643a20455448206973206e6f7420616e2061736044820152621cd95d60ea1b60648201526084016104f8565b836001600160a01b0316886001600160a01b031614806109975750826001600160a01b0316886001600160a01b0316145b6109f45760405162461bcd60e51b815260206004820152602860248201527f506f6f6c206e6f742076616c69643a2063757272656e6379206973206e6f7420604482015267185b88185cdcd95d60c21b60648201526084016104f8565b6000856001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b158015610a2f57600080fd5b505afa158015610a43573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6791906126a5565b50505050505090506000816001600160a01b031611610ab95760405162461bcd60e51b815260206004820152600e60248201526d141bdbdb081b9bdd081d985b1a5960921b60448201526064016104f8565b60008a8152600660205260409020546001600160a01b0316610b0b57600580546001810182556000919091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0018a90555b60008a815260066020908152604080832080546001600160a01b038b166001600160a01b031990911681179091556003835292819020805460ff1916601217905580518d8152918201929092527ffd0fa7919fbe3857a4236750e8d3e42ac691881d2f31c50ebe4cfc2a7705ee80910160405180910390a150505050505050505050565b610b976115e6565b60008190506000816001600160a01b031663668a0f026040518163ffffffff1660e01b815260040160206040518083038186803b158015610bd757600080fd5b505afa158015610beb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c0f919061273d565b1015610c5d5760405162461bcd60e51b815260206004820152601b60248201527f476976656e2041676772656761746f7220697320696e76616c6964000000000060448201526064016104f8565b6000816001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015610c9857600080fd5b505afa158015610cac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cd091906127a4565b905060128160ff161115610d415760405162461bcd60e51b815260206004820152603260248201527f41676772656761746f7220646563696d616c732073686f756c64206265206c6f6044820152710eecae440dee440cae2eac2d840e8de4062760731b60648201526084016104f8565b6000848152600260205260409020546001600160a01b0316610d9357600580546001810182556000919091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0018490555b600084815260026020908152604080832080546001600160a01b0319166001600160a01b0387169081179091556003835292819020805460ff191660ff86161790558051878152918201929092527f0bcae573430f69c5361e5d76534d3f61d2d803958778680cd74be9dc6299bc63910160405180910390a150505050565b6000806000610e208461178d565b80516020909101516001600160d81b039091169564ffffffffff909116945092505050565b610e4d6115e6565b60055415610e9d5760405162461bcd60e51b815260206004820152601a60248201527f43757272656e6379206b657973206973206e6f7420656d70747900000000000060448201526064016104f8565b60005b600454811015610f155760048181548110610ecb57634e487b7160e01b600052603260045260246000fd5b906000526020600020015460058281548110610ef757634e487b7160e01b600052603260045260246000fd5b60009182526020909120015580610f0d81612ad7565b915050610ea0565b50565b60048181548110610f2857600080fd5b600091825260209091200154905081565b610f416115e6565b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f8121e397d1abdd9a4231e6d2a3da170b653b62342667c1ed8697d07f560836eb906020016105db565b60606005805480602002602001604051908101604052809291908181526020018280548015610fdd57602002820191906000526020600020905b815481526020019060010190808311610fc9575b5050505050905090565b6001546001600160a01b0316331461105f5760405162461bcd60e51b815260206004820152603560248201527f596f75206d757374206265206e6f6d696e61746564206265666f726520796f7560448201527402063616e20616363657074206f776e65727368697605c1b60648201526084016104f8565b60005460015460408051620100009093046001600160a01b03908116845290911660208301527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c910160405180910390a1600180546000805462010000600160b01b0319166001600160a01b03831662010000021790556001600160a01b0319169055565b6110ec6115e6565b60078054670100000000000000600160d81b031916600160381b6001600160a01b038416908102919091179091556040519081527f9869fd5d75bcb7e8ecd63be9bdc2491f03bf7773f4f978ae21d550598f89a5ca906020016105db565b60058181548110610f2857600080fd5b60055460609060009067ffffffffffffffff81111561118957634e487b7160e01b600052604160045260246000fd5b6040519080825280602002602001820160405280156111b2578160200160208202803683370190505b50915060005b60055481101561124e576000600582815481106111e557634e487b7160e01b600052603260045260246000fd5b906000526020600020015490506111fb8161178d565b516001600160d81b0316848461121081612ad7565b95508151811061123057634e487b7160e01b600052603260045260246000fd5b6020908102919091010152508061124681612ad7565b9150506111b8565b505090565b61125b6115e6565b60008181526009602052604090819020805460ff19811660ff90911615179055517fb3708876f7f03a1f6c8e5c502b558d87faab81782c2e8562ed2cd5b87f63f99b906105db9083815260200190565b60006112b68261178d565b516001600160d81b031692915050565b6112ce6115e6565b6007805466ffffffffffffff191666ffffffffffffff600684900b908116919091179091556040519081527f2350458cc43fccffd5931a35a5cceaa703560f40edc555814faf87d392147505906020016105db565b61132b6115e6565b6001600160a01b0381166113735760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b60448201526064016104f8565b600154600160a81b900460ff16156113c35760405162461bcd60e51b8152602060048201526013602482015272105b1c9958591e481d1c985b9cd9995c9c9959606a1b60448201526064016104f8565b600080546001600160a01b038381166201000081810262010000600160b01b031990941693909317938490556001805460ff60a81b1916600160a81b1790556040805193909404909116825260208201527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c91016105db565b600054610100900460ff166114575760005460ff161561145b565b303b155b6114be5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016104f8565b600054610100900460ff161580156114e0576000805461ffff19166101011790555b6114e9826104a6565b6007805466ffffffffffffff191661012c179055801561150f576000805461ff00191690555b5050565b61151b6115e6565b6000818152600660205260409020546001600160a01b0316806115795760405162461bcd60e51b81526020600482015260166024820152754e6f20706f6f6c2065786973747320666f72206b657960501b60448201526064016104f8565b600082815260066020526040812080546001600160a01b03191690556115a0836005611660565b9050801561072d57604080518481526001600160a01b03841660208201527fec6c5a212891ee59cd0846cf5c9bb92c3cb05e7dc0191e73abec1ac38822b9739101610724565b6000546201000090046001600160a01b0316331461165e5760405162461bcd60e51b815260206004820152602f60248201527f4f6e6c792074686520636f6e7472616374206f776e6572206d6179207065726660448201526e37b936903a3434b99030b1ba34b7b760891b60648201526084016104f8565b565b6000805b8254811015611781578383828154811061168e57634e487b7160e01b600052603260045260246000fd5b9060005260206000200154141561176f578281815481106116bf57634e487b7160e01b600052603260045260246000fd5b6000918252602082200155825483906116da90600190612ac0565b815481106116f857634e487b7160e01b600052603260045260246000fd5b906000526020600020015483828154811061172357634e487b7160e01b600052603260045260246000fd5b90600052602060002001819055508280548061174f57634e487b7160e01b600052603160045260246000fd5b600190038181906000526020600020016000905590556001915050611787565b8061177981612ad7565b915050611664565b50600090505b92915050565b60408051808201909152600080825260208201526000828152600260209081526040808320546006909252909120546001600160a01b039182169116811515806117df57506001600160a01b03811615155b6118375760405162461bcd60e51b8152602060048201526024808201527f4e6f2061676772656761746f72206f7220706f6f6c2065786973747320666f72604482015263206b657960e01b60648201526084016104f8565b6001600160a01b03821615611858576118508285611a62565b949350505050565b6208aa8960eb1b60005260026020527fd9402e47e68a5154d8f9cdc9d4ffcf4a300546026372c3b04224fbe62656c601546001600160a01b03166118de5760405162461bcd60e51b815260206004820152601c60248201527f507269636520666f722045544820646f6573206e6f742065786973740000000060448201526064016104f8565b60006118f26118ed8387611b67565b611dbb565b6208aa8960eb1b600081815260026020527fd9402e47e68a5154d8f9cdc9d4ffcf4a300546026372c3b04224fbe62656c601549293509161193e916001600160a01b0390911690611a62565b5161195190670de0b6b3a7640000612a23565b6001600160d81b031690506000836001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b15801561199757600080fd5b505afa1580156119ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119cf919061251f565b6007549091506000906001600160a01b03808416600160381b909204161480611a0557506008546001600160a01b038381169116145b15611a1b57611a148484612924565b9050611a28565b611a258484612a52565b90505b6040518060400160405280611a3d8a84611df6565b6001600160d81b0316815264ffffffffff421660209091015298975050505050505050565b604080518082019091526000808252602082015260408051600481526024810182526020810180516001600160e01b0316633fabe5a360e21b179052905160009081906001600160a01b03871690611abb9085906127be565b600060405180830381855afa9150503d8060008114611af6576040519150601f19603f3d011682016040523d82523d6000602084013e611afb565b606091505b50915091508115611b5e5760008082806020019051810190611b1d9190612755565b509350509250506040518060400160405280611b398985611df6565b6001600160d81b031681526020018264ffffffffff1681525095505050505050611787565b50505092915050565b600754600090600690810b900b1580611b8e575060008281526009602052604090205460ff165b15611c1357826001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b158015611bcc57600080fd5b505afa158015611be0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c0491906126a5565b50949550611787945050505050565b6040805160028082526060820183526000926020830190803683375050600754825192935060060b91839150600090611c5c57634e487b7160e01b600052603260045260246000fd5b602002602001019063ffffffff16908163ffffffff1681525050600081600181518110611c9957634e487b7160e01b600052603260045260246000fd5b63ffffffff9092166020928302919091019091015260405163883bdbfd60e01b81526000906001600160a01b0386169063883bdbfd90611cdd90859060040161283b565b60006040518083038186803b158015611cf557600080fd5b505afa158015611d09573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611d31919081019061253b565b509050611db2600760009054906101000a900460060b82600081518110611d6857634e487b7160e01b600052603260045260246000fd5b602002602001015183600181518110611d9157634e487b7160e01b600052603260045260246000fd5b6020026020010151611da39190612a71565b611dad91906128e6565b611ea2565b95945050505050565b600080611dd66001600160a01b03841680600160601b6122b7565b9050611def81670de0b6b3a7640000600160601b6122b7565b9392505050565b600080821215611e485760405162461bcd60e51b815260206004820152601b60248201527f4e656761746976652072617465206e6f7420737570706f72746564000000000060448201526064016104f8565b60008381526003602052604090205460ff1615611e9c57600083815260036020526040812054611e7d9060129060ff16612431565b611e8890600a61297b565b9050611e94838261243d565b915050611787565b50919050565b60008060008360020b12611eb9578260020b611ec6565b8260020b611ec690612b27565b9050611ed5620d89e719612b06565b60020b811115611f0b5760405162461bcd60e51b81526020600482015260016024820152601560fa1b60448201526064016104f8565b600060018216611f1f57600160801b611f31565b6ffffcb933bd6fad37aa2d162d1a5940015b70ffffffffffffffffffffffffffffffffff1690506002821615611f70576080611f6b826ffff97272373d413259a46990580e213a612a52565b901c90505b6004821615611f9a576080611f95826ffff2e50f5f656932ef12357cf3c7fdcc612a52565b901c90505b6008821615611fc4576080611fbf826fffe5caca7e10e4e61c3624eaa0941cd0612a52565b901c90505b6010821615611fee576080611fe9826fffcb9843d60f6159c9db58835c926644612a52565b901c90505b6020821615612018576080612013826fff973b41fa98c081472e6896dfb254c0612a52565b901c90505b604082161561204257608061203d826fff2ea16466c96a3843ec78b326b52861612a52565b901c90505b608082161561206c576080612067826ffe5dee046a99a2a811c461f1969c3053612a52565b901c90505b610100821615612097576080612092826ffcbe86c7900a88aedcffc83b479aa3a4612a52565b901c90505b6102008216156120c25760806120bd826ff987a7253ac413176f2b074cf7815e54612a52565b901c90505b6104008216156120ed5760806120e8826ff3392b0822b70005940c7a398e4b70f3612a52565b901c90505b610800821615612118576080612113826fe7159475a2c29b7443b29c7fa6e889d9612a52565b901c90505b61100082161561214357608061213e826fd097f3bdfd2022b8845ad8f792aa5825612a52565b901c90505b61200082161561216e576080612169826fa9f746462d870fdf8a65dc1f90e061e5612a52565b901c90505b614000821615612199576080612194826f70d869a156d2a1b890bb3df62baf32f7612a52565b901c90505b6180008216156121c45760806121bf826f31be135f97d08fd981231505542fcfa6612a52565b901c90505b620100008216156121f05760806121eb826f09aa508b5b7a84e1c677de54f3e99bc9612a52565b901c90505b6202000082161561221b576080612216826e5d6af8dedb81196699c329225ee604612a52565b901c90505b62040000821615612245576080612240826d2216e584f5fa1ea926041bedfe98612a52565b901c90505b6208000082161561226d576080612268826b048a170391f7dc42444e8fa2612a52565b901c90505b60008460020b13156122885761228581600019612924565b90505b61229764010000000082612af2565b156122a35760016122a6565b60005b6118509060ff16602083901c6128ce565b6000808060001985870985870292508281108382030391505080600014156122f157600084116122e657600080fd5b508290049050611def565b8084116122fd57600080fd5b600084868809808403938111909203919050600061231d861960016128ce565b861695869004959384900493600081900304600101905061233e8184612a52565b90931792600061234f876003612a52565b600218905061235e8188612a52565b612369906002612ac0565b6123739082612a52565b905061237f8188612a52565b61238a906002612ac0565b6123949082612a52565b90506123a08188612a52565b6123ab906002612ac0565b6123b59082612a52565b90506123c18188612a52565b6123cc906002612ac0565b6123d69082612a52565b90506123e28188612a52565b6123ed906002612ac0565b6123f79082612a52565b90506124038188612a52565b61240e906002612ac0565b6124189082612a52565b90506124248186612a52565b9998505050505050505050565b6000611def8284612ac0565b6000611def8284612a52565b600082601f830112612459578081fd5b8151602061246e612469836128aa565b612879565b80838252828201915082860187848660051b890101111561248d578586fd5b855b858110156124b45781516124a281612b83565b8452928401929084019060010161248f565b5090979650505050505050565b805161ffff811681146124d357600080fd5b919050565b805169ffffffffffffffffffff811681146124d357600080fd5b805160ff811681146124d357600080fd5b600060208284031215612514578081fd5b8135611def81612b83565b600060208284031215612530578081fd5b8151611def81612b83565b6000806040838503121561254d578081fd5b825167ffffffffffffffff80821115612564578283fd5b818501915085601f830112612577578283fd5b81516020612587612469836128aa565b8083825282820191508286018a848660051b89010111156125a6578788fd5b8796505b848710156125d15780516125bd81612b98565b8352600196909601959183019183016125aa565b50918801519196509093505050808211156125ea578283fd5b506125f785828601612449565b9150509250929050565b600060208284031215612612578081fd5b5035919050565b6000806040838503121561262b578182fd5b82359150602083013561263d81612b83565b809150509250929050565b60008060006060848603121561265c578081fd5b83359250602084013561266e81612b83565b9150604084013561267e81612b83565b809150509250925092565b60006020828403121561269a578081fd5b8135611def81612b98565b600080600080600080600060e0888a0312156126bf578283fd5b87516126ca81612b83565b8097505060208801518060020b81146126e1578384fd5b95506126ef604089016124c1565b94506126fd606089016124c1565b935061270b608089016124c1565b925061271960a089016124f2565b915060c0880151801515811461272d578182fd5b8091505092959891949750929550565b60006020828403121561274e578081fd5b5051919050565b600080600080600060a0868803121561276c578283fd5b612775866124d8565b9450602086015193506040860151925060608601519150612798608087016124d8565b90509295509295909350565b6000602082840312156127b5578081fd5b611def826124f2565b60008251815b818110156127de57602081860181015185830152016127c4565b818111156127ec5782828501525b509190910192915050565b6020808252825182820181905260009190848201906040850190845b8181101561282f57835183529284019291840191600101612813565b50909695505050505050565b6020808252825182820181905260009190848201906040850190845b8181101561282f57835163ffffffff1683529284019291840191600101612857565b604051601f8201601f1916810167ffffffffffffffff811182821017156128a2576128a2612b6d565b604052919050565b600067ffffffffffffffff8211156128c4576128c4612b6d565b5060051b60200190565b600082198211156128e1576128e1612b41565b500190565b60008160060b8360060b806128fd576128fd612b57565b667fffffffffffff1982146000198214161561291b5761291b612b41565b90059392505050565b60008261293357612933612b57565b500490565b600181815b8085111561297357816000190482111561295957612959612b41565b8085161561296657918102915b93841c939080029061293d565b509250929050565b6000611def838360008261299157506001611787565b8161299e57506000611787565b81600181146129b457600281146129be576129da565b6001915050611787565b60ff8411156129cf576129cf612b41565b50506001821b611787565b5060208310610133831016604e8410600b84101617156129fd575081810a611787565b612a078383612938565b8060001904821115612a1b57612a1b612b41565b029392505050565b60006001600160d81b0382811684821681151582840482111615612a4957612a49612b41565b02949350505050565b6000816000190483118215151615612a6c57612a6c612b41565b500290565b60008160060b8360060b82811281667fffffffffffff1901831281151615612a9b57612a9b612b41565b81667fffffffffffff018313811615612ab657612ab6612b41565b5090039392505050565b600082821015612ad257612ad2612b41565b500390565b6000600019821415612aeb57612aeb612b41565b5060010190565b600082612b0157612b01612b57565b500690565b60008160020b627fffff19811415612b2057612b20612b41565b9003919050565b6000600160ff1b821415612b3d57612b3d612b41565b0390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610f1557600080fd5b8060060b8114610f1557600080fdfea2646970667358221220a044f7edac8da3b28919b9870a96fe6464c6c897d8eb901da5f8107987e29de264736f6c63430008040033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101cf5760003560e01c806379ba509711610104578063b295ad34116100a2578063c3b83f5f11610071578063c3b83f5f1461043a578063c4d66de81461044d578063e4d8f8a614610460578063e69bd3fa1461047357600080fd5b8063b295ad34146103b6578063b40ee76d146103eb578063b5217bb4146103fe578063c0c7df6f1461042757600080fd5b806399a440f6116100de57806399a440f6146103755780639accab5514610388578063a0f3087f14610390578063ac82f608146103a357600080fd5b806379ba5097146103415780637a5a2a98146103495780638da5cb5b1461035c57600080fd5b806346461240116101715780635b769f3c1161014b5780635b769f3c146102d65780635db99af2146102e957806361c661de146103035780637103353e1461031857600080fd5b806346461240146102825780634f72def61461028a57806353a47bb7146102ab57600080fd5b80633b824b8c116101ad5780633b824b8c1461020f5780633c1d5df0146102225780633f0e084f146102475780634308a94f1461025a57600080fd5b806313af4035146101d45780631627540c146101e95780632bed9e0c146101fc575b600080fd5b6101e76101e2366004612503565b6104a6565b005b6101e76101f7366004612503565b6105e6565b6101e761020a366004612601565b61063c565b6101e761021d366004612648565b610732565b60075461022f9060060b81565b60405160069190910b81526020015b60405180910390f35b6101e7610255366004612619565b610b8f565b61026d610268366004612601565b610e12565b6040805192835260208301919091520161023e565b6101e7610e45565b61029d610298366004612601565b610f18565b60405190815260200161023e565b6001546102be906001600160a01b031681565b6040516001600160a01b03909116815260200161023e565b6101e76102e4366004612503565b610f39565b6007546102be90600160381b90046001600160a01b031681565b61030b610f8f565b60405161023e91906127f7565b6102be610326366004612601565b6002602052600090815260409020546001600160a01b031681565b6101e7610fe7565b6101e7610357366004612503565b6110e4565b6000546102be906201000090046001600160a01b031681565b61029d610383366004612601565b61114a565b61030b61115a565b6101e761039e366004612601565b611253565b61029d6103b1366004612601565b6112ab565b6103d96103c4366004612601565b60036020526000908152604090205460ff1681565b60405160ff909116815260200161023e565b6101e76103f9366004612689565b6112c6565b6102be61040c366004612601565b6006602052600090815260409020546001600160a01b031681565b6008546102be906001600160a01b031681565b6101e7610448366004612503565b611323565b6101e761045b366004612503565b61143c565b6101e761046e366004612601565b611513565b610496610481366004612601565b60096020526000908152604090205460ff1681565b604051901515815260200161023e565b6001600160a01b0381166105015760405162461bcd60e51b815260206004820152601960248201527f4f776e657220616464726573732063616e6e6f7420626520300000000000000060448201526064015b60405180910390fd5b600154600160a01b900460ff161561056d5760405162461bcd60e51b815260206004820152602960248201527f416c726561647920696e697469616c697a65642c20757365206e6f6d696e617460448201526832a732bba7bbb732b960b91b60648201526084016104f8565b6001805460ff60a01b1916600160a01b179055600080546001600160a01b03831662010000810262010000600160b01b03199092169190911782556040805192835260208301919091527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c91015b60405180910390a150565b6105ee6115e6565b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce22906020016105db565b6106446115e6565b6000818152600260205260409020546001600160a01b0316806106a95760405162461bcd60e51b815260206004820152601c60248201527f4e6f2061676772656761746f722065786973747320666f72206b65790000000060448201526064016104f8565b600082815260026020908152604080832080546001600160a01b031916905560039091528120805460ff191690556106e2836005611660565b9050801561072d57604080518481526001600160a01b03841660208201527fec70e890fc7db7de4059b114c9093a1f41283d18ffcfbcac45566feea4d4f77791015b60405180910390a15b505050565b61073a6115e6565b6000838152600260205260409020546001600160a01b031680156107aa5760405162461bcd60e51b815260206004820152602160248201527f41676772656761746f7220616c72656164792065786973747320666f72206b656044820152607960f81b60648201526084016104f8565b60008290506000816001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b1580156107ea57600080fd5b505afa1580156107fe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610822919061251f565b90506000826001600160a01b031663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b15801561085f57600080fd5b505afa158015610873573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610897919061251f565b6008549091506000906001600160a01b03848116911614806108cd57506007546001600160a01b03848116600160381b90920416145b6008549091506000906001600160a01b038481169116148061090357506007546001600160a01b03848116600160381b90920416145b9050818061090e5750805b6109665760405162461bcd60e51b815260206004820152602360248201527f506f6f6c206e6f742076616c69643a20455448206973206e6f7420616e2061736044820152621cd95d60ea1b60648201526084016104f8565b836001600160a01b0316886001600160a01b031614806109975750826001600160a01b0316886001600160a01b0316145b6109f45760405162461bcd60e51b815260206004820152602860248201527f506f6f6c206e6f742076616c69643a2063757272656e6379206973206e6f7420604482015267185b88185cdcd95d60c21b60648201526084016104f8565b6000856001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b158015610a2f57600080fd5b505afa158015610a43573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6791906126a5565b50505050505090506000816001600160a01b031611610ab95760405162461bcd60e51b815260206004820152600e60248201526d141bdbdb081b9bdd081d985b1a5960921b60448201526064016104f8565b60008a8152600660205260409020546001600160a01b0316610b0b57600580546001810182556000919091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0018a90555b60008a815260066020908152604080832080546001600160a01b038b166001600160a01b031990911681179091556003835292819020805460ff1916601217905580518d8152918201929092527ffd0fa7919fbe3857a4236750e8d3e42ac691881d2f31c50ebe4cfc2a7705ee80910160405180910390a150505050505050505050565b610b976115e6565b60008190506000816001600160a01b031663668a0f026040518163ffffffff1660e01b815260040160206040518083038186803b158015610bd757600080fd5b505afa158015610beb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c0f919061273d565b1015610c5d5760405162461bcd60e51b815260206004820152601b60248201527f476976656e2041676772656761746f7220697320696e76616c6964000000000060448201526064016104f8565b6000816001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015610c9857600080fd5b505afa158015610cac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cd091906127a4565b905060128160ff161115610d415760405162461bcd60e51b815260206004820152603260248201527f41676772656761746f7220646563696d616c732073686f756c64206265206c6f6044820152710eecae440dee440cae2eac2d840e8de4062760731b60648201526084016104f8565b6000848152600260205260409020546001600160a01b0316610d9357600580546001810182556000919091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0018490555b600084815260026020908152604080832080546001600160a01b0319166001600160a01b0387169081179091556003835292819020805460ff191660ff86161790558051878152918201929092527f0bcae573430f69c5361e5d76534d3f61d2d803958778680cd74be9dc6299bc63910160405180910390a150505050565b6000806000610e208461178d565b80516020909101516001600160d81b039091169564ffffffffff909116945092505050565b610e4d6115e6565b60055415610e9d5760405162461bcd60e51b815260206004820152601a60248201527f43757272656e6379206b657973206973206e6f7420656d70747900000000000060448201526064016104f8565b60005b600454811015610f155760048181548110610ecb57634e487b7160e01b600052603260045260246000fd5b906000526020600020015460058281548110610ef757634e487b7160e01b600052603260045260246000fd5b60009182526020909120015580610f0d81612ad7565b915050610ea0565b50565b60048181548110610f2857600080fd5b600091825260209091200154905081565b610f416115e6565b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f8121e397d1abdd9a4231e6d2a3da170b653b62342667c1ed8697d07f560836eb906020016105db565b60606005805480602002602001604051908101604052809291908181526020018280548015610fdd57602002820191906000526020600020905b815481526020019060010190808311610fc9575b5050505050905090565b6001546001600160a01b0316331461105f5760405162461bcd60e51b815260206004820152603560248201527f596f75206d757374206265206e6f6d696e61746564206265666f726520796f7560448201527402063616e20616363657074206f776e65727368697605c1b60648201526084016104f8565b60005460015460408051620100009093046001600160a01b03908116845290911660208301527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c910160405180910390a1600180546000805462010000600160b01b0319166001600160a01b03831662010000021790556001600160a01b0319169055565b6110ec6115e6565b60078054670100000000000000600160d81b031916600160381b6001600160a01b038416908102919091179091556040519081527f9869fd5d75bcb7e8ecd63be9bdc2491f03bf7773f4f978ae21d550598f89a5ca906020016105db565b60058181548110610f2857600080fd5b60055460609060009067ffffffffffffffff81111561118957634e487b7160e01b600052604160045260246000fd5b6040519080825280602002602001820160405280156111b2578160200160208202803683370190505b50915060005b60055481101561124e576000600582815481106111e557634e487b7160e01b600052603260045260246000fd5b906000526020600020015490506111fb8161178d565b516001600160d81b0316848461121081612ad7565b95508151811061123057634e487b7160e01b600052603260045260246000fd5b6020908102919091010152508061124681612ad7565b9150506111b8565b505090565b61125b6115e6565b60008181526009602052604090819020805460ff19811660ff90911615179055517fb3708876f7f03a1f6c8e5c502b558d87faab81782c2e8562ed2cd5b87f63f99b906105db9083815260200190565b60006112b68261178d565b516001600160d81b031692915050565b6112ce6115e6565b6007805466ffffffffffffff191666ffffffffffffff600684900b908116919091179091556040519081527f2350458cc43fccffd5931a35a5cceaa703560f40edc555814faf87d392147505906020016105db565b61132b6115e6565b6001600160a01b0381166113735760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b60448201526064016104f8565b600154600160a81b900460ff16156113c35760405162461bcd60e51b8152602060048201526013602482015272105b1c9958591e481d1c985b9cd9995c9c9959606a1b60448201526064016104f8565b600080546001600160a01b038381166201000081810262010000600160b01b031990941693909317938490556001805460ff60a81b1916600160a81b1790556040805193909404909116825260208201527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c91016105db565b600054610100900460ff166114575760005460ff161561145b565b303b155b6114be5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016104f8565b600054610100900460ff161580156114e0576000805461ffff19166101011790555b6114e9826104a6565b6007805466ffffffffffffff191661012c179055801561150f576000805461ff00191690555b5050565b61151b6115e6565b6000818152600660205260409020546001600160a01b0316806115795760405162461bcd60e51b81526020600482015260166024820152754e6f20706f6f6c2065786973747320666f72206b657960501b60448201526064016104f8565b600082815260066020526040812080546001600160a01b03191690556115a0836005611660565b9050801561072d57604080518481526001600160a01b03841660208201527fec6c5a212891ee59cd0846cf5c9bb92c3cb05e7dc0191e73abec1ac38822b9739101610724565b6000546201000090046001600160a01b0316331461165e5760405162461bcd60e51b815260206004820152602f60248201527f4f6e6c792074686520636f6e7472616374206f776e6572206d6179207065726660448201526e37b936903a3434b99030b1ba34b7b760891b60648201526084016104f8565b565b6000805b8254811015611781578383828154811061168e57634e487b7160e01b600052603260045260246000fd5b9060005260206000200154141561176f578281815481106116bf57634e487b7160e01b600052603260045260246000fd5b6000918252602082200155825483906116da90600190612ac0565b815481106116f857634e487b7160e01b600052603260045260246000fd5b906000526020600020015483828154811061172357634e487b7160e01b600052603260045260246000fd5b90600052602060002001819055508280548061174f57634e487b7160e01b600052603160045260246000fd5b600190038181906000526020600020016000905590556001915050611787565b8061177981612ad7565b915050611664565b50600090505b92915050565b60408051808201909152600080825260208201526000828152600260209081526040808320546006909252909120546001600160a01b039182169116811515806117df57506001600160a01b03811615155b6118375760405162461bcd60e51b8152602060048201526024808201527f4e6f2061676772656761746f72206f7220706f6f6c2065786973747320666f72604482015263206b657960e01b60648201526084016104f8565b6001600160a01b03821615611858576118508285611a62565b949350505050565b6208aa8960eb1b60005260026020527fd9402e47e68a5154d8f9cdc9d4ffcf4a300546026372c3b04224fbe62656c601546001600160a01b03166118de5760405162461bcd60e51b815260206004820152601c60248201527f507269636520666f722045544820646f6573206e6f742065786973740000000060448201526064016104f8565b60006118f26118ed8387611b67565b611dbb565b6208aa8960eb1b600081815260026020527fd9402e47e68a5154d8f9cdc9d4ffcf4a300546026372c3b04224fbe62656c601549293509161193e916001600160a01b0390911690611a62565b5161195190670de0b6b3a7640000612a23565b6001600160d81b031690506000836001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b15801561199757600080fd5b505afa1580156119ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119cf919061251f565b6007549091506000906001600160a01b03808416600160381b909204161480611a0557506008546001600160a01b038381169116145b15611a1b57611a148484612924565b9050611a28565b611a258484612a52565b90505b6040518060400160405280611a3d8a84611df6565b6001600160d81b0316815264ffffffffff421660209091015298975050505050505050565b604080518082019091526000808252602082015260408051600481526024810182526020810180516001600160e01b0316633fabe5a360e21b179052905160009081906001600160a01b03871690611abb9085906127be565b600060405180830381855afa9150503d8060008114611af6576040519150601f19603f3d011682016040523d82523d6000602084013e611afb565b606091505b50915091508115611b5e5760008082806020019051810190611b1d9190612755565b509350509250506040518060400160405280611b398985611df6565b6001600160d81b031681526020018264ffffffffff1681525095505050505050611787565b50505092915050565b600754600090600690810b900b1580611b8e575060008281526009602052604090205460ff165b15611c1357826001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b158015611bcc57600080fd5b505afa158015611be0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c0491906126a5565b50949550611787945050505050565b6040805160028082526060820183526000926020830190803683375050600754825192935060060b91839150600090611c5c57634e487b7160e01b600052603260045260246000fd5b602002602001019063ffffffff16908163ffffffff1681525050600081600181518110611c9957634e487b7160e01b600052603260045260246000fd5b63ffffffff9092166020928302919091019091015260405163883bdbfd60e01b81526000906001600160a01b0386169063883bdbfd90611cdd90859060040161283b565b60006040518083038186803b158015611cf557600080fd5b505afa158015611d09573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611d31919081019061253b565b509050611db2600760009054906101000a900460060b82600081518110611d6857634e487b7160e01b600052603260045260246000fd5b602002602001015183600181518110611d9157634e487b7160e01b600052603260045260246000fd5b6020026020010151611da39190612a71565b611dad91906128e6565b611ea2565b95945050505050565b600080611dd66001600160a01b03841680600160601b6122b7565b9050611def81670de0b6b3a7640000600160601b6122b7565b9392505050565b600080821215611e485760405162461bcd60e51b815260206004820152601b60248201527f4e656761746976652072617465206e6f7420737570706f72746564000000000060448201526064016104f8565b60008381526003602052604090205460ff1615611e9c57600083815260036020526040812054611e7d9060129060ff16612431565b611e8890600a61297b565b9050611e94838261243d565b915050611787565b50919050565b60008060008360020b12611eb9578260020b611ec6565b8260020b611ec690612b27565b9050611ed5620d89e719612b06565b60020b811115611f0b5760405162461bcd60e51b81526020600482015260016024820152601560fa1b60448201526064016104f8565b600060018216611f1f57600160801b611f31565b6ffffcb933bd6fad37aa2d162d1a5940015b70ffffffffffffffffffffffffffffffffff1690506002821615611f70576080611f6b826ffff97272373d413259a46990580e213a612a52565b901c90505b6004821615611f9a576080611f95826ffff2e50f5f656932ef12357cf3c7fdcc612a52565b901c90505b6008821615611fc4576080611fbf826fffe5caca7e10e4e61c3624eaa0941cd0612a52565b901c90505b6010821615611fee576080611fe9826fffcb9843d60f6159c9db58835c926644612a52565b901c90505b6020821615612018576080612013826fff973b41fa98c081472e6896dfb254c0612a52565b901c90505b604082161561204257608061203d826fff2ea16466c96a3843ec78b326b52861612a52565b901c90505b608082161561206c576080612067826ffe5dee046a99a2a811c461f1969c3053612a52565b901c90505b610100821615612097576080612092826ffcbe86c7900a88aedcffc83b479aa3a4612a52565b901c90505b6102008216156120c25760806120bd826ff987a7253ac413176f2b074cf7815e54612a52565b901c90505b6104008216156120ed5760806120e8826ff3392b0822b70005940c7a398e4b70f3612a52565b901c90505b610800821615612118576080612113826fe7159475a2c29b7443b29c7fa6e889d9612a52565b901c90505b61100082161561214357608061213e826fd097f3bdfd2022b8845ad8f792aa5825612a52565b901c90505b61200082161561216e576080612169826fa9f746462d870fdf8a65dc1f90e061e5612a52565b901c90505b614000821615612199576080612194826f70d869a156d2a1b890bb3df62baf32f7612a52565b901c90505b6180008216156121c45760806121bf826f31be135f97d08fd981231505542fcfa6612a52565b901c90505b620100008216156121f05760806121eb826f09aa508b5b7a84e1c677de54f3e99bc9612a52565b901c90505b6202000082161561221b576080612216826e5d6af8dedb81196699c329225ee604612a52565b901c90505b62040000821615612245576080612240826d2216e584f5fa1ea926041bedfe98612a52565b901c90505b6208000082161561226d576080612268826b048a170391f7dc42444e8fa2612a52565b901c90505b60008460020b13156122885761228581600019612924565b90505b61229764010000000082612af2565b156122a35760016122a6565b60005b6118509060ff16602083901c6128ce565b6000808060001985870985870292508281108382030391505080600014156122f157600084116122e657600080fd5b508290049050611def565b8084116122fd57600080fd5b600084868809808403938111909203919050600061231d861960016128ce565b861695869004959384900493600081900304600101905061233e8184612a52565b90931792600061234f876003612a52565b600218905061235e8188612a52565b612369906002612ac0565b6123739082612a52565b905061237f8188612a52565b61238a906002612ac0565b6123949082612a52565b90506123a08188612a52565b6123ab906002612ac0565b6123b59082612a52565b90506123c18188612a52565b6123cc906002612ac0565b6123d69082612a52565b90506123e28188612a52565b6123ed906002612ac0565b6123f79082612a52565b90506124038188612a52565b61240e906002612ac0565b6124189082612a52565b90506124248186612a52565b9998505050505050505050565b6000611def8284612ac0565b6000611def8284612a52565b600082601f830112612459578081fd5b8151602061246e612469836128aa565b612879565b80838252828201915082860187848660051b890101111561248d578586fd5b855b858110156124b45781516124a281612b83565b8452928401929084019060010161248f565b5090979650505050505050565b805161ffff811681146124d357600080fd5b919050565b805169ffffffffffffffffffff811681146124d357600080fd5b805160ff811681146124d357600080fd5b600060208284031215612514578081fd5b8135611def81612b83565b600060208284031215612530578081fd5b8151611def81612b83565b6000806040838503121561254d578081fd5b825167ffffffffffffffff80821115612564578283fd5b818501915085601f830112612577578283fd5b81516020612587612469836128aa565b8083825282820191508286018a848660051b89010111156125a6578788fd5b8796505b848710156125d15780516125bd81612b98565b8352600196909601959183019183016125aa565b50918801519196509093505050808211156125ea578283fd5b506125f785828601612449565b9150509250929050565b600060208284031215612612578081fd5b5035919050565b6000806040838503121561262b578182fd5b82359150602083013561263d81612b83565b809150509250929050565b60008060006060848603121561265c578081fd5b83359250602084013561266e81612b83565b9150604084013561267e81612b83565b809150509250925092565b60006020828403121561269a578081fd5b8135611def81612b98565b600080600080600080600060e0888a0312156126bf578283fd5b87516126ca81612b83565b8097505060208801518060020b81146126e1578384fd5b95506126ef604089016124c1565b94506126fd606089016124c1565b935061270b608089016124c1565b925061271960a089016124f2565b915060c0880151801515811461272d578182fd5b8091505092959891949750929550565b60006020828403121561274e578081fd5b5051919050565b600080600080600060a0868803121561276c578283fd5b612775866124d8565b9450602086015193506040860151925060608601519150612798608087016124d8565b90509295509295909350565b6000602082840312156127b5578081fd5b611def826124f2565b60008251815b818110156127de57602081860181015185830152016127c4565b818111156127ec5782828501525b509190910192915050565b6020808252825182820181905260009190848201906040850190845b8181101561282f57835183529284019291840191600101612813565b50909695505050505050565b6020808252825182820181905260009190848201906040850190845b8181101561282f57835163ffffffff1683529284019291840191600101612857565b604051601f8201601f1916810167ffffffffffffffff811182821017156128a2576128a2612b6d565b604052919050565b600067ffffffffffffffff8211156128c4576128c4612b6d565b5060051b60200190565b600082198211156128e1576128e1612b41565b500190565b60008160060b8360060b806128fd576128fd612b57565b667fffffffffffff1982146000198214161561291b5761291b612b41565b90059392505050565b60008261293357612933612b57565b500490565b600181815b8085111561297357816000190482111561295957612959612b41565b8085161561296657918102915b93841c939080029061293d565b509250929050565b6000611def838360008261299157506001611787565b8161299e57506000611787565b81600181146129b457600281146129be576129da565b6001915050611787565b60ff8411156129cf576129cf612b41565b50506001821b611787565b5060208310610133831016604e8410600b84101617156129fd575081810a611787565b612a078383612938565b8060001904821115612a1b57612a1b612b41565b029392505050565b60006001600160d81b0382811684821681151582840482111615612a4957612a49612b41565b02949350505050565b6000816000190483118215151615612a6c57612a6c612b41565b500290565b60008160060b8360060b82811281667fffffffffffff1901831281151615612a9b57612a9b612b41565b81667fffffffffffff018313811615612ab657612ab6612b41565b5090039392505050565b600082821015612ad257612ad2612b41565b500390565b6000600019821415612aeb57612aeb612b41565b5060010190565b600082612b0157612b01612b57565b500690565b60008160020b627fffff19811415612b2057612b20612b41565b9003919050565b6000600160ff1b821415612b3d57612b3d612b41565b0390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610f1557600080fd5b8060060b8114610f1557600080fdfea2646970667358221220a044f7edac8da3b28919b9870a96fe6464c6c897d8eb901da5f8107987e29de264736f6c63430008040033

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  ]
[ 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.