ETH Price: $3,058.57 (+1.14%)
Gas: 3 Gwei

Contract

0x2c9f0A53ad8Aa2EF392eEa1E02137B648df66195
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
Transfer Ownersh...178276592023-08-02 13:37:59342 days ago1690983479IN
0x2c9f0A53...48df66195
0 ETH0.0006266121.90492064
0x60c06040178276572023-08-02 13:37:35342 days ago1690983455IN
 Create: TonpoundPriceOracle
0 ETH0.0573707523.46419522

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To Value
200436302024-06-08 0:48:2331 days ago1717807703
0x2c9f0A53...48df66195
0 ETH
200436302024-06-08 0:48:2331 days ago1717807703
0x2c9f0A53...48df66195
0 ETH
200436302024-06-08 0:48:2331 days ago1717807703
0x2c9f0A53...48df66195
0 ETH
200436172024-06-08 0:45:4731 days ago1717807547
0x2c9f0A53...48df66195
0 ETH
200436172024-06-08 0:45:4731 days ago1717807547
0x2c9f0A53...48df66195
0 ETH
200436172024-06-08 0:45:4731 days ago1717807547
0x2c9f0A53...48df66195
0 ETH
199998972024-06-01 22:16:1138 days ago1717280171
0x2c9f0A53...48df66195
0 ETH
199998972024-06-01 22:16:1138 days ago1717280171
0x2c9f0A53...48df66195
0 ETH
199998972024-06-01 22:16:1138 days ago1717280171
0x2c9f0A53...48df66195
0 ETH
199998972024-06-01 22:16:1138 days ago1717280171
0x2c9f0A53...48df66195
0 ETH
199998972024-06-01 22:16:1138 days ago1717280171
0x2c9f0A53...48df66195
0 ETH
199998972024-06-01 22:16:1138 days ago1717280171
0x2c9f0A53...48df66195
0 ETH
199998972024-06-01 22:16:1138 days ago1717280171
0x2c9f0A53...48df66195
0 ETH
195957502024-04-06 9:19:5994 days ago1712395199
0x2c9f0A53...48df66195
0 ETH
195957502024-04-06 9:19:5994 days ago1712395199
0x2c9f0A53...48df66195
0 ETH
195957502024-04-06 9:19:5994 days ago1712395199
0x2c9f0A53...48df66195
0 ETH
195045382024-03-24 12:55:47107 days ago1711284947
0x2c9f0A53...48df66195
0 ETH
195045382024-03-24 12:55:47107 days ago1711284947
0x2c9f0A53...48df66195
0 ETH
195045382024-03-24 12:55:47107 days ago1711284947
0x2c9f0A53...48df66195
0 ETH
193895662024-03-08 9:31:11123 days ago1709890271
0x2c9f0A53...48df66195
0 ETH
193895662024-03-08 9:31:11123 days ago1709890271
0x2c9f0A53...48df66195
0 ETH
193895662024-03-08 9:31:11123 days ago1709890271
0x2c9f0A53...48df66195
0 ETH
193895662024-03-08 9:31:11123 days ago1709890271
0x2c9f0A53...48df66195
0 ETH
189230402024-01-02 23:43:23188 days ago1704239003
0x2c9f0A53...48df66195
0 ETH
189230402024-01-02 23:43:23188 days ago1704239003
0x2c9f0A53...48df66195
0 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
TonpoundPriceOracle

Compiler Version
v0.8.10+commit.fc410830

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 8 : TonpoundPriceOracle.sol
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity ^0.8.10;

import "./UniswapConfig.sol";
import "../ExponentialNoError.sol";
import "./interfaces/IPriceOracle.sol";
import "./interfaces/AggregatorV3Interface.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

contract TonpoundPriceOracle is ExponentialNoError, UniswapConfig, Ownable {
    
    /// @notice ChainLink Feed address by underlying address
    mapping(address => address) public chainLinkFeeds;

    mapping(address => address) public chainLinkETHFeeds;

    /// @notice ChainLink Feed decimals by underlying address
    mapping(address => uint8) public chainLinkFeedDecimals;

    /// @notice assets decimals by underlying address 
    mapping(address => uint8) public assetsDecimals;

    /// @notice chainlink price feed ETH / USD
    AggregatorV3Interface public immutable baseAssetFeed;

    /// @notice The number of wei in 1 ETH
    uint256 public constant ETH_BASE_UNIT = 1e18;

    /// @notice A common scaling factor to maintain precision
    uint256 public constant EXP_SCALE = 1e18;

    /// @notice denominator to scale price from chainlink price feed
    uint256 public immutable baseAssetFeedDenominator;

    /// @notice The time interval to for TWAP price calculation
    uint256 public twapPeriod;

    /// @notice The event emitted when the stored price is updated
    event PriceUpdated(bytes32 indexed symbolHash, uint256 price);

    /// @notice The event emitted when new PriceFeed added (updated)
    event NewFeedForAsset(address indexed asset, address oldFeed, address newFeed);

    /// @notice The event emitted when twapPeriod updated
    event NewTwapPeriod(uint256 newTwap);

    /**
     * @notice Construct a Uniswap anchored view for a set of token configurations
     * @dev Note that to avoid immature TWAPs, the system must run for at least a single twapPeriod before using.
     *      NOTE: Reported prices are set to 1 during construction. We assume that this contract will not be voted in by
     *      governance until prices have been updated through `validate` for each TokenConfig.
     * @param twapPeriod_ The time difference to calculate twap price
     */
    constructor(
        uint32 twapPeriod_,
        address baseUnderlying,
        AggregatorV3Interface baseAssetFeed_
    ) {
        require(twapPeriod_ >= 600 && twapPeriod_ < 604800, "invalid twap");
        twapPeriod = twapPeriod_;

        require(baseUnderlying != address(0), "underlying");
        baseAssetFeed = baseAssetFeed_;
        uint8 priceFeedDecimals = baseAssetFeed_.decimals();
        baseAssetFeedDenominator = 10 ** (priceFeedDecimals - 6);
        _setPriceFeedForUnderlyingInternal(baseUnderlying, address(baseAssetFeed_), priceFeedDecimals);
    }

    /// @notice Get the underlying price of a cToken asset
    /// @param cToken The cToken to get the underlying price of
    /// @return The underlying asset price mantissa (scaled by 1e(36 - assetDecimals)).
    ///         Zero means the price is unavailable.
    function getUnderlyingPrice(address cToken) public view returns (uint) {
        address asset = ICToken(cToken).underlying();
        if (hasFeedForAsset(asset)) {
            return _getOraclePriceForAssetInternal(asset);
        } else if (hasTwapForCToken(cToken)) {
            return _fetchTwapPriceForAssetInternal(cToken);
        } else {
            return 0;
        }
    }

    /// @notice Sets config to fetch underlying price
    /// @param newTwap The time interval to for TWAP price calculation
    function setTwapPeriod(uint256 newTwap) external onlyOwner {
        require(newTwap >= 600 && newTwap < 604800, "invalid twap");
        twapPeriod = newTwap;
        emit NewTwapPeriod(newTwap);
    }

    /// @notice Sets config to fetch underlying price
    /// @param cToken The address of the Compound Token
    /// @param uniswapMarket The address of the V3 pool being used as the anchor for this market
    function setTokenConfig(address cToken, address uniswapMarket) external onlyOwner {
        _setTokenConfig(cToken, uniswapMarket);
    }

    /// @notice Sets config to fetch underlying price
    /// @param cToken The array of the Compound Tokens
    /// @param uniswapMarket The array of the V3 pools being used as the anchor for this markets
    function setTokenConfigs(address[] calldata cToken, address[] calldata uniswapMarket) external onlyOwner {
            require(cToken.length == uniswapMarket.length, "invalid lengths");

        for (uint i = 0; i < cToken.length; i++) {
            _setTokenConfig(cToken[i], uniswapMarket[i]);
        }
    }

    /// @notice Fetch the underlying price of a cToken from TWAP, in the format expected by the Comptroller.
    /// @dev Implements the PriceOracle interface for Compound v2.
    /// @param cToken The cToken address for price retrieval
    /// @return Price denominated in USD for the given cToken address, in the format expected by the Comptroller.
    ///         (scaled by 1e(36 - assetDecimals))
    function _fetchTwapPriceForAssetInternal(address cToken)
        internal
        view
        returns (uint256)
    {
        TokenConfig memory config = getTokenConfigByCToken(cToken);
        uint256 anchorPrice = calculateAnchorPriceFromEthPrice(config);
        require(anchorPrice < 2**248, "Anchor too big");
        // Comptroller needs prices in the format: ${raw price} * 1e36 / baseUnit
        // The baseUnit of an asset is the amount of the smallest denomination of that asset per whole.
        // For example, the baseUnit of ETH is 1e18.
        // Since the prices in this view have 6 decimals, we must scale them by 1e(36 - 6)/baseUnit
        return FullMath.mulDiv(1e30, anchorPrice, config.baseUnit);
    }

    /// @notice Calculate the anchor price by fetching price data from the TWAP
    /// @param config TokenConfig
    /// @return anchorPrice uint
    function calculateAnchorPriceFromEthPrice(TokenConfig memory config)
        internal
        view
        returns (uint256 anchorPrice)
    {
        uint256 ethPrice = fetchEthPrice();
        anchorPrice = fetchAnchorPrice(config, ethPrice);
    }

    /// @dev Fetches the latest TWATP from the UniV3 pool oracle, over the last anchor period.
    ///      Note that the TWATP (time-weighted average tick-price) is not equivalent to the TWAP,
    ///      as ticks are logarithmic. The TWATP returned by this function will usually
    ///      be lower than the TWAP.
    function getUniswapTwap(TokenConfig memory config)
        internal
        view
        returns (uint256)
    {
        uint32 twapPeriod_ = uint32(twapPeriod);
        uint32[] memory secondsAgos = new uint32[](2);
        secondsAgos[0] = twapPeriod_;
        (int56[] memory tickCumulatives, ) = IUniswapV3Pool(
            config.uniswapMarket
        ).observe(secondsAgos);

        int56 twapPeriod__ = int56(uint56(twapPeriod_));
        int56 timeWeightedAverageTickS56 = (tickCumulatives[1] -
            tickCumulatives[0]) / twapPeriod__;
        require(
            timeWeightedAverageTickS56 >= TickMath.MIN_TICK &&
                timeWeightedAverageTickS56 <= TickMath.MAX_TICK,
            "TWAP not in range"
        );
        require(
            timeWeightedAverageTickS56 < type(int24).max,
            "timeWeightedAverageTick > max"
        );
        int24 timeWeightedAverageTick = int24(timeWeightedAverageTickS56);
        if (config.isUniswapReversed) {
            // If the reverse price is desired, inverse the tick
            // price = 1.0001^{tick}
            // (price)^{-1} = (1.0001^{tick})^{-1}
            // \frac{1}{price} = 1.0001^{-tick}
            timeWeightedAverageTick = -timeWeightedAverageTick;
        }
        uint160 sqrtPriceX96 = TickMath.getSqrtRatioAtTick(
            timeWeightedAverageTick
        );
        // Squaring the result also squares the Q96 scalar (2**96),
        // so after this mulDiv, the resulting TWAP is still in Q96 fixed precision.
        uint256 twapX96 = FullMath.mulDiv(
            sqrtPriceX96,
            sqrtPriceX96,
            FixedPoint96.Q96
        );

        // Scale up to a common precision (EXP_SCALE), then down-scale from Q96.
        return FullMath.mulDiv(EXP_SCALE, twapX96, FixedPoint96.Q96);
    }

    /// @dev Fetches the current eth/usd price from price feed, with 6 decimals of precision.
    function fetchEthPrice() internal view returns (uint256) {
        return uint256(getChainLinkPrice(baseAssetFeed)) / baseAssetFeedDenominator ;
    }

    /// @dev Fetches the current token/usd price from Uniswap, with 6 decimals of precision.
    /// @param conversionFactor 1e18 if seeking the ETH price, and a 6 decimal ETH-USDC price in the case of other assets
    function fetchAnchorPrice(
        TokenConfig memory config,
        uint256 conversionFactor
    ) internal view virtual returns (uint256) {
        // `getUniswapTwap(config)`
        //      -> TWAP between the baseUnits of Uniswap pair (scaled to 1e18)
        // `twap * config.baseUnit`
        //      -> price of 1 token relative to `baseUnit` of the other token (scaled to 1e18)
        uint256 twap = getUniswapTwap(config);

        // `unscaledPriceMantissa * config.baseUnit / EXP_SCALE`
        //      -> price of 1 token relative to baseUnit of the other token (scaled to 1)
        uint256 unscaledPriceMantissa = twap * conversionFactor;

        // Adjust twap according to the units of the non-ETH asset
        // 1. In the case of ETH, we would have to scale by 1e6 / USDC_UNITS, but since baseUnit2 is 1e6 (USDC), it cancels
        // 2. In the case of non-ETH tokens
        //  a. `getUniswapTwap(config)` handles "reversed" token pairs, so `twap` will always be Token/ETH TWAP.
        //  b. conversionFactor = ETH price * 1e6
        //      unscaledPriceMantissa = twap{token/ETH} * EXP_SCALE * conversionFactor
        //      so ->
        //      anchorPrice = (twap * tokenBaseUnit / ETH_BASE_UNIT) * ETH_price * 1e6
        //                  = twap * conversionFactor * tokenBaseUnit / ETH_BASE_UNIT
        //                  = unscaledPriceMantissa / EXP_SCALE * tokenBaseUnit / ETH_BASE_UNIT
        uint256 anchorPrice = (unscaledPriceMantissa * config.baseUnit) /
            ETH_BASE_UNIT /
            EXP_SCALE;

        return anchorPrice;
    }

    function hasTwapForCToken(address cToken) internal view returns (bool) {
        return cTokenConfig[cToken].uniswapMarket != address(0);
    }

    function hasFeedForAsset(address asset) internal view returns (bool) {
        return chainLinkFeeds[asset] != address(0);
    }

    /* ChainLink Oracles */

    function _setPriceFeedForUnderlying(address _underlying, address _chainlinkFeed, uint8 _priceFeedDecimals) onlyOwner external {
        _setPriceFeedForUnderlyingInternal(_underlying, _chainlinkFeed, _priceFeedDecimals);
    }

    function _setPriceETHFeedsForUnderlyings(address[] calldata _underlyings, address[] calldata _chainlinkFeeds) onlyOwner external {
        require(_underlyings.length == _chainlinkFeeds.length, "invalid lengths");

        for (uint i = 0; i < _underlyings.length; i++) {
            chainLinkETHFeeds[_underlyings[i]] = _chainlinkFeeds[i];
        }
    }

    function _setPriceFeedsForUnderlyings(address[] calldata _underlyings, address[] calldata _chainlinkFeeds, uint8[] calldata _priceFeedsDecimals) onlyOwner external {
        require(_underlyings.length == _chainlinkFeeds.length, "invalid lengths");
        require(_underlyings.length == _priceFeedsDecimals.length, "invalid lengths");

        for (uint i = 0; i < _underlyings.length; i++) {
            _setPriceFeedForUnderlyingInternal(_underlyings[i], _chainlinkFeeds[i], _priceFeedsDecimals[i]);
        }
    }

    function _setPriceFeedForUnderlyingInternal(address underlying, address chainlinkFeed, uint8 priceFeedDecimals) internal {
        address existingFeed = chainLinkFeeds[underlying];
        // require(existingFeed == address(0), "Cannot reassign feed");

        uint8 decimalsForAsset;

        if (underlying == address(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)) {
            decimalsForAsset = 18;
        } else {
            decimalsForAsset = IERC20(underlying).decimals();
        }

        // Update if the feed is different
        if (existingFeed != chainlinkFeed) {
            chainLinkFeeds[underlying] = chainlinkFeed;
            chainLinkFeedDecimals[underlying] = priceFeedDecimals;
            assetsDecimals[underlying] = decimalsForAsset;
            emit NewFeedForAsset(underlying, existingFeed, chainlinkFeed);
        }
    }

    /**
      * @notice Get the underlying price of a cToken asset
      * @param asset The asset (Erc20 or native)
      * @return The asset price mantissa (scaled by 1e(36 - assetDecimals)).
      *  Zero means the price is unavailable.
      */
    function _getOraclePriceForAssetInternal(address asset) internal view returns (uint) {
        uint8 feedDecimals = chainLinkFeedDecimals[asset];
        uint8 assetDecimals = assetsDecimals[asset];
        address feed = chainLinkFeeds[asset];
        int feedPriceRaw = getChainLinkPrice(AggregatorV3Interface(feed));
        uint feedPrice = uint(feedPriceRaw);

        // Safety
        require(feedPriceRaw == int(feedPrice), "Price Conversion error");

        if (feed == chainLinkETHFeeds[asset]) {
            feedPrice = feedPrice * fetchEthPrice() / 1e6;
        }

        // Needs to be scaled to e36 and then divided by the asset's decimals
        if (feedDecimals == 8) {
            return (1e28 * feedPrice) / (10 ** assetDecimals);
        } else if (feedDecimals == 18) {
            return (1e18 * feedPrice) / (10 ** assetDecimals);
        } else {
            return 0;
        }
    }

    function getChainLinkPrice(AggregatorV3Interface priceFeed) internal view returns (int) {
        (
        uint80 roundID,
        int price,
        uint startedAt,
        uint timeStamp,
        uint80 answeredInRound
        ) = priceFeed.latestRoundData();
        return price;
    }

    /// @notice         Evaluates input amount according to stored price, accrues interest
    /// @param cToken   Market to evaluate
    /// @param amount   Amount of tokens to evaluate according to 'reverse' order
    /// @param reverse  Order of evaluation
    /// @return         Depending on 'reverse' order:
    ///                     false - return USD amount equal to 'amount' of 'cToken' in wei
    ///                     true - return cTokens equal to 'amount' of USD represented in wei
    ///                            e.g. 123e18 = 123.00$
    function getEvaluation(address cToken, uint256 amount, bool reverse) external returns (uint256) {
        Exp memory exchangeRate = Exp({mantissa: ICToken(cToken).exchangeRateCurrent()});
        uint256 oraclePriceMantissa = getUnderlyingPrice(cToken);        
        require(oraclePriceMantissa != 0, "invalid price");
        Exp memory oraclePrice = Exp({mantissa: oraclePriceMantissa});

        if (reverse) {
            // input: 'amount' in USD scaled in 1e18, i.e. 19.54$ = 19540000000000000000
            // tokenAmount = amountUSD / oraclePrice 
            // cTokenAmount = tokenAmount / exchangeRate
            uint256 tokenAmount = div_(amount, oraclePrice);
            uint256 cTokenAmount =  div_(tokenAmount, exchangeRate);
            return cTokenAmount; 
        }
        // underlyingAmount = exchangeRate * cTokenAmount
        // underlyingAmountUSD = underlyingAmount * oraclePrice
        uint256 underlyingAmount = mul_ScalarTruncate(exchangeRate, amount);
        uint256 underlyingAmountUSD = mul_ScalarTruncate(oraclePrice, underlyingAmount);
        return underlyingAmountUSD;
    }


    /// @notice         Evaluates input amount according to stored price, doesn't accrue interest
    /// @param cToken   Market to evaluate
    /// @param amount   Amount of tokens to evaluate according to 'reverse' order
    /// @param reverse  Order of evaluation
    /// @return         Depending on 'reverse' order:
    ///                     false - return USD amount equal to 'amount' of 'cToken' in wei
    ///                     true - return cTokens equal to 'amount' of USD represented in wei
    ///                            e.g. 123e18 = 123.00$
    function getEvaluationStored(address cToken, uint256 amount, bool reverse) external view returns (uint256) {
        Exp memory exchangeRate = Exp({mantissa: ICToken(cToken).exchangeRateStored()});
        // uint256 underlyingDecimals = IERC20(cToken.underlying()).decimals();
        uint256 oraclePriceMantissa = getUnderlyingPrice(cToken);
        require(oraclePriceMantissa != 0, "invalid price");
        Exp memory oraclePrice = Exp({mantissa: oraclePriceMantissa});

        if (reverse) {
            // input: 'amount' in USD scaled in 1e18, i.e. 19.54$ = 19540000000000000000
            // tokenAmount = amountUSD / oraclePrice 
            // cTokenAmount = tokenAmount / exchangeRate
            uint256 tokenAmount = div_(amount, oraclePrice);
            uint256 cTokenAmount =  div_(tokenAmount, exchangeRate);
            return cTokenAmount; 
        }
        // underlyingAmount = exchangeRate * cTokenAmount
        // underlyingAmountUSD = underlyingAmount * oraclePrice
        uint256 underlyingAmount = mul_ScalarTruncate(exchangeRate, amount);
        uint256 underlyingAmountUSD = mul_ScalarTruncate(oraclePrice, underlyingAmount);
        return underlyingAmountUSD;
    }
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

File 4 of 8 : ExponentialNoError.sol
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity ^0.8.10;

/**
 * @title Exponential module for storing fixed-precision decimals
 * @author Compound
 * @notice Exp is a struct which stores decimals with a fixed precision of 18 decimal places.
 *         Thus, if we wanted to store the 5.1, mantissa would store 5.1e18. That is:
 *         `Exp({mantissa: 5100000000000000000})`.
 */
contract ExponentialNoError {
    uint constant expScale = 1e18;
    uint constant doubleScale = 1e36;
    uint constant halfExpScale = expScale/2;
    uint constant mantissaOne = expScale;

    struct Exp {
        uint mantissa;
    }

    struct Double {
        uint mantissa;
    }

    /**
     * @dev Truncates the given exp to a whole number value.
     *      For example, truncate(Exp{mantissa: 15 * expScale}) = 15
     */
    function truncate(Exp memory exp) pure internal returns (uint) {
        // Note: We are not using careful math here as we're performing a division that cannot fail
        return exp.mantissa / expScale;
    }

    /**
     * @dev Multiply an Exp by a scalar, then truncate to return an unsigned integer.
     */
    function mul_ScalarTruncate(Exp memory a, uint scalar) pure internal returns (uint) {
        Exp memory product = mul_(a, scalar);
        return truncate(product);
    }

    /**
     * @dev Multiply an Exp by a scalar, truncate, then add an to an unsigned integer, returning an unsigned integer.
     */
    function mul_ScalarTruncateAddUInt(Exp memory a, uint scalar, uint addend) pure internal returns (uint) {
        Exp memory product = mul_(a, scalar);
        return add_(truncate(product), addend);
    }

    /**
     * @dev Checks if first Exp is less than second Exp.
     */
    function lessThanExp(Exp memory left, Exp memory right) pure internal returns (bool) {
        return left.mantissa < right.mantissa;
    }

    /**
     * @dev Checks if left Exp <= right Exp.
     */
    function lessThanOrEqualExp(Exp memory left, Exp memory right) pure internal returns (bool) {
        return left.mantissa <= right.mantissa;
    }

    /**
     * @dev Checks if left Exp > right Exp.
     */
    function greaterThanExp(Exp memory left, Exp memory right) pure internal returns (bool) {
        return left.mantissa > right.mantissa;
    }

    /**
     * @dev returns true if Exp is exactly zero
     */
    function isZeroExp(Exp memory value) pure internal returns (bool) {
        return value.mantissa == 0;
    }

    function safe224(uint n, string memory errorMessage) pure internal returns (uint224) {
        require(n < 2**224, errorMessage);
        return uint224(n);
    }

    function safe32(uint n, string memory errorMessage) pure internal returns (uint32) {
        require(n < 2**32, errorMessage);
        return uint32(n);
    }

    function add_(Exp memory a, Exp memory b) pure internal returns (Exp memory) {
        return Exp({mantissa: add_(a.mantissa, b.mantissa)});
    }

    function add_(Double memory a, Double memory b) pure internal returns (Double memory) {
        return Double({mantissa: add_(a.mantissa, b.mantissa)});
    }

    function add_(uint a, uint b) pure internal returns (uint) {
        return a + b;
    }

    function sub_(Exp memory a, Exp memory b) pure internal returns (Exp memory) {
        return Exp({mantissa: sub_(a.mantissa, b.mantissa)});
    }

    function sub_(Double memory a, Double memory b) pure internal returns (Double memory) {
        return Double({mantissa: sub_(a.mantissa, b.mantissa)});
    }

    function sub_(uint a, uint b) pure internal returns (uint) {
        return a - b;
    }

    function mul_(Exp memory a, Exp memory b) pure internal returns (Exp memory) {
        return Exp({mantissa: mul_(a.mantissa, b.mantissa) / expScale});
    }

    function mul_(Exp memory a, uint b) pure internal returns (Exp memory) {
        return Exp({mantissa: mul_(a.mantissa, b)});
    }

    function mul_(uint a, Exp memory b) pure internal returns (uint) {
        return mul_(a, b.mantissa) / expScale;
    }

    function mul_(Double memory a, Double memory b) pure internal returns (Double memory) {
        return Double({mantissa: mul_(a.mantissa, b.mantissa) / doubleScale});
    }

    function mul_(Double memory a, uint b) pure internal returns (Double memory) {
        return Double({mantissa: mul_(a.mantissa, b)});
    }

    function mul_(uint a, Double memory b) pure internal returns (uint) {
        return mul_(a, b.mantissa) / doubleScale;
    }

    function mul_(uint a, uint b) pure internal returns (uint) {
        return a * b;
    }

    function div_(Exp memory a, Exp memory b) pure internal returns (Exp memory) {
        return Exp({mantissa: div_(mul_(a.mantissa, expScale), b.mantissa)});
    }

    function div_(Exp memory a, uint b) pure internal returns (Exp memory) {
        return Exp({mantissa: div_(a.mantissa, b)});
    }

    function div_(uint a, Exp memory b) pure internal returns (uint) {
        return div_(mul_(a, expScale), b.mantissa);
    }

    function div_(Double memory a, Double memory b) pure internal returns (Double memory) {
        return Double({mantissa: div_(mul_(a.mantissa, doubleScale), b.mantissa)});
    }

    function div_(Double memory a, uint b) pure internal returns (Double memory) {
        return Double({mantissa: div_(a.mantissa, b)});
    }

    function div_(uint a, Double memory b) pure internal returns (uint) {
        return div_(mul_(a, doubleScale), b.mantissa);
    }

    function div_(uint a, uint b) pure internal returns (uint) {
        return a / b;
    }

    function fraction(uint a, uint b) pure internal returns (Double memory) {
        return Double({mantissa: div_(mul_(a, doubleScale), b)});
    }
}

File 5 of 8 : AggregatorV3Interface.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;

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
		);
}

interface AggregatorValidatorInterface {
	function validate(uint256 previousRoundId,
			int256 previousAnswer,
			uint256 currentRoundId,
			int256 currentAnswer) external returns (bool);
}

File 6 of 8 : IPriceOracle.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;

interface ICToken {
    function underlying() external view returns (address);
    function exchangeRateCurrent() external returns (uint);
    function exchangeRateStored() external view returns (uint);
    function isCToken() external view returns (bool);
}

interface IPriceOracle {
    function isPriceOracle() external view returns (bool);
    function getAssetPrice(address asset) external view returns (uint);
    function getAssetPriceUpdateTimestamp(address asset) external view returns (uint);
    function getUnderlyingPrice(ICToken cToken) external view returns (uint);
    function getUnderlyingPriceUpdateTimestamp(address cToken) external view returns (uint);
}

File 7 of 8 : UniswapConfig.sol
// SPDX-License-Identifier: GPL-3.0

pragma solidity 0.8.10;

import "./interfaces/IPriceOracle.sol";
import "./UniswapLib.sol";


contract UniswapConfig {

    /// @dev Describe how the USD price should be determined for an asset.
    struct TokenConfig {
        // The address of the underlying market token. For this `LINK` market configuration, this would be the address of the `LINK` token.
        address underlying;
        // The bytes32 hash of the underlying symbol.
        bytes32 symbolHash;
        // The number of smallest units of measurement in a single whole unit.
        uint256 baseUnit;
        // The address of the pool being used as the anchor for this market.
        address uniswapMarket;
        // True if the pair on Uniswap is defined as ETH / X
        bool isUniswapReversed;
    }

    /// @notice cToken configs
    mapping(address => TokenConfig) public cTokenConfig;
    
    /// @notice cToken address by underlying's symbol hash
    mapping(bytes32 => address) internal cTokenBySymbolHash;

    /// @notice cToken address by underlying address
    mapping(address => address) internal cTokenByUnderlying;

    event ConfigUpdate(address indexed cToken, address uniswapMarket);

    /**
     * @notice Sets config to fetch underlying price
     * @param cToken The address of the Compound Token
     * @param uniswapMarket The address of the V3 pool being used as the anchor for this market
     */
    function _setTokenConfig(
        address cToken,
        address uniswapMarket
        ) internal {

        require(ICToken(cToken).isCToken(), "invalid cToken");
        address underlying = ICToken(cToken).underlying();

        require(uniswapMarket != address(0), "No market");
        require(
            IUniswapV3Pool(uniswapMarket).token0() == underlying || 
            IUniswapV3Pool(uniswapMarket).token1() == underlying,
            "invalid market"
            );

        bytes32 symbolHash = keccak256(bytes(IERC20(underlying).symbol()));
        uint256 baseUnit = 10 ** IERC20(underlying).decimals();
        bool isUniswapReversed = IUniswapV3Pool(uniswapMarket).token0() == underlying ?
            false : true;

        cTokenConfig[cToken] = TokenConfig({
            underlying: underlying,
            symbolHash: symbolHash,
            baseUnit: baseUnit,
            uniswapMarket: uniswapMarket,
            isUniswapReversed: isUniswapReversed
        });

        cTokenBySymbolHash[symbolHash] = cToken;
        cTokenByUnderlying[underlying] = cToken;
        
        emit ConfigUpdate(cToken, uniswapMarket);
    }

    /**
     * @notice Get the config for symbol
     * @param symbol The symbol of the config to get
     * @return The config object
     */
    function getTokenConfigBySymbol(string calldata symbol)
        public
        view
        returns (TokenConfig memory)
    {
        TokenConfig memory config = cTokenConfig[cTokenBySymbolHash[keccak256(bytes(symbol))]];
        return config;
    }

    /**
     * @notice Get the config for the symbolHash
     * @param symbolHash The keccack256 of the symbol of the config to get
     * @return The config object
     */
    function getTokenConfigBySymbolHash(bytes32 symbolHash)
        public
        view
        returns (TokenConfig memory)
    {
        TokenConfig memory config = cTokenConfig[cTokenBySymbolHash[symbolHash]];
        return config;
    }

    /**
     * @notice Get the config for the cToken
     * @param cToken The address of the cToken of the config to get
     * @return The config object
     */
    function getTokenConfigByCToken(address cToken)
        public
        view
        returns (TokenConfig memory)
    {
        TokenConfig memory config = cTokenConfig[cToken];
        return config;
    }

    /**
     * @notice Get the config for an underlying asset
     * @dev The underlying address of ETH is the zero address
     * @param underlying The address of the underlying asset of the config to get
     * @return The config object
     */
    function getTokenConfigByUnderlying(address underlying)
        public
        view
        returns (TokenConfig memory)
    {
        TokenConfig memory config = cTokenConfig[cTokenByUnderlying[underlying]];
        return config;
    }
}

File 8 of 8 : UniswapLib.sol
// SPDX-License-Identifier: GPL-3.0

pragma solidity >0.8.7;

// From: https://github.com/Uniswap/uniswap-v3-core

/// @title FixedPoint96
/// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format)
/// @dev Used in SqrtPriceMath.sol
library FixedPoint96 {
    uint8 internal constant RESOLUTION = 96;
    uint256 internal constant Q96 = 0x1000000000000000000000000;
}

/// @title Contains 512-bit math functions
/// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision
/// @dev Handles "phantom overflow" i.e., allows multiplication and division where an intermediate value overflows 256 bits
library FullMath {
    /// @notice Calculates floor(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
    /// @param a The multiplicand
    /// @param b The multiplier
    /// @param denominator The divisor
    /// @return result The 256-bit result
    /// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv
    function mulDiv(
        uint256 a,
        uint256 b,
        uint256 denominator
    ) internal pure returns (uint256 result) {
        // 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;
    }
}

/// @title Math library for computing sqrt prices from ticks and vice versa
/// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports
/// prices between 2**-128 and 2**128
library TickMath {
    /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128
    int24 internal constant MIN_TICK = -887272;
    int24 internal constant MAX_TICK = -MIN_TICK;

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

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

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

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

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

interface IUniswapV3Pool {
    /// @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 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 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);
}

/// @title Callback for IUniswapV3PoolActions#swap
/// @notice Any contract that calls IUniswapV3PoolActions#swap must implement this interface
interface IUniswapV3SwapCallback {
    /// @notice Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap.
    /// @dev In the implementation you must pay the pool tokens owed for the swap.
    /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.
    /// amount0Delta and amount1Delta can both be 0 if no tokens were swapped.
    /// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by
    /// the end of the swap. If positive, the callback must send that amount of token0 to the pool.
    /// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by
    /// the end of the swap. If positive, the callback must send that amount of token1 to the pool.
    /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#swap call
    function uniswapV3SwapCallback(
        int256 amount0Delta,
        int256 amount1Delta,
        bytes calldata data
    ) external;
}

interface IERC20 {

    function decimals() external view returns (uint8);
    function symbol() external view returns (string memory);
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) external returns (bool success);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"uint32","name":"twapPeriod_","type":"uint32"},{"internalType":"address","name":"baseUnderlying","type":"address"},{"internalType":"contract AggregatorV3Interface","name":"baseAssetFeed_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"cToken","type":"address"},{"indexed":false,"internalType":"address","name":"uniswapMarket","type":"address"}],"name":"ConfigUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"asset","type":"address"},{"indexed":false,"internalType":"address","name":"oldFeed","type":"address"},{"indexed":false,"internalType":"address","name":"newFeed","type":"address"}],"name":"NewFeedForAsset","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newTwap","type":"uint256"}],"name":"NewTwapPeriod","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"symbolHash","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"}],"name":"PriceUpdated","type":"event"},{"inputs":[],"name":"ETH_BASE_UNIT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EXP_SCALE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_underlyings","type":"address[]"},{"internalType":"address[]","name":"_chainlinkFeeds","type":"address[]"}],"name":"_setPriceETHFeedsForUnderlyings","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_underlying","type":"address"},{"internalType":"address","name":"_chainlinkFeed","type":"address"},{"internalType":"uint8","name":"_priceFeedDecimals","type":"uint8"}],"name":"_setPriceFeedForUnderlying","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_underlyings","type":"address[]"},{"internalType":"address[]","name":"_chainlinkFeeds","type":"address[]"},{"internalType":"uint8[]","name":"_priceFeedsDecimals","type":"uint8[]"}],"name":"_setPriceFeedsForUnderlyings","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"assetsDecimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseAssetFeed","outputs":[{"internalType":"contract AggregatorV3Interface","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseAssetFeedDenominator","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"cTokenConfig","outputs":[{"internalType":"address","name":"underlying","type":"address"},{"internalType":"bytes32","name":"symbolHash","type":"bytes32"},{"internalType":"uint256","name":"baseUnit","type":"uint256"},{"internalType":"address","name":"uniswapMarket","type":"address"},{"internalType":"bool","name":"isUniswapReversed","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"chainLinkETHFeeds","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"chainLinkFeedDecimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"chainLinkFeeds","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"cToken","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bool","name":"reverse","type":"bool"}],"name":"getEvaluation","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"cToken","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bool","name":"reverse","type":"bool"}],"name":"getEvaluationStored","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"cToken","type":"address"}],"name":"getTokenConfigByCToken","outputs":[{"components":[{"internalType":"address","name":"underlying","type":"address"},{"internalType":"bytes32","name":"symbolHash","type":"bytes32"},{"internalType":"uint256","name":"baseUnit","type":"uint256"},{"internalType":"address","name":"uniswapMarket","type":"address"},{"internalType":"bool","name":"isUniswapReversed","type":"bool"}],"internalType":"struct UniswapConfig.TokenConfig","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"symbol","type":"string"}],"name":"getTokenConfigBySymbol","outputs":[{"components":[{"internalType":"address","name":"underlying","type":"address"},{"internalType":"bytes32","name":"symbolHash","type":"bytes32"},{"internalType":"uint256","name":"baseUnit","type":"uint256"},{"internalType":"address","name":"uniswapMarket","type":"address"},{"internalType":"bool","name":"isUniswapReversed","type":"bool"}],"internalType":"struct UniswapConfig.TokenConfig","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"symbolHash","type":"bytes32"}],"name":"getTokenConfigBySymbolHash","outputs":[{"components":[{"internalType":"address","name":"underlying","type":"address"},{"internalType":"bytes32","name":"symbolHash","type":"bytes32"},{"internalType":"uint256","name":"baseUnit","type":"uint256"},{"internalType":"address","name":"uniswapMarket","type":"address"},{"internalType":"bool","name":"isUniswapReversed","type":"bool"}],"internalType":"struct UniswapConfig.TokenConfig","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"underlying","type":"address"}],"name":"getTokenConfigByUnderlying","outputs":[{"components":[{"internalType":"address","name":"underlying","type":"address"},{"internalType":"bytes32","name":"symbolHash","type":"bytes32"},{"internalType":"uint256","name":"baseUnit","type":"uint256"},{"internalType":"address","name":"uniswapMarket","type":"address"},{"internalType":"bool","name":"isUniswapReversed","type":"bool"}],"internalType":"struct UniswapConfig.TokenConfig","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"cToken","type":"address"}],"name":"getUnderlyingPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"cToken","type":"address"},{"internalType":"address","name":"uniswapMarket","type":"address"}],"name":"setTokenConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"cToken","type":"address[]"},{"internalType":"address[]","name":"uniswapMarket","type":"address[]"}],"name":"setTokenConfigs","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newTwap","type":"uint256"}],"name":"setTwapPeriod","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"twapPeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

60c06040523480156200001157600080fd5b5060405162002e0f38038062002e0f83398101604081905262000034916200037a565b6200003f33620001a7565b6102588363ffffffff161015801562000060575062093a808363ffffffff16105b620000a15760405162461bcd60e51b815260206004820152600c60248201526b0696e76616c696420747761760a41b60448201526064015b60405180910390fd5b63ffffffff83166008556001600160a01b038216620000f05760405162461bcd60e51b815260206004820152600a602482015269756e6465726c79696e6760b01b604482015260640162000098565b806001600160a01b03166080816001600160a01b0316815250506000816001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200014b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001719190620003d6565b90506200018060068262000418565b6200018d90600a6200053d565b60a0526200019d838383620001f9565b505050506200054e565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b03808416600081815260046020526040812054909216919073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14156200023d57506012620002a5565b846001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200027c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620002a29190620003d6565b90505b836001600160a01b0316826001600160a01b0316146200035a576001600160a01b03858116600081815260046020908152604080832080548a87166001600160a01b0319909116811790915560068352818420805460ff8b811660ff1992831617909255600785529483902080549189169190951617909355805194871685529084019190915290917f33232b700ab62b15cace2ecf9e2e94a9c01f0119d48e2c9cb9d5528270d1994e910160405180910390a25b5050505050565b6001600160a01b03811681146200037757600080fd5b50565b6000806000606084860312156200039057600080fd5b835163ffffffff81168114620003a557600080fd5b6020850151909350620003b88162000361565b6040850151909250620003cb8162000361565b809150509250925092565b600060208284031215620003e957600080fd5b815160ff81168114620003fb57600080fd5b9392505050565b634e487b7160e01b600052601160045260246000fd5b600060ff821660ff84168082101562000435576200043562000402565b90039392505050565b600181815b808511156200047f57816000190482111562000463576200046362000402565b808516156200047157918102915b93841c939080029062000443565b509250929050565b600082620004985750600162000537565b81620004a75750600062000537565b8160018114620004c05760028114620004cb57620004eb565b600191505062000537565b60ff841115620004df57620004df62000402565b50506001821b62000537565b5060208310610133831016604e8410600b841016171562000510575081810a62000537565b6200051c83836200043e565b806000190482111562000533576200053362000402565b0290505b92915050565b6000620003fb60ff84168362000487565b60805160a05161288d62000582600039600081816102d2015261164701526000818161048e015261166b015261288d6000f3fe608060405234801561001057600080fd5b506004361061018e5760003560e01c80635e657adf116100de578063ad3d19d511610097578063f2fde38b11610071578063f2fde38b1461046d578063f620732614610480578063f75aa68d14610489578063fc57d4df146104b057600080fd5b8063ad3d19d514610447578063bbba205d146101cd578063d4bf4ccc1461045a57600080fd5b80635e657adf146103cc578063616b3c27146103df578063715018a6146103f25780638da5cb5b146103fa5780638ed178cf1461040b5780639f5996311461043457600080fd5b8063289fcb1e1161014b578063388a934711610125578063388a9347146103705780634da2194214610383578063515d2c2914610396578063561b8313146103a957600080fd5b8063289fcb1e146103075780632ae3c3481461031c578063343e28741461035d57600080fd5b806309f8110e14610193578063152810fb146101cd5780631a125204146101ea5780631e99a0611461024a57806325fa0123146102cd578063276c2cba146102f4575b600080fd5b6101b66101a1366004611f1f565b60076020526000908152604090205460ff1681565b60405160ff90911681526020015b60405180910390f35b6101dc670de0b6b3a764000081565b6040519081526020016101c4565b6101fd6101f8366004611f3c565b6104c3565b6040516101c4919081516001600160a01b03908116825260208084015190830152604080840151908301526060808401519091169082015260809182015115159181019190915260a00190565b610296610258366004611f1f565b60006020819052908152604090208054600182015460028301546003909301546001600160a01b03928316939192811690600160a01b900460ff1685565b604080516001600160a01b03968716815260208101959095528401929092529092166060820152901515608082015260a0016101c4565b6101dc7f000000000000000000000000000000000000000000000000000000000000000081565b6101fd610302366004611f55565b610535565b61031a610315366004612013565b6105df565b005b61034561032a366004611f1f565b6004602052600090815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020016101c4565b61031a61036b36600461207f565b6106b6565b61031a61037e3660046120c7565b6106cc565b6101fd610391366004611f1f565b6106e4565b61031a6103a4366004612013565b61075b565b6101b66103b7366004611f1f565b60066020526000908152604090205460ff1681565b61031a6103da366004611f3c565b6107f5565b6101dc6103ed366004612120565b610887565b61031a6109ab565b6003546001600160a01b0316610345565b610345610419366004611f1f565b6005602052600090815260409020546001600160a01b031681565b6101fd610442366004611f1f565b6109bf565b6101dc610455366004612120565b610a2c565b61031a610468366004612157565b610a78565b61031a61047b366004611f1f565b610b61565b6101dc60085481565b6103457f000000000000000000000000000000000000000000000000000000000000000081565b6101dc6104be366004611f1f565b610bda565b6104cb611edc565b506000908152600160208181526040808420546001600160a01b03908116855284835293819020815160a0810183528154861681529381015492840192909252600282015490830152600301549182166060820152600160a01b90910460ff161515608082015290565b61053d611edc565b60008060006001600087876040516105569291906121f1565b604080519182900390912082526020808301939093529081016000908120546001600160a01b03908116855284840195909552928101909220825160a0810184528154851681526001820154928101929092526002810154928201929092526003909101549182166060820152600160a01b90910460ff16151560808201529150505b92915050565b6105e7610ca0565b82811461060f5760405162461bcd60e51b815260040161060690612201565b60405180910390fd5b60005b838110156106af5782828281811061062c5761062c61222a565b90506020020160208101906106419190611f1f565b600560008787858181106106575761065761222a565b905060200201602081019061066c9190611f1f565b6001600160a01b039081168252602082019290925260400160002080546001600160a01b03191692909116919091179055806106a781612256565b915050610612565b5050505050565b6106be610ca0565b6106c88282610cfa565b5050565b6106d4610ca0565b6106df8383836111f2565b505050565b6106ec611edc565b506001600160a01b039081166000908152600260208181526040808420548516845283825292839020835160a0810185528154861681526001820154928101929092529182015492810192909252600301549182166060820152600160a01b90910460ff161515608082015290565b610763610ca0565b8281146107825760405162461bcd60e51b815260040161060690612201565b60005b838110156106af576107e38585838181106107a2576107a261222a565b90506020020160208101906107b79190611f1f565b8484848181106107c9576107c961222a565b90506020020160208101906107de9190611f1f565b610cfa565b806107ed81612256565b915050610785565b6107fd610ca0565b6102588110158015610811575062093a8081105b61084c5760405162461bcd60e51b815260206004820152600c60248201526b0696e76616c696420747761760a41b6044820152606401610606565b60088190556040518181527fdac58b37a20c84a78ea340a0206bc95bfbc4d50b216db3a5732643cc86b2803e9060200160405180910390a150565b6000806040518060200160405280866001600160a01b031663bd6d894d6040518163ffffffff1660e01b81526004016020604051808303816000875af11580156108d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108f99190612271565b90529050600061090886610bda565b9050806109475760405162461bcd60e51b815260206004820152600d60248201526c696e76616c696420707269636560981b6044820152606401610606565b604080516020810190915281815284156109825760006109678783611353565b905060006109758286611353565b95506109a4945050505050565b600061098e8488611371565b9050600061099c8383611371565b955050505050505b9392505050565b6109b3610ca0565b6109bd6000611391565b565b6109c7611edc565b506001600160a01b0390811660009081526020818152604091829020825160a0810184528154851681526001820154928101929092526002810154928201929092526003909101549182166060820152600160a01b90910460ff161515608082015290565b6000806040518060200160405280866001600160a01b031663182df0f56040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108d5573d6000803e3d6000fd5b610a80610ca0565b848314610a9f5760405162461bcd60e51b815260040161060690612201565b848114610abe5760405162461bcd60e51b815260040161060690612201565b60005b85811015610b5857610b46878783818110610ade57610ade61222a565b9050602002016020810190610af39190611f1f565b868684818110610b0557610b0561222a565b9050602002016020810190610b1a9190611f1f565b858585818110610b2c57610b2c61222a565b9050602002016020810190610b41919061228a565b6111f2565b80610b5081612256565b915050610ac1565b50505050505050565b610b69610ca0565b6001600160a01b038116610bce5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610606565b610bd781611391565b50565b600080826001600160a01b0316636f307dc36040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c1b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c3f91906122a7565b6001600160a01b038082166000908152600460205260409020549192501615610c6b576109a4816113e3565b6001600160a01b038084166000908152602081905260409020600301541615610c97576109a4836114ec565b50600092915050565b6003546001600160a01b031633146109bd5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610606565b816001600160a01b031663fe9c44ae6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d38573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d5c91906122c4565b610d995760405162461bcd60e51b815260206004820152600e60248201526d34b73b30b634b21031aa37b5b2b760911b6044820152606401610606565b6000826001600160a01b0316636f307dc36040518163ffffffff1660e01b8152600401602060405180830381865afa158015610dd9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dfd91906122a7565b90506001600160a01b038216610e415760405162461bcd60e51b8152602060048201526009602482015268139bc81b585c9ad95d60ba1b6044820152606401610606565b806001600160a01b0316826001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ead91906122a7565b6001600160a01b03161480610f345750806001600160a01b0316826001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f05573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f2991906122a7565b6001600160a01b0316145b610f715760405162461bcd60e51b815260206004820152600e60248201526d1a5b9d985b1a59081b585c9ad95d60921b6044820152606401610606565b6000816001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015610fb1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610fd99190810190612328565b8051906020012090506000826001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015611022573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061104691906123dc565b61105190600a6124dd565b90506000836001600160a01b0316856001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa15801561109d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110c191906122a7565b6001600160a01b0316146110d65760016110d9565b60005b6040805160a0810182526001600160a01b0380881680835260208084018981528486018981528c851660608701908152881515608088019081528f871660008181528087528a812099518a54908a166001600160a01b0319918216178b5595516001808c019190915594516002808c019190915593516003909a01805493511515600160a01b026001600160a81b03199094169a90991699909917919091179096558b8752908352868620805483168617905592855291905291839020805490921681179091559051919250907f3f3d4bd03348b12ec1e6c0d687a4c6a7416b85c302f44f95262a302ca4952441906111e29088906001600160a01b0391909116815260200190565b60405180910390a2505050505050565b6001600160a01b03808416600081815260046020526040812054909216919073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee141561123457506012611299565b846001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015611272573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061129691906123dc565b90505b836001600160a01b0316826001600160a01b0316146106af576001600160a01b03858116600081815260046020908152604080832080548a87166001600160a01b0319909116811790915560068352818420805460ff8b811660ff1992831617909255600785529483902080549189169190951617909355805194871685529084019190915290917f33232b700ab62b15cace2ecf9e2e94a9c01f0119d48e2c9cb9d5528270d1994e910160405180910390a25050505050565b60006109a461136a84670de0b6b3a7640000611567565b8351611573565b60008061137e848461157f565b9050611389816115b0565b949350505050565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b038082166000908152600660209081526040808320546007835281842054600490935290832054929360ff9182169392909116911683611429826115c8565b9050806001600160a01b038088166000908152600560205260409020548482169116141561147457620f424061145d611643565b61146790836124ec565b6114719190612521565b90505b8460ff16600814156114b65761148b84600a6124dd565b6114a1826b204fce5e3e250261100000006124ec565b6114ab9190612521565b979650505050505050565b8460ff16601214156114df576114cd84600a6124dd565b6114a182670de0b6b3a76400006124ec565b5060009695505050505050565b6000806114f8836109bf565b905060006115058261169e565b9050600160f81b811061154b5760405162461bcd60e51b815260206004820152600e60248201526d416e63686f7220746f6f2062696760901b6044820152606401610606565b6113896c0c9f2c9cd04674edea400000008284604001516116b5565b60006109a482846124ec565b60006109a48284612521565b60408051602081019091526000815260405180602001604052806115a7856000015185611567565b90529392505050565b80516000906105d990670de0b6b3a764000090612521565b600080600080600080866001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa15801561160f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116339190612554565b50919a9950505050505050505050565b60007f000000000000000000000000000000000000000000000000000000000000000061168f7f00000000000000000000000000000000000000000000000000000000000000006115c8565b6116999190612521565b905090565b6000806116a9611643565b90506109a48382611822565b6000808060001985870985870292508281108382030391505080600014156116ef57600084116116e457600080fd5b5082900490506109a4565b8084116116fb57600080fd5b600084868809808403938111909203919050600061171b861960016125a4565b861695869004959384900493600081900304600101905061173c81846124ec565b90931792600061174d8760036124ec565b600218905061175c81886124ec565b6117679060026125bc565b61177190826124ec565b905061177d81886124ec565b6117889060026125bc565b61179290826124ec565b905061179e81886124ec565b6117a99060026125bc565b6117b390826124ec565b90506117bf81886124ec565b6117ca9060026125bc565b6117d490826124ec565b90506117e081886124ec565b6117eb9060026125bc565b6117f590826124ec565b905061180181886124ec565b61180c9060026125bc565b61181690826124ec565b905061099c81866124ec565b60008061182e84611878565b9050600061183c84836124ec565b90506000670de0b6b3a76400008087604001518461185a91906124ec565b6118649190612521565b61186e9190612521565b9695505050505050565b600854604080516002808252606082018352600093928492919060208301908036833701905050905081816000815181106118b5576118b561222a565b63ffffffff90921660209283029190910190910152606084015160405163883bdbfd60e01b81526000916001600160a01b03169063883bdbfd906118fd9085906004016125d3565b600060405180830381865afa15801561191a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261194291908101906126a9565b50905060008363ffffffff169050600081836000815181106119665761196661222a565b6020026020010151846001815181106119815761198161222a565b60200260200101516119939190612775565b61199d91906127c5565b9050620d89e719600682900b128015906119c957506119bf620d89e719612803565b60020b8160060b13155b611a095760405162461bcd60e51b815260206004820152601160248201527054574150206e6f7420696e2072616e676560781b6044820152606401610606565b627fffff600682900b12611a5f5760405162461bcd60e51b815260206004820152601d60248201527f74696d655765696768746564417665726167655469636b203e206d61780000006044820152606401610606565b6080870151819015611a7757611a7481612803565b90505b6000611a8282611ac5565b90506000611a9e6001600160a01b03831680600160601b6116b5565b9050611ab7670de0b6b3a764000082600160601b6116b5565b9a9950505050505050505050565b60008060008360020b12611adc578260020b611ae9565b8260020b611ae990612826565b9050611af8620d89e719612803565b62ffffff16811115611b305760405162461bcd60e51b81526020600482015260016024820152601560fa1b6044820152606401610606565b600060018216611b4457600160801b611b56565b6ffffcb933bd6fad37aa2d162d1a5940015b70ffffffffffffffffffffffffffffffffff1690506002821615611b95576080611b90826ffff97272373d413259a46990580e213a6124ec565b901c90505b6004821615611bbf576080611bba826ffff2e50f5f656932ef12357cf3c7fdcc6124ec565b901c90505b6008821615611be9576080611be4826fffe5caca7e10e4e61c3624eaa0941cd06124ec565b901c90505b6010821615611c13576080611c0e826fffcb9843d60f6159c9db58835c9266446124ec565b901c90505b6020821615611c3d576080611c38826fff973b41fa98c081472e6896dfb254c06124ec565b901c90505b6040821615611c67576080611c62826fff2ea16466c96a3843ec78b326b528616124ec565b901c90505b6080821615611c91576080611c8c826ffe5dee046a99a2a811c461f1969c30536124ec565b901c90505b610100821615611cbc576080611cb7826ffcbe86c7900a88aedcffc83b479aa3a46124ec565b901c90505b610200821615611ce7576080611ce2826ff987a7253ac413176f2b074cf7815e546124ec565b901c90505b610400821615611d12576080611d0d826ff3392b0822b70005940c7a398e4b70f36124ec565b901c90505b610800821615611d3d576080611d38826fe7159475a2c29b7443b29c7fa6e889d96124ec565b901c90505b611000821615611d68576080611d63826fd097f3bdfd2022b8845ad8f792aa58256124ec565b901c90505b612000821615611d93576080611d8e826fa9f746462d870fdf8a65dc1f90e061e56124ec565b901c90505b614000821615611dbe576080611db9826f70d869a156d2a1b890bb3df62baf32f76124ec565b901c90505b618000821615611de9576080611de4826f31be135f97d08fd981231505542fcfa66124ec565b901c90505b62010000821615611e15576080611e10826f09aa508b5b7a84e1c677de54f3e99bc96124ec565b901c90505b62020000821615611e40576080611e3b826e5d6af8dedb81196699c329225ee6046124ec565b901c90505b62040000821615611e6a576080611e65826d2216e584f5fa1ea926041bedfe986124ec565b901c90505b62080000821615611e92576080611e8d826b048a170391f7dc42444e8fa26124ec565b901c90505b60008460020b1315611ead57611eaa81600019612521565b90505b611ebc64010000000082612843565b15611ec8576001611ecb565b60005b6113899060ff16602083901c6125a4565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915290565b6001600160a01b0381168114610bd757600080fd5b600060208284031215611f3157600080fd5b81356109a481611f0a565b600060208284031215611f4e57600080fd5b5035919050565b60008060208385031215611f6857600080fd5b823567ffffffffffffffff80821115611f8057600080fd5b818501915085601f830112611f9457600080fd5b813581811115611fa357600080fd5b866020828501011115611fb557600080fd5b60209290920196919550909350505050565b60008083601f840112611fd957600080fd5b50813567ffffffffffffffff811115611ff157600080fd5b6020830191508360208260051b850101111561200c57600080fd5b9250929050565b6000806000806040858703121561202957600080fd5b843567ffffffffffffffff8082111561204157600080fd5b61204d88838901611fc7565b9096509450602087013591508082111561206657600080fd5b5061207387828801611fc7565b95989497509550505050565b6000806040838503121561209257600080fd5b823561209d81611f0a565b915060208301356120ad81611f0a565b809150509250929050565b60ff81168114610bd757600080fd5b6000806000606084860312156120dc57600080fd5b83356120e781611f0a565b925060208401356120f781611f0a565b91506040840135612107816120b8565b809150509250925092565b8015158114610bd757600080fd5b60008060006060848603121561213557600080fd5b833561214081611f0a565b925060208401359150604084013561210781612112565b6000806000806000806060878903121561217057600080fd5b863567ffffffffffffffff8082111561218857600080fd5b6121948a838b01611fc7565b909850965060208901359150808211156121ad57600080fd5b6121b98a838b01611fc7565b909650945060408901359150808211156121d257600080fd5b506121df89828a01611fc7565b979a9699509497509295939492505050565b8183823760009101908152919050565b6020808252600f908201526e696e76616c6964206c656e6774687360881b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060001982141561226a5761226a612240565b5060010190565b60006020828403121561228357600080fd5b5051919050565b60006020828403121561229c57600080fd5b81356109a4816120b8565b6000602082840312156122b957600080fd5b81516109a481611f0a565b6000602082840312156122d657600080fd5b81516109a481612112565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612320576123206122e1565b604052919050565b6000602080838503121561233b57600080fd5b825167ffffffffffffffff8082111561235357600080fd5b818501915085601f83011261236757600080fd5b815181811115612379576123796122e1565b61238b601f8201601f191685016122f7565b915080825286848285010111156123a157600080fd5b60005b818110156123bf5783810185015183820186015284016123a4565b818111156123d05760008583850101525b50909695505050505050565b6000602082840312156123ee57600080fd5b81516109a4816120b8565b600181815b8085111561243457816000190482111561241a5761241a612240565b8085161561242757918102915b93841c93908002906123fe565b509250929050565b60008261244b575060016105d9565b81612458575060006105d9565b816001811461246e576002811461247857612494565b60019150506105d9565b60ff84111561248957612489612240565b50506001821b6105d9565b5060208310610133831016604e8410600b84101617156124b7575081810a6105d9565b6124c183836123f9565b80600019048211156124d5576124d5612240565b029392505050565b60006109a460ff84168361243c565b600081600019048311821515161561250657612506612240565b500290565b634e487b7160e01b600052601260045260246000fd5b6000826125305761253061250b565b500490565b805169ffffffffffffffffffff8116811461254f57600080fd5b919050565b600080600080600060a0868803121561256c57600080fd5b61257586612535565b945060208601519350604086015192506060860151915061259860808701612535565b90509295509295909350565b600082198211156125b7576125b7612240565b500190565b6000828210156125ce576125ce612240565b500390565b6020808252825182820181905260009190848201906040850190845b818110156123d057835163ffffffff16835292840192918401916001016125ef565b600067ffffffffffffffff82111561262b5761262b6122e1565b5060051b60200190565b600082601f83011261264657600080fd5b8151602061265b61265683612611565b6122f7565b82815260059290921b8401810191818101908684111561267a57600080fd5b8286015b8481101561269e57805161269181611f0a565b835291830191830161267e565b509695505050505050565b600080604083850312156126bc57600080fd5b825167ffffffffffffffff808211156126d457600080fd5b818501915085601f8301126126e857600080fd5b815160206126f861265683612611565b82815260059290921b8401810191818101908984111561271757600080fd5b948201945b838610156127455785518060060b81146127365760008081fd5b8252948201949082019061271c565b9188015191965090935050508082111561275e57600080fd5b5061276b85828601612635565b9150509250929050565b60008160060b8360060b6000811281667fffffffffffff19018312811516156127a0576127a0612240565b81667fffffffffffff0183138116156127bb576127bb612240565b5090039392505050565b60008160060b8360060b806127dc576127dc61250b565b667fffffffffffff198214600019821416156127fa576127fa612240565b90059392505050565b60008160020b627fffff1981141561281d5761281d612240565b60000392915050565b6000600160ff1b82141561283c5761283c612240565b5060000390565b6000826128525761285261250b565b50069056fea2646970667358221220ef60f869492a344f69ba029d878b70231a0efdbf694849676fb05bce14dd837d64736f6c634300080a00330000000000000000000000000000000000000000000000000000000000000708000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b8419

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061018e5760003560e01c80635e657adf116100de578063ad3d19d511610097578063f2fde38b11610071578063f2fde38b1461046d578063f620732614610480578063f75aa68d14610489578063fc57d4df146104b057600080fd5b8063ad3d19d514610447578063bbba205d146101cd578063d4bf4ccc1461045a57600080fd5b80635e657adf146103cc578063616b3c27146103df578063715018a6146103f25780638da5cb5b146103fa5780638ed178cf1461040b5780639f5996311461043457600080fd5b8063289fcb1e1161014b578063388a934711610125578063388a9347146103705780634da2194214610383578063515d2c2914610396578063561b8313146103a957600080fd5b8063289fcb1e146103075780632ae3c3481461031c578063343e28741461035d57600080fd5b806309f8110e14610193578063152810fb146101cd5780631a125204146101ea5780631e99a0611461024a57806325fa0123146102cd578063276c2cba146102f4575b600080fd5b6101b66101a1366004611f1f565b60076020526000908152604090205460ff1681565b60405160ff90911681526020015b60405180910390f35b6101dc670de0b6b3a764000081565b6040519081526020016101c4565b6101fd6101f8366004611f3c565b6104c3565b6040516101c4919081516001600160a01b03908116825260208084015190830152604080840151908301526060808401519091169082015260809182015115159181019190915260a00190565b610296610258366004611f1f565b60006020819052908152604090208054600182015460028301546003909301546001600160a01b03928316939192811690600160a01b900460ff1685565b604080516001600160a01b03968716815260208101959095528401929092529092166060820152901515608082015260a0016101c4565b6101dc7f000000000000000000000000000000000000000000000000000000000000006481565b6101fd610302366004611f55565b610535565b61031a610315366004612013565b6105df565b005b61034561032a366004611f1f565b6004602052600090815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020016101c4565b61031a61036b36600461207f565b6106b6565b61031a61037e3660046120c7565b6106cc565b6101fd610391366004611f1f565b6106e4565b61031a6103a4366004612013565b61075b565b6101b66103b7366004611f1f565b60066020526000908152604090205460ff1681565b61031a6103da366004611f3c565b6107f5565b6101dc6103ed366004612120565b610887565b61031a6109ab565b6003546001600160a01b0316610345565b610345610419366004611f1f565b6005602052600090815260409020546001600160a01b031681565b6101fd610442366004611f1f565b6109bf565b6101dc610455366004612120565b610a2c565b61031a610468366004612157565b610a78565b61031a61047b366004611f1f565b610b61565b6101dc60085481565b6103457f0000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b841981565b6101dc6104be366004611f1f565b610bda565b6104cb611edc565b506000908152600160208181526040808420546001600160a01b03908116855284835293819020815160a0810183528154861681529381015492840192909252600282015490830152600301549182166060820152600160a01b90910460ff161515608082015290565b61053d611edc565b60008060006001600087876040516105569291906121f1565b604080519182900390912082526020808301939093529081016000908120546001600160a01b03908116855284840195909552928101909220825160a0810184528154851681526001820154928101929092526002810154928201929092526003909101549182166060820152600160a01b90910460ff16151560808201529150505b92915050565b6105e7610ca0565b82811461060f5760405162461bcd60e51b815260040161060690612201565b60405180910390fd5b60005b838110156106af5782828281811061062c5761062c61222a565b90506020020160208101906106419190611f1f565b600560008787858181106106575761065761222a565b905060200201602081019061066c9190611f1f565b6001600160a01b039081168252602082019290925260400160002080546001600160a01b03191692909116919091179055806106a781612256565b915050610612565b5050505050565b6106be610ca0565b6106c88282610cfa565b5050565b6106d4610ca0565b6106df8383836111f2565b505050565b6106ec611edc565b506001600160a01b039081166000908152600260208181526040808420548516845283825292839020835160a0810185528154861681526001820154928101929092529182015492810192909252600301549182166060820152600160a01b90910460ff161515608082015290565b610763610ca0565b8281146107825760405162461bcd60e51b815260040161060690612201565b60005b838110156106af576107e38585838181106107a2576107a261222a565b90506020020160208101906107b79190611f1f565b8484848181106107c9576107c961222a565b90506020020160208101906107de9190611f1f565b610cfa565b806107ed81612256565b915050610785565b6107fd610ca0565b6102588110158015610811575062093a8081105b61084c5760405162461bcd60e51b815260206004820152600c60248201526b0696e76616c696420747761760a41b6044820152606401610606565b60088190556040518181527fdac58b37a20c84a78ea340a0206bc95bfbc4d50b216db3a5732643cc86b2803e9060200160405180910390a150565b6000806040518060200160405280866001600160a01b031663bd6d894d6040518163ffffffff1660e01b81526004016020604051808303816000875af11580156108d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108f99190612271565b90529050600061090886610bda565b9050806109475760405162461bcd60e51b815260206004820152600d60248201526c696e76616c696420707269636560981b6044820152606401610606565b604080516020810190915281815284156109825760006109678783611353565b905060006109758286611353565b95506109a4945050505050565b600061098e8488611371565b9050600061099c8383611371565b955050505050505b9392505050565b6109b3610ca0565b6109bd6000611391565b565b6109c7611edc565b506001600160a01b0390811660009081526020818152604091829020825160a0810184528154851681526001820154928101929092526002810154928201929092526003909101549182166060820152600160a01b90910460ff161515608082015290565b6000806040518060200160405280866001600160a01b031663182df0f56040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108d5573d6000803e3d6000fd5b610a80610ca0565b848314610a9f5760405162461bcd60e51b815260040161060690612201565b848114610abe5760405162461bcd60e51b815260040161060690612201565b60005b85811015610b5857610b46878783818110610ade57610ade61222a565b9050602002016020810190610af39190611f1f565b868684818110610b0557610b0561222a565b9050602002016020810190610b1a9190611f1f565b858585818110610b2c57610b2c61222a565b9050602002016020810190610b41919061228a565b6111f2565b80610b5081612256565b915050610ac1565b50505050505050565b610b69610ca0565b6001600160a01b038116610bce5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610606565b610bd781611391565b50565b600080826001600160a01b0316636f307dc36040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c1b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c3f91906122a7565b6001600160a01b038082166000908152600460205260409020549192501615610c6b576109a4816113e3565b6001600160a01b038084166000908152602081905260409020600301541615610c97576109a4836114ec565b50600092915050565b6003546001600160a01b031633146109bd5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610606565b816001600160a01b031663fe9c44ae6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d38573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d5c91906122c4565b610d995760405162461bcd60e51b815260206004820152600e60248201526d34b73b30b634b21031aa37b5b2b760911b6044820152606401610606565b6000826001600160a01b0316636f307dc36040518163ffffffff1660e01b8152600401602060405180830381865afa158015610dd9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dfd91906122a7565b90506001600160a01b038216610e415760405162461bcd60e51b8152602060048201526009602482015268139bc81b585c9ad95d60ba1b6044820152606401610606565b806001600160a01b0316826001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ead91906122a7565b6001600160a01b03161480610f345750806001600160a01b0316826001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f05573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f2991906122a7565b6001600160a01b0316145b610f715760405162461bcd60e51b815260206004820152600e60248201526d1a5b9d985b1a59081b585c9ad95d60921b6044820152606401610606565b6000816001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015610fb1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610fd99190810190612328565b8051906020012090506000826001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015611022573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061104691906123dc565b61105190600a6124dd565b90506000836001600160a01b0316856001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa15801561109d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110c191906122a7565b6001600160a01b0316146110d65760016110d9565b60005b6040805160a0810182526001600160a01b0380881680835260208084018981528486018981528c851660608701908152881515608088019081528f871660008181528087528a812099518a54908a166001600160a01b0319918216178b5595516001808c019190915594516002808c019190915593516003909a01805493511515600160a01b026001600160a81b03199094169a90991699909917919091179096558b8752908352868620805483168617905592855291905291839020805490921681179091559051919250907f3f3d4bd03348b12ec1e6c0d687a4c6a7416b85c302f44f95262a302ca4952441906111e29088906001600160a01b0391909116815260200190565b60405180910390a2505050505050565b6001600160a01b03808416600081815260046020526040812054909216919073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee141561123457506012611299565b846001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015611272573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061129691906123dc565b90505b836001600160a01b0316826001600160a01b0316146106af576001600160a01b03858116600081815260046020908152604080832080548a87166001600160a01b0319909116811790915560068352818420805460ff8b811660ff1992831617909255600785529483902080549189169190951617909355805194871685529084019190915290917f33232b700ab62b15cace2ecf9e2e94a9c01f0119d48e2c9cb9d5528270d1994e910160405180910390a25050505050565b60006109a461136a84670de0b6b3a7640000611567565b8351611573565b60008061137e848461157f565b9050611389816115b0565b949350505050565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b038082166000908152600660209081526040808320546007835281842054600490935290832054929360ff9182169392909116911683611429826115c8565b9050806001600160a01b038088166000908152600560205260409020548482169116141561147457620f424061145d611643565b61146790836124ec565b6114719190612521565b90505b8460ff16600814156114b65761148b84600a6124dd565b6114a1826b204fce5e3e250261100000006124ec565b6114ab9190612521565b979650505050505050565b8460ff16601214156114df576114cd84600a6124dd565b6114a182670de0b6b3a76400006124ec565b5060009695505050505050565b6000806114f8836109bf565b905060006115058261169e565b9050600160f81b811061154b5760405162461bcd60e51b815260206004820152600e60248201526d416e63686f7220746f6f2062696760901b6044820152606401610606565b6113896c0c9f2c9cd04674edea400000008284604001516116b5565b60006109a482846124ec565b60006109a48284612521565b60408051602081019091526000815260405180602001604052806115a7856000015185611567565b90529392505050565b80516000906105d990670de0b6b3a764000090612521565b600080600080600080866001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa15801561160f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116339190612554565b50919a9950505050505050505050565b60007f000000000000000000000000000000000000000000000000000000000000006461168f7f0000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b84196115c8565b6116999190612521565b905090565b6000806116a9611643565b90506109a48382611822565b6000808060001985870985870292508281108382030391505080600014156116ef57600084116116e457600080fd5b5082900490506109a4565b8084116116fb57600080fd5b600084868809808403938111909203919050600061171b861960016125a4565b861695869004959384900493600081900304600101905061173c81846124ec565b90931792600061174d8760036124ec565b600218905061175c81886124ec565b6117679060026125bc565b61177190826124ec565b905061177d81886124ec565b6117889060026125bc565b61179290826124ec565b905061179e81886124ec565b6117a99060026125bc565b6117b390826124ec565b90506117bf81886124ec565b6117ca9060026125bc565b6117d490826124ec565b90506117e081886124ec565b6117eb9060026125bc565b6117f590826124ec565b905061180181886124ec565b61180c9060026125bc565b61181690826124ec565b905061099c81866124ec565b60008061182e84611878565b9050600061183c84836124ec565b90506000670de0b6b3a76400008087604001518461185a91906124ec565b6118649190612521565b61186e9190612521565b9695505050505050565b600854604080516002808252606082018352600093928492919060208301908036833701905050905081816000815181106118b5576118b561222a565b63ffffffff90921660209283029190910190910152606084015160405163883bdbfd60e01b81526000916001600160a01b03169063883bdbfd906118fd9085906004016125d3565b600060405180830381865afa15801561191a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261194291908101906126a9565b50905060008363ffffffff169050600081836000815181106119665761196661222a565b6020026020010151846001815181106119815761198161222a565b60200260200101516119939190612775565b61199d91906127c5565b9050620d89e719600682900b128015906119c957506119bf620d89e719612803565b60020b8160060b13155b611a095760405162461bcd60e51b815260206004820152601160248201527054574150206e6f7420696e2072616e676560781b6044820152606401610606565b627fffff600682900b12611a5f5760405162461bcd60e51b815260206004820152601d60248201527f74696d655765696768746564417665726167655469636b203e206d61780000006044820152606401610606565b6080870151819015611a7757611a7481612803565b90505b6000611a8282611ac5565b90506000611a9e6001600160a01b03831680600160601b6116b5565b9050611ab7670de0b6b3a764000082600160601b6116b5565b9a9950505050505050505050565b60008060008360020b12611adc578260020b611ae9565b8260020b611ae990612826565b9050611af8620d89e719612803565b62ffffff16811115611b305760405162461bcd60e51b81526020600482015260016024820152601560fa1b6044820152606401610606565b600060018216611b4457600160801b611b56565b6ffffcb933bd6fad37aa2d162d1a5940015b70ffffffffffffffffffffffffffffffffff1690506002821615611b95576080611b90826ffff97272373d413259a46990580e213a6124ec565b901c90505b6004821615611bbf576080611bba826ffff2e50f5f656932ef12357cf3c7fdcc6124ec565b901c90505b6008821615611be9576080611be4826fffe5caca7e10e4e61c3624eaa0941cd06124ec565b901c90505b6010821615611c13576080611c0e826fffcb9843d60f6159c9db58835c9266446124ec565b901c90505b6020821615611c3d576080611c38826fff973b41fa98c081472e6896dfb254c06124ec565b901c90505b6040821615611c67576080611c62826fff2ea16466c96a3843ec78b326b528616124ec565b901c90505b6080821615611c91576080611c8c826ffe5dee046a99a2a811c461f1969c30536124ec565b901c90505b610100821615611cbc576080611cb7826ffcbe86c7900a88aedcffc83b479aa3a46124ec565b901c90505b610200821615611ce7576080611ce2826ff987a7253ac413176f2b074cf7815e546124ec565b901c90505b610400821615611d12576080611d0d826ff3392b0822b70005940c7a398e4b70f36124ec565b901c90505b610800821615611d3d576080611d38826fe7159475a2c29b7443b29c7fa6e889d96124ec565b901c90505b611000821615611d68576080611d63826fd097f3bdfd2022b8845ad8f792aa58256124ec565b901c90505b612000821615611d93576080611d8e826fa9f746462d870fdf8a65dc1f90e061e56124ec565b901c90505b614000821615611dbe576080611db9826f70d869a156d2a1b890bb3df62baf32f76124ec565b901c90505b618000821615611de9576080611de4826f31be135f97d08fd981231505542fcfa66124ec565b901c90505b62010000821615611e15576080611e10826f09aa508b5b7a84e1c677de54f3e99bc96124ec565b901c90505b62020000821615611e40576080611e3b826e5d6af8dedb81196699c329225ee6046124ec565b901c90505b62040000821615611e6a576080611e65826d2216e584f5fa1ea926041bedfe986124ec565b901c90505b62080000821615611e92576080611e8d826b048a170391f7dc42444e8fa26124ec565b901c90505b60008460020b1315611ead57611eaa81600019612521565b90505b611ebc64010000000082612843565b15611ec8576001611ecb565b60005b6113899060ff16602083901c6125a4565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915290565b6001600160a01b0381168114610bd757600080fd5b600060208284031215611f3157600080fd5b81356109a481611f0a565b600060208284031215611f4e57600080fd5b5035919050565b60008060208385031215611f6857600080fd5b823567ffffffffffffffff80821115611f8057600080fd5b818501915085601f830112611f9457600080fd5b813581811115611fa357600080fd5b866020828501011115611fb557600080fd5b60209290920196919550909350505050565b60008083601f840112611fd957600080fd5b50813567ffffffffffffffff811115611ff157600080fd5b6020830191508360208260051b850101111561200c57600080fd5b9250929050565b6000806000806040858703121561202957600080fd5b843567ffffffffffffffff8082111561204157600080fd5b61204d88838901611fc7565b9096509450602087013591508082111561206657600080fd5b5061207387828801611fc7565b95989497509550505050565b6000806040838503121561209257600080fd5b823561209d81611f0a565b915060208301356120ad81611f0a565b809150509250929050565b60ff81168114610bd757600080fd5b6000806000606084860312156120dc57600080fd5b83356120e781611f0a565b925060208401356120f781611f0a565b91506040840135612107816120b8565b809150509250925092565b8015158114610bd757600080fd5b60008060006060848603121561213557600080fd5b833561214081611f0a565b925060208401359150604084013561210781612112565b6000806000806000806060878903121561217057600080fd5b863567ffffffffffffffff8082111561218857600080fd5b6121948a838b01611fc7565b909850965060208901359150808211156121ad57600080fd5b6121b98a838b01611fc7565b909650945060408901359150808211156121d257600080fd5b506121df89828a01611fc7565b979a9699509497509295939492505050565b8183823760009101908152919050565b6020808252600f908201526e696e76616c6964206c656e6774687360881b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060001982141561226a5761226a612240565b5060010190565b60006020828403121561228357600080fd5b5051919050565b60006020828403121561229c57600080fd5b81356109a4816120b8565b6000602082840312156122b957600080fd5b81516109a481611f0a565b6000602082840312156122d657600080fd5b81516109a481612112565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612320576123206122e1565b604052919050565b6000602080838503121561233b57600080fd5b825167ffffffffffffffff8082111561235357600080fd5b818501915085601f83011261236757600080fd5b815181811115612379576123796122e1565b61238b601f8201601f191685016122f7565b915080825286848285010111156123a157600080fd5b60005b818110156123bf5783810185015183820186015284016123a4565b818111156123d05760008583850101525b50909695505050505050565b6000602082840312156123ee57600080fd5b81516109a4816120b8565b600181815b8085111561243457816000190482111561241a5761241a612240565b8085161561242757918102915b93841c93908002906123fe565b509250929050565b60008261244b575060016105d9565b81612458575060006105d9565b816001811461246e576002811461247857612494565b60019150506105d9565b60ff84111561248957612489612240565b50506001821b6105d9565b5060208310610133831016604e8410600b84101617156124b7575081810a6105d9565b6124c183836123f9565b80600019048211156124d5576124d5612240565b029392505050565b60006109a460ff84168361243c565b600081600019048311821515161561250657612506612240565b500290565b634e487b7160e01b600052601260045260246000fd5b6000826125305761253061250b565b500490565b805169ffffffffffffffffffff8116811461254f57600080fd5b919050565b600080600080600060a0868803121561256c57600080fd5b61257586612535565b945060208601519350604086015192506060860151915061259860808701612535565b90509295509295909350565b600082198211156125b7576125b7612240565b500190565b6000828210156125ce576125ce612240565b500390565b6020808252825182820181905260009190848201906040850190845b818110156123d057835163ffffffff16835292840192918401916001016125ef565b600067ffffffffffffffff82111561262b5761262b6122e1565b5060051b60200190565b600082601f83011261264657600080fd5b8151602061265b61265683612611565b6122f7565b82815260059290921b8401810191818101908684111561267a57600080fd5b8286015b8481101561269e57805161269181611f0a565b835291830191830161267e565b509695505050505050565b600080604083850312156126bc57600080fd5b825167ffffffffffffffff808211156126d457600080fd5b818501915085601f8301126126e857600080fd5b815160206126f861265683612611565b82815260059290921b8401810191818101908984111561271757600080fd5b948201945b838610156127455785518060060b81146127365760008081fd5b8252948201949082019061271c565b9188015191965090935050508082111561275e57600080fd5b5061276b85828601612635565b9150509250929050565b60008160060b8360060b6000811281667fffffffffffff19018312811516156127a0576127a0612240565b81667fffffffffffff0183138116156127bb576127bb612240565b5090039392505050565b60008160060b8360060b806127dc576127dc61250b565b667fffffffffffff198214600019821416156127fa576127fa612240565b90059392505050565b60008160020b627fffff1981141561281d5761281d612240565b60000392915050565b6000600160ff1b82141561283c5761283c612240565b5060000390565b6000826128525761285261250b565b50069056fea2646970667358221220ef60f869492a344f69ba029d878b70231a0efdbf694849676fb05bce14dd837d64736f6c634300080a0033

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

0000000000000000000000000000000000000000000000000000000000000708000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b8419

-----Decoded View---------------
Arg [0] : twapPeriod_ (uint32): 1800
Arg [1] : baseUnderlying (address): 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
Arg [2] : baseAssetFeed_ (address): 0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000708
Arg [1] : 000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Arg [2] : 0000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b8419


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
[ Download: CSV Export  ]

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