ETH Price: $3,269.25 (+4.98%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

> 10 Internal Transactions found.

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block
From
To
178190112023-08-01 8:39:11548 days ago1690879151
0x236D9032...2f3a26b6a
0 ETH
178190112023-08-01 8:39:11548 days ago1690879151
0x236D9032...2f3a26b6a
0 ETH
178190112023-08-01 8:39:11548 days ago1690879151
0x236D9032...2f3a26b6a
0 ETH
178190112023-08-01 8:39:11548 days ago1690879151
0x236D9032...2f3a26b6a
0 ETH
151844662022-07-21 7:03:13924 days ago1658386993
0x236D9032...2f3a26b6a
0 ETH
151844662022-07-21 7:03:13924 days ago1658386993
0x236D9032...2f3a26b6a
0 ETH
151844662022-07-21 7:03:13924 days ago1658386993
0x236D9032...2f3a26b6a
0 ETH
151844662022-07-21 7:03:13924 days ago1658386993
0x236D9032...2f3a26b6a
0 ETH
151465822022-07-15 9:59:42930 days ago1657879182
0x236D9032...2f3a26b6a
0 ETH
151465822022-07-15 9:59:42930 days ago1657879182
0x236D9032...2f3a26b6a
0 ETH
151465822022-07-15 9:59:42930 days ago1657879182
0x236D9032...2f3a26b6a
0 ETH
151465822022-07-15 9:59:42930 days ago1657879182
0x236D9032...2f3a26b6a
0 ETH
149929982022-06-19 21:43:23956 days ago1655675003
0x236D9032...2f3a26b6a
0 ETH
149929982022-06-19 21:43:23956 days ago1655675003
0x236D9032...2f3a26b6a
0 ETH
149929982022-06-19 21:43:23956 days ago1655675003
0x236D9032...2f3a26b6a
0 ETH
149929982022-06-19 21:43:23956 days ago1655675003
0x236D9032...2f3a26b6a
0 ETH
149867112022-06-18 19:35:13957 days ago1655580913
0x236D9032...2f3a26b6a
0 ETH
149867112022-06-18 19:35:13957 days ago1655580913
0x236D9032...2f3a26b6a
0 ETH
149867112022-06-18 19:35:13957 days ago1655580913
0x236D9032...2f3a26b6a
0 ETH
149867112022-06-18 19:35:13957 days ago1655580913
0x236D9032...2f3a26b6a
0 ETH
149863482022-06-18 18:06:42957 days ago1655575602
0x236D9032...2f3a26b6a
0 ETH
149863482022-06-18 18:06:42957 days ago1655575602
0x236D9032...2f3a26b6a
0 ETH
149863482022-06-18 18:06:42957 days ago1655575602
0x236D9032...2f3a26b6a
0 ETH
149863482022-06-18 18:06:42957 days ago1655575602
0x236D9032...2f3a26b6a
0 ETH
149854322022-06-18 14:16:06957 days ago1655561766
0x236D9032...2f3a26b6a
0 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
OracleDAI

Compiler Version
v0.8.7+commit.e28d00a7

Optimization Enabled:
Yes with 1000000 runs

Other Settings:
default evmVersion, GNU GPLv3 license
File 1 of 23 : OracleDAI.sol
// SPDX-License-Identifier: GPL-3.0

pragma solidity ^0.8.7;

import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";

import "./OracleAbstract.sol";

import "./modules/ModuleChainlinkMulti.sol";
import "./modules/ModuleUniswapMulti.sol";

/// @title OracleDAI
/// @author Angle Core Team
/// @notice Oracle contract, one contract is deployed per collateral/stablecoin pair
/// @dev This contract concerns an oracle that only uses both Chainlink and Uniswap for multiple pools
/// @dev This is going to be used for like ETH/EUR oracles
/// @dev Like all oracle contracts, this contract is an instance of `OracleAstract` that contains some
/// base functions
contract OracleDAI is OracleAbstract, ModuleChainlinkMulti, ModuleUniswapMulti {
    /// @notice Whether the final rate obtained with Uniswap should be multiplied to last rate from Chainlink
    uint8 public immutable uniFinalCurrency;

    /// @notice Unit out Uniswap currency
    uint256 public immutable outBase;

    /// @notice Constructor for an oracle using both Uniswap and Chainlink with multiple pools to read from
    /// @param addressInAndOutUni List of 2 addresses representing the in-currency address and the out-currency address
    /// @param _circuitUniswap Path of the Uniswap pools
    /// @param _circuitUniIsMultiplied Whether we should multiply or divide by this rate in the path
    /// @param _twapPeriod Time weighted average window for all Uniswap pools
    /// @param observationLength Number of observations that each pool should have stored
    /// @param _uniFinalCurrency Whether we need to use the last Chainlink oracle to convert to another
    /// currency / asset (Forex for instance)
    /// @param _circuitChainlink Chainlink pool addresses put in order
    /// @param _circuitChainIsMultiplied Whether we should multiply or divide by this rate
    /// @param guardians List of governor or guardian addresses
    /// @param _description Description of the assets concerned by the oracle
    /// @dev When deploying this contract, it is important to check in the case where Uniswap circuit is not final whether
    /// Chainlink and Uniswap circuits are compatible. If Chainlink is UNI-WBTC and WBTC-USD and Uniswap is just UNI-WETH,
    /// then Chainlink cannot be the final circuit
    constructor(
        address[] memory addressInAndOutUni,
        IUniswapV3Pool[] memory _circuitUniswap,
        uint8[] memory _circuitUniIsMultiplied,
        uint32 _twapPeriod,
        uint16 observationLength,
        uint8 _uniFinalCurrency,
        address[] memory _circuitChainlink,
        uint8[] memory _circuitChainIsMultiplied,
        uint32 stalePeriod,
        address[] memory guardians,
        bytes32 _description
    )
        ModuleUniswapMulti(_circuitUniswap, _circuitUniIsMultiplied, _twapPeriod, observationLength, guardians)
        ModuleChainlinkMulti(_circuitChainlink, _circuitChainIsMultiplied, stalePeriod, guardians)
    {
        require(addressInAndOutUni.length == 2, "107");
        // Using the tokens' metadata to get the in and out currencies decimals
        IERC20Metadata inCur = IERC20Metadata(addressInAndOutUni[0]);
        IERC20Metadata outCur = IERC20Metadata(addressInAndOutUni[1]);
        inBase = 10**(inCur.decimals());
        outBase = 10**(outCur.decimals());

        uniFinalCurrency = _uniFinalCurrency;
        description = _description;
    }

    /// @notice Reads the Uniswap rate using the circuit given
    /// @return The current rate between the in-currency and out-currency
    /// @dev By default even if there is a Chainlink rate, this function returns the Uniswap rate
    /// @dev The amount returned is expressed with base `BASE` (and not the base of the out-currency)
    function read() external view override returns (uint256) {
        return _readUniswapQuote(inBase);
    }

    /// @notice Converts an in-currency quote amount to out-currency using the Uniswap rate
    /// @param quoteAmount Amount (in the input collateral) to be converted in out-currency
    /// @return Quote amount in out-currency from the base amount in in-currency
    /// @dev Like in the `read` function, this function returns the Uniswap quote
    /// @dev The amount returned is expressed with base `BASE` (and not the base of the out-currency)
    function readQuote(uint256 quoteAmount) external view override returns (uint256) {
        return _readUniswapQuote(quoteAmount);
    }

    /// @notice Returns Uniswap and Chainlink values (with the first one being the smallest one)
    /// @param quoteAmount Amount expressed in the in-currency base.
    /// @dev If quoteAmount is `inBase`, rates are returned
    /// @return The first parameter is the lowest value and the second parameter is the highest
    /// @dev The amount returned is expressed with base `BASE` (and not the base of the out-currency)
    function _readAll(uint256 quoteAmount) internal view override returns (uint256, uint256) {
        uint256 quoteAmountUni = _quoteUniswap(quoteAmount);

        // The current uni rate is in `outBase` we want our rate to all be in base `BASE`
        quoteAmountUni = (quoteAmountUni * BASE) / outBase;
        // The current amount is in `inBase` we want our rate to all be in base `BASE`
        uint256 quoteAmountCL = (quoteAmount * BASE) / inBase;
        uint256 ratio;

        (quoteAmountCL, ratio) = _quoteChainlink(quoteAmountCL);

        if (uniFinalCurrency > 0) {
            quoteAmountUni = _changeUniswapNotFinal(ratio, quoteAmountUni);
        }

        // As DAI is made to be a stablecoin, compute the rate as if Uniswap returned `BASE * quoteAmount / inBase`
        ratio = _changeUniswapNotFinal(ratio, (quoteAmount * BASE) / inBase);

        if (quoteAmountCL <= quoteAmountUni) {
            if (ratio <= quoteAmountCL) {
                return (ratio, quoteAmountUni);
            } else if (quoteAmountUni <= ratio) {
                return (quoteAmountCL, ratio);
            }
            return (quoteAmountCL, quoteAmountUni);
        } else {
            if (ratio <= quoteAmountUni) {
                return (ratio, quoteAmountCL);
            } else if (quoteAmountCL <= ratio) {
                return (quoteAmountUni, ratio);
            }
            return (quoteAmountUni, quoteAmountCL);
        }
    }

    /// @notice Uses Chainlink's value to change Uniswap's rate
    /// @param ratio Value of the last oracle rate of Chainlink
    /// @param quoteAmountUni End quote computed from Uniswap's circuit
    /// @dev We use the last Chainlink rate to correct the value obtained with Uniswap. It may for instance be used
    /// to get a Uniswap price in EUR (ex: ETH -> USDC and we use this to do USDC -> EUR)
    function _changeUniswapNotFinal(uint256 ratio, uint256 quoteAmountUni) internal view returns (uint256) {
        uint256 idxLastPoolCL = circuitChainlink.length - 1;
        (quoteAmountUni, ) = _readChainlinkFeed(
            quoteAmountUni,
            circuitChainlink[idxLastPoolCL],
            circuitChainIsMultiplied[idxLastPoolCL],
            chainlinkDecimals[idxLastPoolCL],
            ratio
        );
        return quoteAmountUni;
    }

    /// @notice Internal function to convert an in-currency quote amount to out-currency using only the Uniswap rate
    /// and by correcting it if needed from Chainlink last rate
    /// @param quoteAmount Amount (in the input collateral) to be converted in out-currency using Uniswap (and Chainlink)
    /// at the end of the funnel
    /// @return uniAmount Quote amount in out-currency from the base amount in in-currency
    /// @dev The amount returned is expressed with base `BASE` (and not the base of the out-currency)
    function _readUniswapQuote(uint256 quoteAmount) internal view returns (uint256 uniAmount) {
        uniAmount = _quoteUniswap(quoteAmount);
        // The current uni rate is in outBase we want our rate to all be in base
        uniAmount = (uniAmount * BASE) / outBase;
        if (uniFinalCurrency > 0) {
            uniAmount = _changeUniswapNotFinal(0, uniAmount);
        }
    }
}

File 2 of 23 : AggregatorV3Interface.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.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 3 of 23 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

File 4 of 23 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC20.sol";

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

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

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

File 5 of 23 : Context.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

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

File 6 of 23 : Strings.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _HEX_SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }
}

File 7 of 23 : 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 23 : 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 9 of 23 : 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 10 of 23 : IUniswapV3PoolEvents.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

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

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

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

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

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

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

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

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

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

File 11 of 23 : 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 23 : 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 13 of 23 : 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 14 of 23 : AccessControl.sol
// SPDX-License-Identifier: GPL-3.0

pragma solidity ^0.8.7;

import "@openzeppelin/contracts/utils/Context.sol";
import "@openzeppelin/contracts/utils/Strings.sol";

import "../interfaces/IAccessControl.sol";

/**
 * @dev This contract is fully forked from OpenZeppelin `AccessControl`.
 * The only difference is the removal of the ERC165 implementation as it's not
 * needed in Angle.
 *
 * Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it.
 */
abstract contract AccessControl is Context, IAccessControl {
    struct RoleData {
        mapping(address => bool) members;
        bytes32 adminRole;
    }

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with a standardized message including the required role.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{20}) is missing role (0x[0-9a-f]{32})$/
     *
     * _Available since v4.1._
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role, _msgSender());
        _;
    }

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view override returns (bool) {
        return _roles[role].members[account];
    }

    /**
     * @dev Revert with a standard message if `account` is missing `role`.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{20}) is missing role (0x[0-9a-f]{32})$/
     */
    function _checkRole(bytes32 role, address account) internal view {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        Strings.toHexString(uint160(account), 20),
                        " is missing role ",
                        Strings.toHexString(uint256(role), 32)
                    )
                )
            );
        }
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view override returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) external override onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) external override onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) external override {
        require(account == _msgSender(), "71");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     */
    function _setupRole(bytes32 role, address account) internal {
        _grantRole(role, account);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal {
        emit RoleAdminChanged(role, getRoleAdmin(role), adminRole);
        _roles[role].adminRole = adminRole;
    }

    function _grantRole(bytes32 role, address account) internal {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    function _revokeRole(bytes32 role, address account) internal {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

File 15 of 23 : FullMath.sol
// SPDX-License-Identifier: GPL-3.0

pragma solidity >=0.4.0;

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

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

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

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

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

        // Factor powers of two out of denominator
        // Compute largest power of two divisor of denominator.
        // Always >= 1.
        uint256 twos = denominator & (~denominator + 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;
    }
}

File 16 of 23 : IAccessControl.sol
// SPDX-License-Identifier: GPL-3.0

pragma solidity ^0.8.7;

/// @title IAccessControl
/// @author Forked from OpenZeppelin
/// @notice Interface for `AccessControl` contracts
interface IAccessControl {
    function hasRole(bytes32 role, address account) external view returns (bool);

    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    function grantRole(bytes32 role, address account) external;

    function revokeRole(bytes32 role, address account) external;

    function renounceRole(bytes32 role, address account) external;
}

File 17 of 23 : IOracle.sol
// SPDX-License-Identifier: GPL-3.0

pragma solidity ^0.8.7;

/// @title IOracle
/// @author Angle Core Team
/// @notice Interface for Angle's oracle contracts reading oracle rates from both UniswapV3 and Chainlink
/// from just UniswapV3 or from just Chainlink
interface IOracle {
    function read() external view returns (uint256);

    function readAll() external view returns (uint256 lowerRate, uint256 upperRate);

    function readLower() external view returns (uint256);

    function readUpper() external view returns (uint256);

    function readQuote(uint256 baseAmount) external view returns (uint256);

    function readQuoteLower(uint256 baseAmount) external view returns (uint256);

    function inBase() external view returns (uint256);
}

File 18 of 23 : OracleAbstract.sol
// SPDX-License-Identifier: GPL-3.0

pragma solidity ^0.8.7;

import "../interfaces/IOracle.sol";

/// @title OracleAbstract
/// @author Angle Core Team
/// @notice Abstract Oracle contract that contains some of the functions that are used across all oracle contracts
/// @dev This is the most generic form of oracle contract
/// @dev A rate gives the price of the out-currency with respect to the in-currency in base `BASE`. For instance
/// if the out-currency is ETH worth 1000 USD, then the rate ETH-USD is 10**21
abstract contract OracleAbstract is IOracle {
    /// @notice Base used for computation
    uint256 public constant BASE = 10**18;
    /// @notice Unit of the in-currency
    uint256 public override inBase;
    /// @notice Description of the assets concerned by the oracle and the price outputted
    bytes32 public description;

    /// @notice Reads one of the rates from the circuits given
    /// @return rate The current rate between the in-currency and out-currency
    /// @dev By default if the oracle involves a Uniswap price and a Chainlink price
    /// this function will return the Uniswap price
    /// @dev The rate returned is expressed with base `BASE` (and not the base of the out-currency)
    function read() external view virtual override returns (uint256 rate);

    /// @notice Read rates from the circuit of both Uniswap and Chainlink if there are both circuits
    /// else returns twice the same price
    /// @return Return all available rates (Chainlink and Uniswap) with the lowest rate returned first.
    /// @dev The rate returned is expressed with base `BASE` (and not the base of the out-currency)
    function readAll() external view override returns (uint256, uint256) {
        return _readAll(inBase);
    }

    /// @notice Reads rates from the circuit of both Uniswap and Chainlink if there are both circuits
    /// and returns either the highest of both rates or the lowest
    /// @return rate The lower rate between Chainlink and Uniswap
    /// @dev If there is only one rate computed in an oracle contract, then the only rate is returned
    /// regardless of the value of the `lower` parameter
    /// @dev The rate returned is expressed with base `BASE` (and not the base of the out-currency)
    function readLower() external view override returns (uint256 rate) {
        (rate, ) = _readAll(inBase);
    }

    /// @notice Reads rates from the circuit of both Uniswap and Chainlink if there are both circuits
    /// and returns either the highest of both rates or the lowest
    /// @return rate The upper rate between Chainlink and Uniswap
    /// @dev If there is only one rate computed in an oracle contract, then the only rate is returned
    /// regardless of the value of the `lower` parameter
    /// @dev The rate returned is expressed with base `BASE` (and not the base of the out-currency)
    function readUpper() external view override returns (uint256 rate) {
        (, rate) = _readAll(inBase);
    }

    /// @notice Converts an in-currency quote amount to out-currency using one of the rates available in the oracle
    /// contract
    /// @param quoteAmount Amount (in the input collateral) to be converted to be converted in out-currency
    /// @return Quote amount in out-currency from the base amount in in-currency
    /// @dev Like in the read function, if the oracle involves a Uniswap and a Chainlink price, this function
    /// will use the Uniswap price to compute the out quoteAmount
    /// @dev The rate returned is expressed with base `BASE` (and not the base of the out-currency)
    function readQuote(uint256 quoteAmount) external view virtual override returns (uint256);

    /// @notice Returns the lowest quote amount between Uniswap and Chainlink circuits (if possible). If the oracle
    /// contract only involves a single feed, then this returns the value of this feed
    /// @param quoteAmount Amount (in the input collateral) to be converted
    /// @return The lowest quote amount from the quote amount in in-currency
    /// @dev The rate returned is expressed with base `BASE` (and not the base of the out-currency)
    function readQuoteLower(uint256 quoteAmount) external view override returns (uint256) {
        (uint256 quoteSmall, ) = _readAll(quoteAmount);
        return quoteSmall;
    }

    /// @notice Returns Uniswap and Chainlink values (with the first one being the smallest one) or twice the same value
    /// if just Uniswap or just Chainlink is used
    /// @param quoteAmount Amount expressed in the in-currency base.
    /// @dev If `quoteAmount` is `inBase`, rates are returned
    /// @return The first return value is the lowest value and the second parameter is the highest
    /// @dev The rate returned is expressed with base `BASE` (and not the base of the out-currency)
    function _readAll(uint256 quoteAmount) internal view virtual returns (uint256, uint256) {}
}

File 19 of 23 : ModuleChainlinkMulti.sol
// SPDX-License-Identifier: GPL-3.0

pragma solidity ^0.8.7;

import "../utils/ChainlinkUtils.sol";

/// @title ModuleChainlinkMulti
/// @author Angle Core Team
/// @notice Module Contract that is going to be used to help compute Chainlink prices
/// @dev This contract helps for an oracle using a Chainlink circuit composed of multiple pools
/// @dev An oracle using Chainlink is either going to be a `ModuleChainlinkSingle` or a `ModuleChainlinkMulti`
abstract contract ModuleChainlinkMulti is ChainlinkUtils {
    /// @notice Chanlink pools, the order of the pools has to be the order in which they are read for the computation
    /// of the price
    AggregatorV3Interface[] public circuitChainlink;
    /// @notice Whether each rate for the pairs in `circuitChainlink` should be multiplied or divided
    uint8[] public circuitChainIsMultiplied;
    /// @notice Decimals for each Chainlink pairs
    uint8[] public chainlinkDecimals;

    /// @notice Constructor for an oracle using only Chainlink with multiple pools to read from
    /// @param _circuitChainlink Chainlink pool addresses (in order)
    /// @param _circuitChainIsMultiplied Whether we should multiply or divide by this rate when computing Chainlink price
    constructor(
        address[] memory _circuitChainlink,
        uint8[] memory _circuitChainIsMultiplied,
        uint32 _stalePeriod,
        address[] memory guardians
    ) {
        uint256 circuitLength = _circuitChainlink.length;
        require(circuitLength > 0, "106");
        require(circuitLength == _circuitChainIsMultiplied.length, "104");
        // There is no `GOVERNOR_ROLE` in this contract, governor has `GUARDIAN_ROLE`
        require(guardians.length > 0, "101");
        for (uint256 i = 0; i < guardians.length; i++) {
            require(guardians[i] != address(0), "0");
            _setupRole(GUARDIAN_ROLE_CHAINLINK, guardians[i]);
        }
        _setRoleAdmin(GUARDIAN_ROLE_CHAINLINK, GUARDIAN_ROLE_CHAINLINK);

        for (uint256 i = 0; i < circuitLength; i++) {
            AggregatorV3Interface _pool = AggregatorV3Interface(_circuitChainlink[i]);
            circuitChainlink.push(_pool);
            chainlinkDecimals.push(_pool.decimals());
        }

        stalePeriod = _stalePeriod;
        circuitChainIsMultiplied = _circuitChainIsMultiplied;
    }

    /// @notice Reads oracle price using Chainlink circuit
    /// @param quoteAmount The amount for which to compute the price expressed with base decimal
    /// @return The `quoteAmount` converted in `out-currency`
    /// @return The value obtained with the last Chainlink feed queried casted to uint
    /// @dev If `quoteAmount` is `BASE_TOKENS`, the output is the oracle rate
    function _quoteChainlink(uint256 quoteAmount) internal view returns (uint256, uint256) {
        uint256 castedRatio;
        // An invariant should be that `circuitChainlink.length > 0` otherwise `castedRatio = 0`
        for (uint256 i = 0; i < circuitChainlink.length; i++) {
            (quoteAmount, castedRatio) = _readChainlinkFeed(
                quoteAmount,
                circuitChainlink[i],
                circuitChainIsMultiplied[i],
                chainlinkDecimals[i],
                0
            );
        }
        return (quoteAmount, castedRatio);
    }
}

File 20 of 23 : ModuleUniswapMulti.sol
// SPDX-License-Identifier: GPL-3.0

pragma solidity ^0.8.7;

import "../utils/UniswapUtils.sol";

/// @title ModuleUniswapMulti
/// @author Angle Core Team
/// @notice Module Contract that is going to be used to help compute Uniswap prices
/// @dev This contract will help for an oracle using multiple UniswapV3 pools
/// @dev An oracle using Uniswap is either going to be a `ModuleUniswapSingle` or a `ModuleUniswapMulti`
abstract contract ModuleUniswapMulti is UniswapUtils {
    /// @notice Uniswap pools, the order of the pools to arrive to the final price should be respected
    IUniswapV3Pool[] public circuitUniswap;
    /// @notice Whether the rate obtained with each pool should be multiplied or divided to the current amount
    uint8[] public circuitUniIsMultiplied;

    /// @notice Constructor for an oracle using multiple Uniswap pool
    /// @param _circuitUniswap Path of the Uniswap pools
    /// @param _circuitUniIsMultiplied Whether we should multiply or divide by this rate in the path
    /// @param _twapPeriod Time weighted average window, it is common for all Uniswap pools
    /// @param observationLength Number of observations that each pool should have stored
    /// @param guardians List of governor or guardian addresses
    constructor(
        IUniswapV3Pool[] memory _circuitUniswap,
        uint8[] memory _circuitUniIsMultiplied,
        uint32 _twapPeriod,
        uint16 observationLength,
        address[] memory guardians
    ) {
        // There is no `GOVERNOR_ROLE` in this contract, governor has `GUARDIAN_ROLE`
        require(guardians.length > 0, "101");
        for (uint256 i = 0; i < guardians.length; i++) {
            require(guardians[i] != address(0), "0");
            _setupRole(GUARDIAN_ROLE_UNISWAP, guardians[i]);
        }
        _setRoleAdmin(GUARDIAN_ROLE_UNISWAP, GUARDIAN_ROLE_UNISWAP);

        require(int32(_twapPeriod) > 0, "102");
        uint256 circuitUniLength = _circuitUniswap.length;
        require(circuitUniLength > 0, "103");
        require(circuitUniLength == _circuitUniIsMultiplied.length, "104");

        twapPeriod = _twapPeriod;

        circuitUniswap = _circuitUniswap;
        circuitUniIsMultiplied = _circuitUniIsMultiplied;

        for (uint256 i = 0; i < circuitUniLength; i++) {
            circuitUniswap[i].increaseObservationCardinalityNext(observationLength);
        }
    }

    /// @notice Reads Uniswap current block oracle rate
    /// @param quoteAmount The amount in the in-currency base to convert using the Uniswap oracle
    /// @return The value of the oracle of the initial amount is then expressed in the decimal from
    /// the end currency
    function _quoteUniswap(uint256 quoteAmount) internal view returns (uint256) {
        for (uint256 i = 0; i < circuitUniswap.length; i++) {
            quoteAmount = _readUniswapPool(quoteAmount, circuitUniswap[i], circuitUniIsMultiplied[i]);
        }
        // The decimal here is the one from the end currency
        return quoteAmount;
    }

    /// @notice Increases the number of observations for each Uniswap pools
    /// @param newLengthStored Size asked for
    /// @dev newLengthStored should be larger than all previous pools observations length
    function increaseTWAPStore(uint16 newLengthStored) external {
        for (uint256 i = 0; i < circuitUniswap.length; i++) {
            circuitUniswap[i].increaseObservationCardinalityNext(newLengthStored);
        }
    }
}

File 21 of 23 : ChainlinkUtils.sol
// SPDX-License-Identifier: GPL-3.0

pragma solidity ^0.8.7;

import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";
import "../../external/AccessControl.sol";

/// @title ChainlinkUtils
/// @author Angle Core Team
/// @notice Utility contract that is used across the different module contracts using Chainlink
abstract contract ChainlinkUtils is AccessControl {
    /// @notice Represent the maximum amount of time (in seconds) between each Chainlink update before the price feed is considered stale
    uint32 public stalePeriod;

    // Role for guardians and governors
    bytes32 public constant GUARDIAN_ROLE_CHAINLINK = keccak256("GUARDIAN_ROLE");

    /// @notice Reads a Chainlink feed using a quote amount and converts the quote amount to
    /// the out-currency
    /// @param quoteAmount The amount for which to compute the price expressed with base decimal
    /// @param feed Chainlink feed to query
    /// @param multiplied Whether the ratio outputted by Chainlink should be multiplied or divided
    /// to the `quoteAmount`
    /// @param decimals Number of decimals of the corresponding Chainlink pair
    /// @param castedRatio Whether a previous rate has already been computed for this feed
    /// This is mostly used in the `_changeUniswapNotFinal` function of the oracles
    /// @return The `quoteAmount` converted in out-currency (computed using the second return value)
    /// @return The value obtained with the Chainlink feed queried casted to uint
    function _readChainlinkFeed(
        uint256 quoteAmount,
        AggregatorV3Interface feed,
        uint8 multiplied,
        uint256 decimals,
        uint256 castedRatio
    ) internal view returns (uint256, uint256) {
        if (castedRatio == 0) {
            (uint80 roundId, int256 ratio, , uint256 updatedAt, uint80 answeredInRound) = feed.latestRoundData();
            require(ratio > 0 && roundId <= answeredInRound && block.timestamp - updatedAt <= stalePeriod, "100");
            castedRatio = uint256(ratio);
        }
        // Checking whether we should multiply or divide by the ratio computed
        if (multiplied == 1) quoteAmount = (quoteAmount * castedRatio) / (10**decimals);
        else quoteAmount = (quoteAmount * (10**decimals)) / castedRatio;
        return (quoteAmount, castedRatio);
    }

    /// @notice Changes the Stale Period
    /// @param _stalePeriod New stale period (in seconds)
    function changeStalePeriod(uint32 _stalePeriod) external onlyRole(GUARDIAN_ROLE_CHAINLINK) {
        stalePeriod = _stalePeriod;
    }
}

File 22 of 23 : UniswapUtils.sol
// SPDX-License-Identifier: GPL-3.0

pragma solidity ^0.8.7;

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

import "../../external/AccessControl.sol";

import "../../utils/OracleMath.sol";

/// @title UniswapUtils
/// @author Angle Core Team
/// @notice Utility contract that is used in the Uniswap module contract
abstract contract UniswapUtils is AccessControl, OracleMath {
    // The parameters below are common among the different Uniswap modules contracts

    /// @notice Time weigthed average window that should be used for each Uniswap rate
    /// It is mainly going to be 5 minutes in the protocol
    uint32 public twapPeriod;

    // Role for guardians and governors
    bytes32 public constant GUARDIAN_ROLE_UNISWAP = keccak256("GUARDIAN_ROLE");

    /// @notice Gets a quote for an amount of in-currency using UniswapV3 TWAP and converts this
    /// amount to out-currency
    /// @param quoteAmount The amount to convert in the out-currency
    /// @param pool UniswapV3 pool to query
    /// @param isUniMultiplied Whether the rate corresponding to the Uniswap pool should be multiplied or divided
    /// @return The value of the `quoteAmount` expressed in out-currency
    function _readUniswapPool(
        uint256 quoteAmount,
        IUniswapV3Pool pool,
        uint8 isUniMultiplied
    ) internal view returns (uint256) {
        uint32[] memory secondAgos = new uint32[](2);

        secondAgos[0] = twapPeriod;
        secondAgos[1] = 0;

        (int56[] memory tickCumulatives, ) = pool.observe(secondAgos);
        int56 tickCumulativesDelta = tickCumulatives[1] - tickCumulatives[0];

        int24 timeWeightedAverageTick = int24(tickCumulativesDelta / int32(twapPeriod));

        // Always round to negative infinity
        if (tickCumulativesDelta < 0 && (tickCumulativesDelta % int56(int32(twapPeriod)) != 0))
            timeWeightedAverageTick--;

        // Computing the `quoteAmount` from the ticks obtained from Uniswap
        return _getQuoteAtTick(timeWeightedAverageTick, quoteAmount, isUniMultiplied);
    }

    /// @notice Changes the TWAP period
    /// @param _twapPeriod New window to compute the TWAP
    function changeTwapPeriod(uint32 _twapPeriod) external onlyRole(GUARDIAN_ROLE_UNISWAP) {
        require(int32(_twapPeriod) > 0, "99");
        twapPeriod = _twapPeriod;
    }
}

File 23 of 23 : OracleMath.sol
// SPDX-License-Identifier: GPL-3.0

pragma solidity ^0.8.7;

import "../external/FullMath.sol";

/// @title OracleMath
/// @author Forked and adapted by Angle Core Team from https://github.com/Uniswap/uniswap-v3-core/blob/main/contracts/libraries/TickMath.sol
/// @notice Math library for computing prices from ticks
/// @dev Computes price for ticks of size 1.0001, i.e. sqrt(1.0001^tick). Supports
/// prices between 2**-128 and 2**128
contract OracleMath is FullMath {
    /// @dev Maximum tick that may be passed to `_getSqrtRatioAtTick` computed from log base 1.0001 of 2**128
    int24 internal constant _MAX_TICK = 887272;

    /// @notice Given a tick and a token amount, calculates the amount of token received in exchange
    /// @param tick Tick value used to calculate the quote
    /// @param baseAmount Amount of token to be converted
    /// @param multiply Boolean representing whether the `baseToken` has a lower address than the `quoteToken`
    /// @return quoteAmount Amount of `quoteToken` received for `baseAmount` of `baseToken`
    function _getQuoteAtTick(
        int24 tick,
        uint256 baseAmount,
        uint256 multiply
    ) internal pure returns (uint256 quoteAmount) {
        uint256 ratio = _getRatioAtTick(tick);

        quoteAmount = (multiply == 1) ? _mulDiv(ratio, baseAmount, 1e18) : _mulDiv(1e18, baseAmount, ratio);
    }

    /// @notice Calculates 1.0001^tick * in out ERC20 decimals
    /// @dev Adapted from Uniswap `_getSqrtRatioAtTick` but we don't consider the square root
    /// anymore but directly the full rate
    /// @dev Throws if `|tick| > max tick`
    /// @param tick The input tick for the above formula
    /// @return rate uint256 representing the ratio of the two assets `(token1/token0) * 10**decimals(token1)`
    /// at the given tick
    function _getRatioAtTick(int24 tick) internal pure returns (uint256 rate) {
        uint256 absTick = tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick));
        require(absTick <= uint256(int256(_MAX_TICK)), "T");

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

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

        // We need to modify the 96 decimal to be able to convert it to a D256
        // 2**59 ~ 10**18 (thus we guarantee the same precision) and 128-59 = 69
        // We retrieve a Q128.59 decimal. --> we have 69 bits free to reach the uint256 limit.
        // Now, 2**69 >> 10**18 so we are safe in the Decimal conversion.

        uint256 price = uint256((ratio >> 69) + (ratio % (1 << 69) == 0 ? 0 : 1));
        rate = ((price * 1e18) >> 59);
    }
}

Settings
{
  "evmVersion": "london",
  "libraries": {},
  "metadata": {
    "bytecodeHash": "ipfs",
    "useLiteralContent": true
  },
  "optimizer": {
    "enabled": true,
    "runs": 1000000
  },
  "remappings": [],
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address[]","name":"addressInAndOutUni","type":"address[]"},{"internalType":"contract IUniswapV3Pool[]","name":"_circuitUniswap","type":"address[]"},{"internalType":"uint8[]","name":"_circuitUniIsMultiplied","type":"uint8[]"},{"internalType":"uint32","name":"_twapPeriod","type":"uint32"},{"internalType":"uint16","name":"observationLength","type":"uint16"},{"internalType":"uint8","name":"_uniFinalCurrency","type":"uint8"},{"internalType":"address[]","name":"_circuitChainlink","type":"address[]"},{"internalType":"uint8[]","name":"_circuitChainIsMultiplied","type":"uint8[]"},{"internalType":"uint32","name":"stalePeriod","type":"uint32"},{"internalType":"address[]","name":"guardians","type":"address[]"},{"internalType":"bytes32","name":"_description","type":"bytes32"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"inputs":[],"name":"BASE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"GUARDIAN_ROLE_CHAINLINK","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"GUARDIAN_ROLE_UNISWAP","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"chainlinkDecimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_stalePeriod","type":"uint32"}],"name":"changeStalePeriod","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_twapPeriod","type":"uint32"}],"name":"changeTwapPeriod","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"circuitChainIsMultiplied","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"circuitChainlink","outputs":[{"internalType":"contract AggregatorV3Interface","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"circuitUniIsMultiplied","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"circuitUniswap","outputs":[{"internalType":"contract IUniswapV3Pool","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"description","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"inBase","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"newLengthStored","type":"uint16"}],"name":"increaseTWAPStore","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"outBase","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"read","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"readAll","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"readLower","outputs":[{"internalType":"uint256","name":"rate","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"quoteAmount","type":"uint256"}],"name":"readQuote","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"quoteAmount","type":"uint256"}],"name":"readQuoteLower","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"readUpper","outputs":[{"internalType":"uint256","name":"rate","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stalePeriod","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"twapPeriod","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"uniFinalCurrency","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"}]

60c06040523480156200001157600080fd5b50604051620033ae380380620033ae833981016040819052620000349162000b82565b898989898589898989600084519050600081116200007f5760405162461bcd60e51b815260206004820152600360248201526218981b60e91b60448201526064015b60405180910390fd5b83518114620000b75760405162461bcd60e51b81526020600482015260036024820152620c4c0d60ea1b604482015260640162000076565b6000825111620000f05760405162461bcd60e51b815260206004820152600360248201526231303160e81b604482015260640162000076565b60005b8251811015620001b45760006001600160a01b03168382815181106200011d576200011d62000ec0565b60200260200101516001600160a01b03161415620001625760405162461bcd60e51b81526020600482015260016024820152600360fc1b604482015260640162000076565b6200019f6000805160206200338e8339815191528483815181106200018b576200018b62000ec0565b6020026020010151620007a560201b60201c565b80620001ab8162000e8c565b915050620000f3565b50620001d06000805160206200338e83398151915280620007b5565b60005b818110156200030c576000868281518110620001f357620001f362000ec0565b6020908102919091018101516004805460018101825560008290527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b0180546001600160a01b0319166001600160a01b0384169081179091556040805163313ce56760e01b81529051939550600694919363313ce567938281019392829003018186803b1580156200028457600080fd5b505afa15801562000299573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620002bf919062000d06565b81546001810183556000928352602092839020928104909201805460ff928316601f9094166101000a93840292909302199092161790555080620003038162000e8c565b915050620001d3565b506003805463ffffffff191663ffffffff8516179055835162000337906005906020870190620008c0565b5050505050506000815111620003765760405162461bcd60e51b815260206004820152600360248201526231303160e81b604482015260640162000076565b60005b8151811015620004265760006001600160a01b0316828281518110620003a357620003a362000ec0565b60200260200101516001600160a01b03161415620003e85760405162461bcd60e51b81526020600482015260016024820152600360fc1b604482015260640162000076565b620004116000805160206200338e8339815191528383815181106200018b576200018b62000ec0565b806200041d8162000e8c565b91505062000379565b50620004426000805160206200338e83398151915280620007b5565b60008360030b136200047d5760405162461bcd60e51b815260206004820152600360248201526218981960e91b604482015260640162000076565b845180620004b45760405162461bcd60e51b815260206004820152600360248201526231303360e81b604482015260640162000076565b84518114620004ec5760405162461bcd60e51b81526020600482015260036024820152620c4c0d60ea1b604482015260640162000076565b6007805463ffffffff191663ffffffff86161790558551620005169060089060208901906200096d565b5084516200052c906009906020880190620008c0565b5060005b81811015620005d157600881815481106200054f576200054f62000ec0565b6000918252602090912001546040516332148f6760e01b815261ffff861660048201526001600160a01b03909116906332148f6790602401600060405180830381600087803b158015620005a257600080fd5b505af1158015620005b7573d6000803e3d6000fd5b505050508080620005c89062000e8c565b91505062000530565b505050505050508a51600214620006115760405162461bcd60e51b815260206004820152600360248201526231303760e81b604482015260640162000076565b60008b60008151811062000629576200062962000ec0565b6020026020010151905060008c6001815181106200064b576200064b62000ec0565b60200260200101519050816001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156200068f57600080fd5b505afa158015620006a4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620006ca919062000d06565b620006d790600a62000dcd565b600081905550806001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156200071757600080fd5b505afa1580156200072c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000752919062000d06565b6200075f90600a62000dcd565b60a052505060f89590951b7fff00000000000000000000000000000000000000000000000000000000000000166080525050506001919091555062000f05945050505050565b620007b1828262000809565b5050565b600082815260026020526040902060010154819060405184907fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff90600090a460009182526002602052604090912060010155565b62000815828262000893565b620007b15760008281526002602090815260408083206001600160a01b03851684529091529020805460ff191660011790556200084f3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008281526002602090815260408083206001600160a01b038516845290915290205460ff165b92915050565b82805482825590600052602060002090601f016020900481019282156200095b5791602002820160005b838211156200092a57835183826101000a81548160ff021916908360ff1602179055509260200192600101602081600001049283019260010302620008ea565b8015620009595782816101000a81549060ff02191690556001016020816000010492830192600103026200092a565b505b5062000969929150620009c5565b5090565b8280548282559060005260206000209081019282156200095b579160200282015b828111156200095b57825182546001600160a01b0319166001600160a01b039091161782556020909201916001909101906200098e565b5b80821115620009695760008155600101620009c6565b600082601f830112620009ee57600080fd5b8151602062000a0762000a018362000d5e565b62000d2b565b80838252828201915082860187848660051b890101111562000a2857600080fd5b60005b8581101562000a5457815162000a418162000eec565b8452928401929084019060010162000a2b565b5090979650505050505050565b600082601f83011262000a7357600080fd5b8151602062000a8662000a018362000d5e565b80838252828201915082860187848660051b890101111562000aa757600080fd5b60005b8581101562000a5457815162000ac08162000eec565b8452928401929084019060010162000aaa565b600082601f83011262000ae557600080fd5b8151602062000af862000a018362000d5e565b80838252828201915082860187848660051b890101111562000b1957600080fd5b60005b8581101562000a545762000b308262000b70565b8452928401929084019060010162000b1c565b805161ffff8116811462000b5657600080fd5b919050565b805163ffffffff8116811462000b5657600080fd5b805160ff8116811462000b5657600080fd5b60008060008060008060008060008060006101608c8e03121562000ba557600080fd5b8b516001600160401b0381111562000bbc57600080fd5b62000bca8e828f01620009dc565b60208e0151909c5090506001600160401b0381111562000be957600080fd5b62000bf78e828f0162000a61565b60408e0151909b5090506001600160401b0381111562000c1657600080fd5b62000c248e828f0162000ad3565b99505062000c3560608d0162000b5b565b975062000c4560808d0162000b43565b965062000c5560a08d0162000b70565b60c08d01519096506001600160401b0381111562000c7257600080fd5b62000c808e828f01620009dc565b60e08e015190965090506001600160401b0381111562000c9f57600080fd5b62000cad8e828f0162000ad3565b94505062000cbf6101008d0162000b5b565b6101208d01519093506001600160401b0381111562000cdd57600080fd5b62000ceb8e828f01620009dc565b9250506101408c015190509295989b509295989b9093969950565b60006020828403121562000d1957600080fd5b62000d248262000b70565b9392505050565b604051601f8201601f191681016001600160401b038111828210171562000d565762000d5662000ed6565b604052919050565b60006001600160401b0382111562000d7a5762000d7a62000ed6565b5060051b60200190565b600181815b8085111562000dc557816000190482111562000da95762000da962000eaa565b8085161562000db757918102915b93841c939080029062000d89565b509250929050565b600062000d2460ff84168360008262000de957506001620008ba565b8162000df857506000620008ba565b816001811462000e11576002811462000e1c5762000e3c565b6001915050620008ba565b60ff84111562000e305762000e3062000eaa565b50506001821b620008ba565b5060208310610133831016604e8410600b841016171562000e61575081810a620008ba565b62000e6d838362000d84565b806000190482111562000e845762000e8462000eaa565b029392505050565b600060001982141562000ea35762000ea362000eaa565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811462000f0257600080fd5b50565b60805160f81c60a05161244462000f4a60003960008181610213015281816108880152610ad6015260008181610466015281816108c90152610b4b01526124446000f3fe608060405234801561001057600080fd5b50600436106101cf5760003560e01c806391d1485411610104578063b31dbb9f116100a2578063dbda63de11610071578063dbda63de1461043f578063ec342ad014610452578063ee32d64114610461578063f62073261461048857600080fd5b8063b31dbb9f146103ce578063cf330c26146103e1578063d547741f14610419578063d74febcb1461042c57600080fd5b80639e0a8500116100de5780639e0a85001461038e578063a217fddf146103a1578063a47b5a7c146101d4578063a5b36a36146103a957600080fd5b806391d148541461032757806392611e331461037d5780639aefb5c31461038557600080fd5b806336568abe1161017157806357de26a41161014b57806357de26a4146102f0578063630914d1146102f857806365cf10b61461030b5780637284e4161461031e57600080fd5b806336568abe146102b857806341f654f7146102cb578063442133bd146102e857600080fd5b8063248a9ca3116101ad578063248a9ca3146102485780632b271dde1461026b5780632f2ff15d146102905780633593ba7b146102a557600080fd5b80630942d09a146101d457806322834baa1461020e578063240fd5ab14610235575b600080fd5b6101fb7f55435dd261a4b9b3364963f7738a7a662ad9c84396d64be3365284bb7f0a504181565b6040519081526020015b60405180910390f35b6101fb7f000000000000000000000000000000000000000000000000000000000000000081565b6101fb610243366004611ccd565b610498565b6101fb610256366004611ccd565b60009081526002602052604090206001015490565b61027e610279366004611ccd565b6104a9565b60405160ff9091168152602001610205565b6102a361029e366004611ce6565b6104dd565b005b6101fb6102b3366004611ccd565b610508565b6102a36102c6366004611ce6565b61051c565b6102d36105ae565b60408051928352602083019190915201610205565b6101fb6105c4565b6101fb6105d1565b6102a3610306366004611d3a565b6105e3565b6102a3610319366004611d16565b610646565b6101fb60015481565b61036d610335366004611ce6565b600091825260026020908152604080842073ffffffffffffffffffffffffffffffffffffffff93909316845291905290205460ff1690565b6040519015158152602001610205565b6101fb610709565b6101fb60005481565b61027e61039c366004611ccd565b61071c565b6101fb600081565b6003546103b99063ffffffff1681565b60405163ffffffff9091168152602001610205565b6102a36103dc366004611d3a565b61072c565b6103f46103ef366004611ccd565b6107fc565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610205565b6102a3610427366004611ce6565b610833565b6103f461043a366004611ccd565b610859565b61027e61044d366004611ccd565b610869565b6101fb670de0b6b3a764000081565b61027e7f000000000000000000000000000000000000000000000000000000000000000081565b6007546103b99063ffffffff1681565b60006104a382610879565b92915050565b600981815481106104b957600080fd5b9060005260206000209060209182820401919006915054906101000a900460ff1681565b6000828152600260205260409020600101546104f981336108fe565b61050383836109d0565b505050565b60008061051483610ac4565b509392505050565b73ffffffffffffffffffffffffffffffffffffffff811633146105a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600260248201527f373100000000000000000000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b6105aa8282610c0d565b5050565b6000806105bc600054610ac4565b915091509091565b60006104a3600054610ac4565b60006105de600054610879565b905090565b7f55435dd261a4b9b3364963f7738a7a662ad9c84396d64be3365284bb7f0a504161060e81336108fe565b50600380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff92909216919091179055565b60005b6008548110156105aa57600881815481106106665761066661238b565b6000918252602090912001546040517f32148f6700000000000000000000000000000000000000000000000000000000815261ffff8416600482015273ffffffffffffffffffffffffffffffffffffffff909116906332148f6790602401600060405180830381600087803b1580156106de57600080fd5b505af11580156106f2573d6000803e3d6000fd5b50505050808061070190612285565b915050610649565b6000610716600054610ac4565b50919050565b600581815481106104b957600080fd5b7f55435dd261a4b9b3364963f7738a7a662ad9c84396d64be3365284bb7f0a504161075781336108fe565b60008260030b136107c4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600260248201527f39390000000000000000000000000000000000000000000000000000000000006044820152606401610597565b50600780547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff92909216919091179055565b6004818154811061080c57600080fd5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b60008281526002602052604090206001015461084f81336108fe565b6105038383610c0d565b6008818154811061080c57600080fd5b600681815481106104b957600080fd5b600061088482610cc8565b90507f00000000000000000000000000000000000000000000000000000000000000006108b9670de0b6b3a764000083612106565b6108c39190611fcb565b905060ff7f000000000000000000000000000000000000000000000000000000000000000016156108f9576104a3600082610d66565b919050565b600082815260026020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff166105aa576109568173ffffffffffffffffffffffffffffffffffffffff166014610e2e565b610961836020610e2e565b604051602001610972929190611db0565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290527f08c379a000000000000000000000000000000000000000000000000000000000825261059791600401611e7b565b600082815260026020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff166105aa57600082815260026020908152604080832073ffffffffffffffffffffffffffffffffffffffff85168452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055610a663390565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000806000610ad284610cc8565b90507f0000000000000000000000000000000000000000000000000000000000000000610b07670de0b6b3a764000083612106565b610b119190611fcb565b905060008054670de0b6b3a764000086610b2b9190612106565b610b359190611fcb565b90506000610b4282611078565b909250905060ff7f00000000000000000000000000000000000000000000000000000000000000001615610b7d57610b7a8184610d66565b92505b610ba781600054670de0b6b3a764000089610b989190612106565b610ba29190611fcb565b610d66565b9050828211610bde57818111610bc257959194509092505050565b808311610bd457909590945092505050565b5094909350915050565b828111610bef579590945092505050565b808211610c025791959194509092505050565b509094909350915050565b600082815260026020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16156105aa57600082815260026020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000805b600854811015610d5f57610d4b8360088381548110610ced57610ced61238b565b6000918252602090912001546009805473ffffffffffffffffffffffffffffffffffffffff9092169185908110610d2657610d2661238b565b90600052602060002090602091828204019190069054906101000a900460ff1661114d565b925080610d5781612285565b915050610ccc565b5090919050565b6004546000908190610d7a906001906121ab565b9050610e258360048381548110610d9357610d9361238b565b6000918252602090912001546005805473ffffffffffffffffffffffffffffffffffffffff9092169185908110610dcc57610dcc61238b565b90600052602060002090602091828204019190069054906101000a900460ff1660068581548110610dff57610dff61238b565b60009182526020918290209181049091015460ff601f9092166101000a90041688611354565b50949350505050565b60606000610e3d836002612106565b610e48906002611f3f565b67ffffffffffffffff811115610e6057610e606123ba565b6040519080825280601f01601f191660200182016040528015610e8a576020820181803683370190505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110610ec157610ec161238b565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110610f2457610f2461238b565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000610f60846002612106565b610f6b906001611f3f565b90505b6001811115611008577f303132333435363738396162636465660000000000000000000000000000000085600f1660108110610fac57610fac61238b565b1a60f81b828281518110610fc257610fc261238b565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c9361100181612250565b9050610f6e565b508315611071576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610597565b9392505050565b60008080805b6004548110156111455761112e856004838154811061109f5761109f61238b565b6000918252602090912001546005805473ffffffffffffffffffffffffffffffffffffffff90921691859081106110d8576110d861238b565b90600052602060002090602091828204019190069054906101000a900460ff166006858154811061110b5761110b61238b565b60009182526020808320908204015460ff601f9092166101000a90041690611354565b90955091508061113d81612285565b91505061107e565b509293915050565b604080516002808252606082018352600092839291906020830190803683375050600754825192935063ffffffff169183915060009061118f5761118f61238b565b602002602001019063ffffffff16908163ffffffff16815250506000816001815181106111be576111be61238b565b63ffffffff909216602092830291909101909101526040517f883bdbfd00000000000000000000000000000000000000000000000000000000815260009073ffffffffffffffffffffffffffffffffffffffff86169063883bdbfd90611228908590600401611e31565b60006040518083038186803b15801561124057600080fd5b505afa158015611254573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820160405261129a9190810190611bfb565b5090506000816000815181106112b2576112b261238b565b6020026020010151826001815181106112cd576112cd61238b565b60200260200101516112df9190612143565b6007549091506000906112fb9063ffffffff1660030b83611f57565b905060008260060b12801561132757506007546113219063ffffffff1660030b836122be565b60060b15155b1561133a5780611336816121f2565b9150505b61134881898860ff166114fc565b98975050505050505050565b6000808261149b576000806000808973ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b1580156113a857600080fd5b505afa1580156113bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113e09190611d60565b94509450509350935060008313801561141157508069ffffffffffffffffffff168469ffffffffffffffffffff1611155b801561142e575060035463ffffffff1661142b83426121ab565b11155b611494576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600360248201527f31303000000000000000000000000000000000000000000000000000000000006044820152606401610597565b5090945050505b8460ff16600114156114cd576114b284600a612040565b6114bc8489612106565b6114c69190611fcb565b96506114f0565b826114d985600a612040565b6114e39089612106565b6114ed9190611fcb565b96505b50949590945092505050565b60008061150885611546565b90508260011461152a57611525670de0b6b3a764000085836119ce565b61153d565b61153d8185670de0b6b3a76400006119ce565b95945050505050565b60008060008360020b1261155d578260020b61156a565b8260020b61156a906122f4565b9050620d89e88111156115d9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600160248201527f54000000000000000000000000000000000000000000000000000000000000006044820152606401610597565b6000600182166115fa5770010000000000000000000000000000000061160c565b6ffff97272373d413259a46990580e213a5b70ffffffffffffffffffffffffffffffffff169050600282161561164b576080611646826ffff2e50f5f656932ef12357cf3c7fdcc612106565b901c90505b6004821615611675576080611670826fffe5caca7e10e4e61c3624eaa0941cd0612106565b901c90505b600882161561169f57608061169a826fffcb9843d60f6159c9db58835c926644612106565b901c90505b60108216156116c95760806116c4826fff973b41fa98c081472e6896dfb254c0612106565b901c90505b60208216156116f35760806116ee826fff2ea16466c96a3843ec78b326b52861612106565b901c90505b604082161561171d576080611718826ffe5dee046a99a2a811c461f1969c3053612106565b901c90505b6080821615611747576080611742826ffcbe86c7900a88aedcffc83b479aa3a4612106565b901c90505b61010082161561177257608061176d826ff987a7253ac413176f2b074cf7815e54612106565b901c90505b61020082161561179d576080611798826ff3392b0822b70005940c7a398e4b70f3612106565b901c90505b6104008216156117c85760806117c3826fe7159475a2c29b7443b29c7fa6e889d9612106565b901c90505b6108008216156117f35760806117ee826fd097f3bdfd2022b8845ad8f792aa5825612106565b901c90505b61100082161561181e576080611819826fa9f746462d870fdf8a65dc1f90e061e5612106565b901c90505b612000821615611849576080611844826f70d869a156d2a1b890bb3df62baf32f7612106565b901c90505b61400082161561187457608061186f826f31be135f97d08fd981231505542fcfa6612106565b901c90505b61800082161561189f57608061189a826f09aa508b5b7a84e1c677de54f3e99bc9612106565b901c90505b620100008216156118ca5760806118c5826e5d6af8dedb81196699c329225ee604612106565b901c90505b620200008216156118f45760806118ef826d2216e584f5fa1ea926041bedfe98612106565b901c90505b6204000082161561191c576080611917826b048a170391f7dc42444e8fa2612106565b901c90505b6208000082161561193f57608061193a8266149b34ee7ac262612106565b901c90505b60008460020b131561197857611975817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff611fcb565b90505b600061198d68200000000000000000836122e0565b1561199957600161199c565b60005b6119ad9060ff16604584901c611f3f565b9050603b6119c382670de0b6b3a7640000612106565b901c95945050505050565b600080807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8587098587029250828110838203039150508060001415611a265760008411611a1b57600080fd5b508290049050611071565b808411611a3257600080fd5b6000848688098084039381119092039190506000611a5286196001611f3f565b8616958690049593849004936000819003046001019050611a738184612106565b909317926000611a84876003612106565b6002189050611a938188612106565b611a9e9060026121ab565b611aa89082612106565b9050611ab48188612106565b611abf9060026121ab565b611ac99082612106565b9050611ad58188612106565b611ae09060026121ab565b611aea9082612106565b9050611af68188612106565b611b019060026121ab565b611b0b9082612106565b9050611b178188612106565b611b229060026121ab565b611b2c9082612106565b9050611b388188612106565b611b439060026121ab565b611b4d9082612106565b9050611b598186612106565b9998505050505050505050565b600082601f830112611b7757600080fd5b81516020611b8c611b8783611f1b565b611ecc565b80838252828201915082860187848660051b8901011115611bac57600080fd5b60005b85811015611bd4578151611bc2816123e9565b84529284019290840190600101611baf565b5090979650505050505050565b805169ffffffffffffffffffff811681146108f957600080fd5b60008060408385031215611c0e57600080fd5b825167ffffffffffffffff80821115611c2657600080fd5b818501915085601f830112611c3a57600080fd5b81516020611c4a611b8783611f1b565b8083825282820191508286018a848660051b8901011115611c6a57600080fd5b600096505b84871015611c9c5780518060060b8114611c8857600080fd5b835260019690960195918301918301611c6f565b5091880151919650909350505080821115611cb657600080fd5b50611cc385828601611b66565b9150509250929050565b600060208284031215611cdf57600080fd5b5035919050565b60008060408385031215611cf957600080fd5b823591506020830135611d0b816123e9565b809150509250929050565b600060208284031215611d2857600080fd5b813561ffff8116811461107157600080fd5b600060208284031215611d4c57600080fd5b813563ffffffff8116811461107157600080fd5b600080600080600060a08688031215611d7857600080fd5b611d8186611be1565b9450602086015193506040860151925060608601519150611da460808701611be1565b90509295509295909350565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611de88160178501602088016121c2565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611e258160288401602088016121c2565b01602801949350505050565b6020808252825182820181905260009190848201906040850190845b81811015611e6f57835163ffffffff1683529284019291840191600101611e4d565b50909695505050505050565b6020815260008251806020840152611e9a8160408501602087016121c2565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715611f1357611f136123ba565b604052919050565b600067ffffffffffffffff821115611f3557611f356123ba565b5060051b60200190565b60008219821115611f5257611f5261232d565b500190565b60008160060b8360060b80611f6e57611f6e61235c565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81147fffffffffffffffffffffffffffffffffffffffffffffffffff8000000000000083141615611fc257611fc261232d565b90059392505050565b600082611fda57611fda61235c565b500490565b600181815b8085111561203857817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561201e5761201e61232d565b8085161561202b57918102915b93841c9390800290611fe4565b509250929050565b60006110718383600082612056575060016104a3565b81612063575060006104a3565b816001811461207957600281146120835761209f565b60019150506104a3565b60ff8411156120945761209461232d565b50506001821b6104a3565b5060208310610133831016604e8410600b84101617156120c2575081810a6104a3565b6120cc8383611fdf565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156120fe576120fe61232d565b029392505050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561213e5761213e61232d565b500290565b60008160060b8360060b60008112817fffffffffffffffffffffffffffffffffffffffffffffffffff80000000000000018312811516156121865761218661232d565b81667fffffffffffff0183138116156121a1576121a161232d565b5090039392505050565b6000828210156121bd576121bd61232d565b500390565b60005b838110156121dd5781810151838201526020016121c5565b838111156121ec576000848401525b50505050565b60008160020b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8000008114156122285761222861232d565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0192915050565b60008161225f5761225f61232d565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156122b7576122b761232d565b5060010190565b60008260060b806122d1576122d161235c565b808360060b0791505092915050565b6000826122ef576122ef61235c565b500690565b60007f80000000000000000000000000000000000000000000000000000000000000008214156123265761232661232d565b5060000390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff8116811461240b57600080fd5b5056fea2646970667358221220e4bfaf7a2cd61ea210dc3538e644479d8af4725d9058b091295e87a977e8e39c64736f6c6343000807003355435dd261a4b9b3364963f7738a7a662ad9c84396d64be3365284bb7f0a5041000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001c000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000258000000000000000000000000000000000000000000000000000000000000004b0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000151800000000000000000000000000000000000000000000000000000000000000300db5edb608d16d29bb74f5a58662bec76f5de4a8b1b888f1adfcbfa5752f7039d0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000956f47f50a910163d8bf957cf5846d573e7f87ca000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000000000000000000000000000000000000000000010000000000000000000000008c54aa2a32a779e6f6fbea568ad85a19e0109c2600000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000200000000000000000000000031e0a88fecb6ec0a411dbe0e9e76391498296ee9000000000000000000000000b49f677943bc038e9857d61e7d053caa2c1734c100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000005183f032bf42109cd370b9559fd22207e432301e0000000000000000000000000c2553e4b9dfa9f83b1a6d3eab96c4baab42d430

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101cf5760003560e01c806391d1485411610104578063b31dbb9f116100a2578063dbda63de11610071578063dbda63de1461043f578063ec342ad014610452578063ee32d64114610461578063f62073261461048857600080fd5b8063b31dbb9f146103ce578063cf330c26146103e1578063d547741f14610419578063d74febcb1461042c57600080fd5b80639e0a8500116100de5780639e0a85001461038e578063a217fddf146103a1578063a47b5a7c146101d4578063a5b36a36146103a957600080fd5b806391d148541461032757806392611e331461037d5780639aefb5c31461038557600080fd5b806336568abe1161017157806357de26a41161014b57806357de26a4146102f0578063630914d1146102f857806365cf10b61461030b5780637284e4161461031e57600080fd5b806336568abe146102b857806341f654f7146102cb578063442133bd146102e857600080fd5b8063248a9ca3116101ad578063248a9ca3146102485780632b271dde1461026b5780632f2ff15d146102905780633593ba7b146102a557600080fd5b80630942d09a146101d457806322834baa1461020e578063240fd5ab14610235575b600080fd5b6101fb7f55435dd261a4b9b3364963f7738a7a662ad9c84396d64be3365284bb7f0a504181565b6040519081526020015b60405180910390f35b6101fb7f00000000000000000000000000000000000000000000000000000000000f424081565b6101fb610243366004611ccd565b610498565b6101fb610256366004611ccd565b60009081526002602052604090206001015490565b61027e610279366004611ccd565b6104a9565b60405160ff9091168152602001610205565b6102a361029e366004611ce6565b6104dd565b005b6101fb6102b3366004611ccd565b610508565b6102a36102c6366004611ce6565b61051c565b6102d36105ae565b60408051928352602083019190915201610205565b6101fb6105c4565b6101fb6105d1565b6102a3610306366004611d3a565b6105e3565b6102a3610319366004611d16565b610646565b6101fb60015481565b61036d610335366004611ce6565b600091825260026020908152604080842073ffffffffffffffffffffffffffffffffffffffff93909316845291905290205460ff1690565b6040519015158152602001610205565b6101fb610709565b6101fb60005481565b61027e61039c366004611ccd565b61071c565b6101fb600081565b6003546103b99063ffffffff1681565b60405163ffffffff9091168152602001610205565b6102a36103dc366004611d3a565b61072c565b6103f46103ef366004611ccd565b6107fc565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610205565b6102a3610427366004611ce6565b610833565b6103f461043a366004611ccd565b610859565b61027e61044d366004611ccd565b610869565b6101fb670de0b6b3a764000081565b61027e7f000000000000000000000000000000000000000000000000000000000000000181565b6007546103b99063ffffffff1681565b60006104a382610879565b92915050565b600981815481106104b957600080fd5b9060005260206000209060209182820401919006915054906101000a900460ff1681565b6000828152600260205260409020600101546104f981336108fe565b61050383836109d0565b505050565b60008061051483610ac4565b509392505050565b73ffffffffffffffffffffffffffffffffffffffff811633146105a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600260248201527f373100000000000000000000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b6105aa8282610c0d565b5050565b6000806105bc600054610ac4565b915091509091565b60006104a3600054610ac4565b60006105de600054610879565b905090565b7f55435dd261a4b9b3364963f7738a7a662ad9c84396d64be3365284bb7f0a504161060e81336108fe565b50600380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff92909216919091179055565b60005b6008548110156105aa57600881815481106106665761066661238b565b6000918252602090912001546040517f32148f6700000000000000000000000000000000000000000000000000000000815261ffff8416600482015273ffffffffffffffffffffffffffffffffffffffff909116906332148f6790602401600060405180830381600087803b1580156106de57600080fd5b505af11580156106f2573d6000803e3d6000fd5b50505050808061070190612285565b915050610649565b6000610716600054610ac4565b50919050565b600581815481106104b957600080fd5b7f55435dd261a4b9b3364963f7738a7a662ad9c84396d64be3365284bb7f0a504161075781336108fe565b60008260030b136107c4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600260248201527f39390000000000000000000000000000000000000000000000000000000000006044820152606401610597565b50600780547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff92909216919091179055565b6004818154811061080c57600080fd5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b60008281526002602052604090206001015461084f81336108fe565b6105038383610c0d565b6008818154811061080c57600080fd5b600681815481106104b957600080fd5b600061088482610cc8565b90507f00000000000000000000000000000000000000000000000000000000000f42406108b9670de0b6b3a764000083612106565b6108c39190611fcb565b905060ff7f000000000000000000000000000000000000000000000000000000000000000116156108f9576104a3600082610d66565b919050565b600082815260026020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff166105aa576109568173ffffffffffffffffffffffffffffffffffffffff166014610e2e565b610961836020610e2e565b604051602001610972929190611db0565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290527f08c379a000000000000000000000000000000000000000000000000000000000825261059791600401611e7b565b600082815260026020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff166105aa57600082815260026020908152604080832073ffffffffffffffffffffffffffffffffffffffff85168452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055610a663390565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000806000610ad284610cc8565b90507f00000000000000000000000000000000000000000000000000000000000f4240610b07670de0b6b3a764000083612106565b610b119190611fcb565b905060008054670de0b6b3a764000086610b2b9190612106565b610b359190611fcb565b90506000610b4282611078565b909250905060ff7f00000000000000000000000000000000000000000000000000000000000000011615610b7d57610b7a8184610d66565b92505b610ba781600054670de0b6b3a764000089610b989190612106565b610ba29190611fcb565b610d66565b9050828211610bde57818111610bc257959194509092505050565b808311610bd457909590945092505050565b5094909350915050565b828111610bef579590945092505050565b808211610c025791959194509092505050565b509094909350915050565b600082815260026020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16156105aa57600082815260026020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000805b600854811015610d5f57610d4b8360088381548110610ced57610ced61238b565b6000918252602090912001546009805473ffffffffffffffffffffffffffffffffffffffff9092169185908110610d2657610d2661238b565b90600052602060002090602091828204019190069054906101000a900460ff1661114d565b925080610d5781612285565b915050610ccc565b5090919050565b6004546000908190610d7a906001906121ab565b9050610e258360048381548110610d9357610d9361238b565b6000918252602090912001546005805473ffffffffffffffffffffffffffffffffffffffff9092169185908110610dcc57610dcc61238b565b90600052602060002090602091828204019190069054906101000a900460ff1660068581548110610dff57610dff61238b565b60009182526020918290209181049091015460ff601f9092166101000a90041688611354565b50949350505050565b60606000610e3d836002612106565b610e48906002611f3f565b67ffffffffffffffff811115610e6057610e606123ba565b6040519080825280601f01601f191660200182016040528015610e8a576020820181803683370190505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110610ec157610ec161238b565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110610f2457610f2461238b565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000610f60846002612106565b610f6b906001611f3f565b90505b6001811115611008577f303132333435363738396162636465660000000000000000000000000000000085600f1660108110610fac57610fac61238b565b1a60f81b828281518110610fc257610fc261238b565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c9361100181612250565b9050610f6e565b508315611071576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610597565b9392505050565b60008080805b6004548110156111455761112e856004838154811061109f5761109f61238b565b6000918252602090912001546005805473ffffffffffffffffffffffffffffffffffffffff90921691859081106110d8576110d861238b565b90600052602060002090602091828204019190069054906101000a900460ff166006858154811061110b5761110b61238b565b60009182526020808320908204015460ff601f9092166101000a90041690611354565b90955091508061113d81612285565b91505061107e565b509293915050565b604080516002808252606082018352600092839291906020830190803683375050600754825192935063ffffffff169183915060009061118f5761118f61238b565b602002602001019063ffffffff16908163ffffffff16815250506000816001815181106111be576111be61238b565b63ffffffff909216602092830291909101909101526040517f883bdbfd00000000000000000000000000000000000000000000000000000000815260009073ffffffffffffffffffffffffffffffffffffffff86169063883bdbfd90611228908590600401611e31565b60006040518083038186803b15801561124057600080fd5b505afa158015611254573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820160405261129a9190810190611bfb565b5090506000816000815181106112b2576112b261238b565b6020026020010151826001815181106112cd576112cd61238b565b60200260200101516112df9190612143565b6007549091506000906112fb9063ffffffff1660030b83611f57565b905060008260060b12801561132757506007546113219063ffffffff1660030b836122be565b60060b15155b1561133a5780611336816121f2565b9150505b61134881898860ff166114fc565b98975050505050505050565b6000808261149b576000806000808973ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b1580156113a857600080fd5b505afa1580156113bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113e09190611d60565b94509450509350935060008313801561141157508069ffffffffffffffffffff168469ffffffffffffffffffff1611155b801561142e575060035463ffffffff1661142b83426121ab565b11155b611494576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600360248201527f31303000000000000000000000000000000000000000000000000000000000006044820152606401610597565b5090945050505b8460ff16600114156114cd576114b284600a612040565b6114bc8489612106565b6114c69190611fcb565b96506114f0565b826114d985600a612040565b6114e39089612106565b6114ed9190611fcb565b96505b50949590945092505050565b60008061150885611546565b90508260011461152a57611525670de0b6b3a764000085836119ce565b61153d565b61153d8185670de0b6b3a76400006119ce565b95945050505050565b60008060008360020b1261155d578260020b61156a565b8260020b61156a906122f4565b9050620d89e88111156115d9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600160248201527f54000000000000000000000000000000000000000000000000000000000000006044820152606401610597565b6000600182166115fa5770010000000000000000000000000000000061160c565b6ffff97272373d413259a46990580e213a5b70ffffffffffffffffffffffffffffffffff169050600282161561164b576080611646826ffff2e50f5f656932ef12357cf3c7fdcc612106565b901c90505b6004821615611675576080611670826fffe5caca7e10e4e61c3624eaa0941cd0612106565b901c90505b600882161561169f57608061169a826fffcb9843d60f6159c9db58835c926644612106565b901c90505b60108216156116c95760806116c4826fff973b41fa98c081472e6896dfb254c0612106565b901c90505b60208216156116f35760806116ee826fff2ea16466c96a3843ec78b326b52861612106565b901c90505b604082161561171d576080611718826ffe5dee046a99a2a811c461f1969c3053612106565b901c90505b6080821615611747576080611742826ffcbe86c7900a88aedcffc83b479aa3a4612106565b901c90505b61010082161561177257608061176d826ff987a7253ac413176f2b074cf7815e54612106565b901c90505b61020082161561179d576080611798826ff3392b0822b70005940c7a398e4b70f3612106565b901c90505b6104008216156117c85760806117c3826fe7159475a2c29b7443b29c7fa6e889d9612106565b901c90505b6108008216156117f35760806117ee826fd097f3bdfd2022b8845ad8f792aa5825612106565b901c90505b61100082161561181e576080611819826fa9f746462d870fdf8a65dc1f90e061e5612106565b901c90505b612000821615611849576080611844826f70d869a156d2a1b890bb3df62baf32f7612106565b901c90505b61400082161561187457608061186f826f31be135f97d08fd981231505542fcfa6612106565b901c90505b61800082161561189f57608061189a826f09aa508b5b7a84e1c677de54f3e99bc9612106565b901c90505b620100008216156118ca5760806118c5826e5d6af8dedb81196699c329225ee604612106565b901c90505b620200008216156118f45760806118ef826d2216e584f5fa1ea926041bedfe98612106565b901c90505b6204000082161561191c576080611917826b048a170391f7dc42444e8fa2612106565b901c90505b6208000082161561193f57608061193a8266149b34ee7ac262612106565b901c90505b60008460020b131561197857611975817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff611fcb565b90505b600061198d68200000000000000000836122e0565b1561199957600161199c565b60005b6119ad9060ff16604584901c611f3f565b9050603b6119c382670de0b6b3a7640000612106565b901c95945050505050565b600080807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8587098587029250828110838203039150508060001415611a265760008411611a1b57600080fd5b508290049050611071565b808411611a3257600080fd5b6000848688098084039381119092039190506000611a5286196001611f3f565b8616958690049593849004936000819003046001019050611a738184612106565b909317926000611a84876003612106565b6002189050611a938188612106565b611a9e9060026121ab565b611aa89082612106565b9050611ab48188612106565b611abf9060026121ab565b611ac99082612106565b9050611ad58188612106565b611ae09060026121ab565b611aea9082612106565b9050611af68188612106565b611b019060026121ab565b611b0b9082612106565b9050611b178188612106565b611b229060026121ab565b611b2c9082612106565b9050611b388188612106565b611b439060026121ab565b611b4d9082612106565b9050611b598186612106565b9998505050505050505050565b600082601f830112611b7757600080fd5b81516020611b8c611b8783611f1b565b611ecc565b80838252828201915082860187848660051b8901011115611bac57600080fd5b60005b85811015611bd4578151611bc2816123e9565b84529284019290840190600101611baf565b5090979650505050505050565b805169ffffffffffffffffffff811681146108f957600080fd5b60008060408385031215611c0e57600080fd5b825167ffffffffffffffff80821115611c2657600080fd5b818501915085601f830112611c3a57600080fd5b81516020611c4a611b8783611f1b565b8083825282820191508286018a848660051b8901011115611c6a57600080fd5b600096505b84871015611c9c5780518060060b8114611c8857600080fd5b835260019690960195918301918301611c6f565b5091880151919650909350505080821115611cb657600080fd5b50611cc385828601611b66565b9150509250929050565b600060208284031215611cdf57600080fd5b5035919050565b60008060408385031215611cf957600080fd5b823591506020830135611d0b816123e9565b809150509250929050565b600060208284031215611d2857600080fd5b813561ffff8116811461107157600080fd5b600060208284031215611d4c57600080fd5b813563ffffffff8116811461107157600080fd5b600080600080600060a08688031215611d7857600080fd5b611d8186611be1565b9450602086015193506040860151925060608601519150611da460808701611be1565b90509295509295909350565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611de88160178501602088016121c2565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611e258160288401602088016121c2565b01602801949350505050565b6020808252825182820181905260009190848201906040850190845b81811015611e6f57835163ffffffff1683529284019291840191600101611e4d565b50909695505050505050565b6020815260008251806020840152611e9a8160408501602087016121c2565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715611f1357611f136123ba565b604052919050565b600067ffffffffffffffff821115611f3557611f356123ba565b5060051b60200190565b60008219821115611f5257611f5261232d565b500190565b60008160060b8360060b80611f6e57611f6e61235c565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81147fffffffffffffffffffffffffffffffffffffffffffffffffff8000000000000083141615611fc257611fc261232d565b90059392505050565b600082611fda57611fda61235c565b500490565b600181815b8085111561203857817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561201e5761201e61232d565b8085161561202b57918102915b93841c9390800290611fe4565b509250929050565b60006110718383600082612056575060016104a3565b81612063575060006104a3565b816001811461207957600281146120835761209f565b60019150506104a3565b60ff8411156120945761209461232d565b50506001821b6104a3565b5060208310610133831016604e8410600b84101617156120c2575081810a6104a3565b6120cc8383611fdf565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156120fe576120fe61232d565b029392505050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561213e5761213e61232d565b500290565b60008160060b8360060b60008112817fffffffffffffffffffffffffffffffffffffffffffffffffff80000000000000018312811516156121865761218661232d565b81667fffffffffffff0183138116156121a1576121a161232d565b5090039392505050565b6000828210156121bd576121bd61232d565b500390565b60005b838110156121dd5781810151838201526020016121c5565b838111156121ec576000848401525b50505050565b60008160020b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8000008114156122285761222861232d565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0192915050565b60008161225f5761225f61232d565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156122b7576122b761232d565b5060010190565b60008260060b806122d1576122d161235c565b808360060b0791505092915050565b6000826122ef576122ef61235c565b500690565b60007f80000000000000000000000000000000000000000000000000000000000000008214156123265761232661232d565b5060000390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff8116811461240b57600080fd5b5056fea2646970667358221220e4bfaf7a2cd61ea210dc3538e644479d8af4725d9058b091295e87a977e8e39c64736f6c63430008070033

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

000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001c000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000258000000000000000000000000000000000000000000000000000000000000004b0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000151800000000000000000000000000000000000000000000000000000000000000300db5edb608d16d29bb74f5a58662bec76f5de4a8b1b888f1adfcbfa5752f7039d0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000956f47f50a910163d8bf957cf5846d573e7f87ca000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000000000000000000000000000000000000000000010000000000000000000000008c54aa2a32a779e6f6fbea568ad85a19e0109c2600000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000200000000000000000000000031e0a88fecb6ec0a411dbe0e9e76391498296ee9000000000000000000000000b49f677943bc038e9857d61e7d053caa2c1734c100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000005183f032bf42109cd370b9559fd22207e432301e0000000000000000000000000c2553e4b9dfa9f83b1a6d3eab96c4baab42d430

-----Decoded View---------------
Arg [0] : addressInAndOutUni (address[]): 0x956F47F50A910163D8BF957Cf5846D573E7f87CA,0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
Arg [1] : _circuitUniswap (address[]): 0x8c54aA2A32a779e6f6fBea568aD85a19E0109C26
Arg [2] : _circuitUniIsMultiplied (uint8[]): 1
Arg [3] : _twapPeriod (uint32): 600
Arg [4] : observationLength (uint16): 75
Arg [5] : _uniFinalCurrency (uint8): 1
Arg [6] : _circuitChainlink (address[]): 0x31e0a88fecB6eC0a411DBe0e9E76391498296EE9,0xb49f677943BC038e9857d61E7d053CaA2C1734C1
Arg [7] : _circuitChainIsMultiplied (uint8[]): 1,0
Arg [8] : stalePeriod (uint32): 86400
Arg [9] : guardians (address[]): 0x5183f032bf42109cD370B9559FD22207e432301E,0x0C2553e4B9dFA9f83b1A6D3EAB96c4bAaB42d430
Arg [10] : _description (bytes32): 0xdb5edb608d16d29bb74f5a58662bec76f5de4a8b1b888f1adfcbfa5752f7039d

-----Encoded View---------------
27 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000160
Arg [1] : 00000000000000000000000000000000000000000000000000000000000001c0
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000200
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000258
Arg [4] : 000000000000000000000000000000000000000000000000000000000000004b
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000240
Arg [7] : 00000000000000000000000000000000000000000000000000000000000002a0
Arg [8] : 0000000000000000000000000000000000000000000000000000000000015180
Arg [9] : 0000000000000000000000000000000000000000000000000000000000000300
Arg [10] : db5edb608d16d29bb74f5a58662bec76f5de4a8b1b888f1adfcbfa5752f7039d
Arg [11] : 0000000000000000000000000000000000000000000000000000000000000002
Arg [12] : 000000000000000000000000956f47f50a910163d8bf957cf5846d573e7f87ca
Arg [13] : 000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
Arg [14] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [15] : 0000000000000000000000008c54aa2a32a779e6f6fbea568ad85a19e0109c26
Arg [16] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [17] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [18] : 0000000000000000000000000000000000000000000000000000000000000002
Arg [19] : 00000000000000000000000031e0a88fecb6ec0a411dbe0e9e76391498296ee9
Arg [20] : 000000000000000000000000b49f677943bc038e9857d61e7d053caa2c1734c1
Arg [21] : 0000000000000000000000000000000000000000000000000000000000000002
Arg [22] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [23] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [24] : 0000000000000000000000000000000000000000000000000000000000000002
Arg [25] : 0000000000000000000000005183f032bf42109cd370b9559fd22207e432301e
Arg [26] : 0000000000000000000000000c2553e4b9dfa9f83b1a6d3eab96c4baab42d430


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

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.