ETH Price: $3,370.80 (-1.04%)

Contract

0xA68C6020fF9Ea79F05345cDd2CE37DF4b89478ed
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Update Rates115127692020-12-23 23:15:261488 days ago1608765326IN
0xA68C6020...4b89478ed
0 ETH0.03414891349.65
Update Rates115110952020-12-23 17:10:511488 days ago1608743451IN
0xA68C6020...4b89478ed
0 ETH0.01292121132.3
Freeze Rate115094562020-12-23 11:11:371489 days ago1608721897IN
0xA68C6020...4b89478ed
0 ETH0.01799164182.987
Update Rates115094242020-12-23 11:06:001489 days ago1608721560IN
0xA68C6020...4b89478ed
0 ETH0.01220336124.95
Update Rates115077662020-12-23 5:01:281489 days ago1608699688IN
0xA68C6020...4b89478ed
0 ETH0.0064811166.36
Update Rates115061042020-12-22 22:55:561489 days ago1608677756IN
0xA68C6020...4b89478ed
0 ETH0.0056060257.4
Update Rates115044842020-12-22 16:51:471489 days ago1608655907IN
0xA68C6020...4b89478ed
0 ETH0.01107532113.4
Update Rates115028132020-12-22 10:46:051490 days ago1608633965IN
0xA68C6020...4b89478ed
0 ETH0.0053325654.6
Update Rates115011292020-12-22 4:40:531490 days ago1608612053IN
0xA68C6020...4b89478ed
0 ETH0.0069391671.05
Update Rates114995202020-12-21 22:36:061490 days ago1608590166IN
0xA68C6020...4b89478ed
0 ETH0.0039378940.32
Update Rates114978702020-12-21 16:30:481491 days ago1608568248IN
0xA68C6020...4b89478ed
0 ETH0.0080711182.64
Update Rates114961982020-12-21 10:28:481491 days ago1608546528IN
0xA68C6020...4b89478ed
0 ETH0.0113146115.85
Update Rates114944932020-12-21 4:20:451491 days ago1608524445IN
0xA68C6020...4b89478ed
0 ETH0.0054692956
Update Rates114928912020-12-20 22:15:391491 days ago1608502539IN
0xA68C6020...4b89478ed
0 ETH0.02820105288.75
Update Rates114912162020-12-20 16:10:461492 days ago1608480646IN
0xA68C6020...4b89478ed
0 ETH0.0043754344.8
Update Rates114896192020-12-20 10:10:541492 days ago1608459054IN
0xA68C6020...4b89478ed
0 ETH0.0027688328.35
Update Rates114879602020-12-20 4:10:411492 days ago1608437441IN
0xA68C6020...4b89478ed
0 ETH0.0031790232.55
Update Rates114862922020-12-19 22:06:001492 days ago1608415560IN
0xA68C6020...4b89478ed
0 ETH0.0044096145.15
Update Rates114846642020-12-19 16:00:531493 days ago1608393653IN
0xA68C6020...4b89478ed
0 ETH0.0069733571.4
Update Rates114829652020-12-19 9:56:081493 days ago1608371768IN
0xA68C6020...4b89478ed
0 ETH0.0035550436.4
Update Rates114813302020-12-19 3:51:001493 days ago1608349860IN
0xA68C6020...4b89478ed
0 ETH0.0115197117.95
Update Rates114796942020-12-18 21:45:321493 days ago1608327932IN
0xA68C6020...4b89478ed
0 ETH0.0055376656.7
Update Rates114780422020-12-18 15:41:001494 days ago1608306060IN
0xA68C6020...4b89478ed
0 ETH0.0084090486.1
Update Rates114764302020-12-18 9:40:511494 days ago1608284451IN
0xA68C6020...4b89478ed
0 ETH0.0072468174.2
Update Rates114747602020-12-18 3:36:011494 days ago1608262561IN
0xA68C6020...4b89478ed
0 ETH0.0080672182.6
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block
From
To
117232342021-01-25 6:35:491456 days ago1611556549
0xA68C6020...4b89478ed
0 ETH
117232342021-01-25 6:35:491456 days ago1611556549
0xA68C6020...4b89478ed
0 ETH
117232342021-01-25 6:35:491456 days ago1611556549
0xA68C6020...4b89478ed
0 ETH
117232342021-01-25 6:35:491456 days ago1611556549
0xA68C6020...4b89478ed
0 ETH
115460842020-12-29 1:55:591483 days ago1609206959
0xA68C6020...4b89478ed
0 ETH
115460842020-12-29 1:55:591483 days ago1609206959
0xA68C6020...4b89478ed
0 ETH
115460842020-12-29 1:55:591483 days ago1609206959
0xA68C6020...4b89478ed
0 ETH
115460842020-12-29 1:55:591483 days ago1609206959
0xA68C6020...4b89478ed
0 ETH
115460842020-12-29 1:55:591483 days ago1609206959
0xA68C6020...4b89478ed
0 ETH
115460702020-12-29 1:53:591483 days ago1609206839
0xA68C6020...4b89478ed
0 ETH
115460702020-12-29 1:53:591483 days ago1609206839
0xA68C6020...4b89478ed
0 ETH
115460702020-12-29 1:53:591483 days ago1609206839
0xA68C6020...4b89478ed
0 ETH
115460702020-12-29 1:53:591483 days ago1609206839
0xA68C6020...4b89478ed
0 ETH
115460702020-12-29 1:53:591483 days ago1609206839
0xA68C6020...4b89478ed
0 ETH
115460512020-12-29 1:49:151483 days ago1609206555
0xA68C6020...4b89478ed
0 ETH
115460512020-12-29 1:49:151483 days ago1609206555
0xA68C6020...4b89478ed
0 ETH
115460512020-12-29 1:49:151483 days ago1609206555
0xA68C6020...4b89478ed
0 ETH
115460512020-12-29 1:49:151483 days ago1609206555
0xA68C6020...4b89478ed
0 ETH
115460512020-12-29 1:49:151483 days ago1609206555
0xA68C6020...4b89478ed
0 ETH
115455472020-12-28 23:56:421483 days ago1609199802
0xA68C6020...4b89478ed
0 ETH
115455472020-12-28 23:56:421483 days ago1609199802
0xA68C6020...4b89478ed
0 ETH
115455472020-12-28 23:56:421483 days ago1609199802
0xA68C6020...4b89478ed
0 ETH
115455472020-12-28 23:56:421483 days ago1609199802
0xA68C6020...4b89478ed
0 ETH
115455472020-12-28 23:56:421483 days ago1609199802
0xA68C6020...4b89478ed
0 ETH
115455352020-12-28 23:54:541483 days ago1609199694
0xA68C6020...4b89478ed
0 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ExchangeRates

Compiler Version
v0.5.16+commit.9c3226ce

Optimization Enabled:
Yes with 20000 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2020-11-12
*/

/*
   ____            __   __        __   _
  / __/__ __ ___  / /_ / /  ___  / /_ (_)__ __
 _\ \ / // // _ \/ __// _ \/ -_)/ __// / \ \ /
/___/ \_, //_//_/\__//_//_/\__/ \__//_/ /_\_\
     /___/

* Synthetix: ExchangeRates.sol
*
* Latest source (may be newer): https://github.com/Synthetixio/synthetix/blob/master/contracts/ExchangeRates.sol
* Docs: https://docs.synthetix.io/contracts/ExchangeRates
*
* Contract Dependencies: 
*	- IAddressResolver
*	- IExchangeRates
*	- MixinResolver
*	- MixinSystemSettings
*	- Owned
* Libraries: 
*	- SafeDecimalMath
*	- SafeMath
*
* MIT License
* ===========
*
* Copyright (c) 2020 Synthetix
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
*/



pragma solidity ^0.5.16;


// https://docs.synthetix.io/contracts/source/contracts/owned
contract Owned {
    address public owner;
    address public nominatedOwner;

    constructor(address _owner) public {
        require(_owner != address(0), "Owner address cannot be 0");
        owner = _owner;
        emit OwnerChanged(address(0), _owner);
    }

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

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

    modifier onlyOwner {
        _onlyOwner();
        _;
    }

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

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


// https://docs.synthetix.io/contracts/source/interfaces/iaddressresolver
interface IAddressResolver {
    function getAddress(bytes32 name) external view returns (address);

    function getSynth(bytes32 key) external view returns (address);

    function requireAndGetAddress(bytes32 name, string calldata reason) external view returns (address);
}


// https://docs.synthetix.io/contracts/source/interfaces/isynth
interface ISynth {
    // Views
    function currencyKey() external view returns (bytes32);

    function transferableSynths(address account) external view returns (uint);

    // Mutative functions
    function transferAndSettle(address to, uint value) external returns (bool);

    function transferFromAndSettle(
        address from,
        address to,
        uint value
    ) external returns (bool);

    // Restricted: used internally to Synthetix
    function burn(address account, uint amount) external;

    function issue(address account, uint amount) external;
}


// https://docs.synthetix.io/contracts/source/interfaces/iissuer
interface IIssuer {
    // Views
    function anySynthOrSNXRateIsInvalid() external view returns (bool anyRateInvalid);

    function availableCurrencyKeys() external view returns (bytes32[] memory);

    function availableSynthCount() external view returns (uint);

    function availableSynths(uint index) external view returns (ISynth);

    function canBurnSynths(address account) external view returns (bool);

    function collateral(address account) external view returns (uint);

    function collateralisationRatio(address issuer) external view returns (uint);

    function collateralisationRatioAndAnyRatesInvalid(address _issuer)
        external
        view
        returns (uint cratio, bool anyRateIsInvalid);

    function debtBalanceOf(address issuer, bytes32 currencyKey) external view returns (uint debtBalance);

    function issuanceRatio() external view returns (uint);

    function lastIssueEvent(address account) external view returns (uint);

    function maxIssuableSynths(address issuer) external view returns (uint maxIssuable);

    function minimumStakeTime() external view returns (uint);

    function remainingIssuableSynths(address issuer)
        external
        view
        returns (
            uint maxIssuable,
            uint alreadyIssued,
            uint totalSystemDebt
        );

    function synths(bytes32 currencyKey) external view returns (ISynth);

    function getSynths(bytes32[] calldata currencyKeys) external view returns (ISynth[] memory);

    function synthsByAddress(address synthAddress) external view returns (bytes32);

    function totalIssuedSynths(bytes32 currencyKey, bool excludeEtherCollateral) external view returns (uint);

    function transferableSynthetixAndAnyRateIsInvalid(address account, uint balance)
        external
        view
        returns (uint transferable, bool anyRateIsInvalid);

    // Restricted: used internally to Synthetix
    function issueSynths(address from, uint amount) external;

    function issueSynthsOnBehalf(
        address issueFor,
        address from,
        uint amount
    ) external;

    function issueMaxSynths(address from) external;

    function issueMaxSynthsOnBehalf(address issueFor, address from) external;

    function burnSynths(address from, uint amount) external;

    function burnSynthsOnBehalf(
        address burnForAddress,
        address from,
        uint amount
    ) external;

    function burnSynthsToTarget(address from) external;

    function burnSynthsToTargetOnBehalf(address burnForAddress, address from) external;

    function liquidateDelinquentAccount(
        address account,
        uint susdAmount,
        address liquidator
    ) external returns (uint totalRedeemed, uint amountToLiquidate);
}


// Inheritance


// https://docs.synthetix.io/contracts/source/contracts/addressresolver
contract AddressResolver is Owned, IAddressResolver {
    mapping(bytes32 => address) public repository;

    constructor(address _owner) public Owned(_owner) {}

    /* ========== MUTATIVE FUNCTIONS ========== */

    function importAddresses(bytes32[] calldata names, address[] calldata destinations) external onlyOwner {
        require(names.length == destinations.length, "Input lengths must match");

        for (uint i = 0; i < names.length; i++) {
            repository[names[i]] = destinations[i];
        }
    }

    /* ========== VIEWS ========== */

    function getAddress(bytes32 name) external view returns (address) {
        return repository[name];
    }

    function requireAndGetAddress(bytes32 name, string calldata reason) external view returns (address) {
        address _foundAddress = repository[name];
        require(_foundAddress != address(0), reason);
        return _foundAddress;
    }

    function getSynth(bytes32 key) external view returns (address) {
        IIssuer issuer = IIssuer(repository["Issuer"]);
        require(address(issuer) != address(0), "Cannot find Issuer address");
        return address(issuer.synths(key));
    }
}


// Inheritance


// Internal references


// https://docs.synthetix.io/contracts/source/contracts/mixinresolver
contract MixinResolver is Owned {
    AddressResolver public resolver;

    mapping(bytes32 => address) private addressCache;

    bytes32[] public resolverAddressesRequired;

    uint public constant MAX_ADDRESSES_FROM_RESOLVER = 24;

    constructor(address _resolver, bytes32[MAX_ADDRESSES_FROM_RESOLVER] memory _addressesToCache) internal {
        // This contract is abstract, and thus cannot be instantiated directly
        require(owner != address(0), "Owner must be set");

        for (uint i = 0; i < _addressesToCache.length; i++) {
            if (_addressesToCache[i] != bytes32(0)) {
                resolverAddressesRequired.push(_addressesToCache[i]);
            } else {
                // End early once an empty item is found - assumes there are no empty slots in
                // _addressesToCache
                break;
            }
        }
        resolver = AddressResolver(_resolver);
        // Do not sync the cache as addresses may not be in the resolver yet
    }

    /* ========== SETTERS ========== */
    function setResolverAndSyncCache(AddressResolver _resolver) external onlyOwner {
        resolver = _resolver;

        for (uint i = 0; i < resolverAddressesRequired.length; i++) {
            bytes32 name = resolverAddressesRequired[i];
            // Note: can only be invoked once the resolver has all the targets needed added
            addressCache[name] = resolver.requireAndGetAddress(name, "Resolver missing target");
        }
    }

    /* ========== VIEWS ========== */

    function requireAndGetAddress(bytes32 name, string memory reason) internal view returns (address) {
        address _foundAddress = addressCache[name];
        require(_foundAddress != address(0), reason);
        return _foundAddress;
    }

    // Note: this could be made external in a utility contract if addressCache was made public
    // (used for deployment)
    function isResolverCached(AddressResolver _resolver) external view returns (bool) {
        if (resolver != _resolver) {
            return false;
        }

        // otherwise, check everything
        for (uint i = 0; i < resolverAddressesRequired.length; i++) {
            bytes32 name = resolverAddressesRequired[i];
            // false if our cache is invalid or if the resolver doesn't have the required address
            if (resolver.getAddress(name) != addressCache[name] || addressCache[name] == address(0)) {
                return false;
            }
        }

        return true;
    }

    // Note: can be made external into a utility contract (used for deployment)
    function getResolverAddressesRequired()
        external
        view
        returns (bytes32[MAX_ADDRESSES_FROM_RESOLVER] memory addressesRequired)
    {
        for (uint i = 0; i < resolverAddressesRequired.length; i++) {
            addressesRequired[i] = resolverAddressesRequired[i];
        }
    }

    /* ========== INTERNAL FUNCTIONS ========== */
    function appendToAddressCache(bytes32 name) internal {
        resolverAddressesRequired.push(name);
        require(resolverAddressesRequired.length < MAX_ADDRESSES_FROM_RESOLVER, "Max resolver cache size met");
        // Because this is designed to be called internally in constructors, we don't
        // check the address exists already in the resolver
        addressCache[name] = resolver.getAddress(name);
    }
}


// https://docs.synthetix.io/contracts/source/interfaces/iflexiblestorage
interface IFlexibleStorage {
    // Views
    function getUIntValue(bytes32 contractName, bytes32 record) external view returns (uint);

    function getUIntValues(bytes32 contractName, bytes32[] calldata records) external view returns (uint[] memory);

    function getIntValue(bytes32 contractName, bytes32 record) external view returns (int);

    function getIntValues(bytes32 contractName, bytes32[] calldata records) external view returns (int[] memory);

    function getAddressValue(bytes32 contractName, bytes32 record) external view returns (address);

    function getAddressValues(bytes32 contractName, bytes32[] calldata records) external view returns (address[] memory);

    function getBoolValue(bytes32 contractName, bytes32 record) external view returns (bool);

    function getBoolValues(bytes32 contractName, bytes32[] calldata records) external view returns (bool[] memory);

    function getBytes32Value(bytes32 contractName, bytes32 record) external view returns (bytes32);

    function getBytes32Values(bytes32 contractName, bytes32[] calldata records) external view returns (bytes32[] memory);

    // Mutative functions
    function deleteUIntValue(bytes32 contractName, bytes32 record) external;

    function deleteIntValue(bytes32 contractName, bytes32 record) external;

    function deleteAddressValue(bytes32 contractName, bytes32 record) external;

    function deleteBoolValue(bytes32 contractName, bytes32 record) external;

    function deleteBytes32Value(bytes32 contractName, bytes32 record) external;

    function setUIntValue(
        bytes32 contractName,
        bytes32 record,
        uint value
    ) external;

    function setUIntValues(
        bytes32 contractName,
        bytes32[] calldata records,
        uint[] calldata values
    ) external;

    function setIntValue(
        bytes32 contractName,
        bytes32 record,
        int value
    ) external;

    function setIntValues(
        bytes32 contractName,
        bytes32[] calldata records,
        int[] calldata values
    ) external;

    function setAddressValue(
        bytes32 contractName,
        bytes32 record,
        address value
    ) external;

    function setAddressValues(
        bytes32 contractName,
        bytes32[] calldata records,
        address[] calldata values
    ) external;

    function setBoolValue(
        bytes32 contractName,
        bytes32 record,
        bool value
    ) external;

    function setBoolValues(
        bytes32 contractName,
        bytes32[] calldata records,
        bool[] calldata values
    ) external;

    function setBytes32Value(
        bytes32 contractName,
        bytes32 record,
        bytes32 value
    ) external;

    function setBytes32Values(
        bytes32 contractName,
        bytes32[] calldata records,
        bytes32[] calldata values
    ) external;
}


// Internal references


// https://docs.synthetix.io/contracts/source/contracts/mixinsystemsettings
contract MixinSystemSettings is MixinResolver {
    bytes32 internal constant SETTING_CONTRACT_NAME = "SystemSettings";

    bytes32 internal constant SETTING_WAITING_PERIOD_SECS = "waitingPeriodSecs";
    bytes32 internal constant SETTING_PRICE_DEVIATION_THRESHOLD_FACTOR = "priceDeviationThresholdFactor";
    bytes32 internal constant SETTING_ISSUANCE_RATIO = "issuanceRatio";
    bytes32 internal constant SETTING_FEE_PERIOD_DURATION = "feePeriodDuration";
    bytes32 internal constant SETTING_TARGET_THRESHOLD = "targetThreshold";
    bytes32 internal constant SETTING_LIQUIDATION_DELAY = "liquidationDelay";
    bytes32 internal constant SETTING_LIQUIDATION_RATIO = "liquidationRatio";
    bytes32 internal constant SETTING_LIQUIDATION_PENALTY = "liquidationPenalty";
    bytes32 internal constant SETTING_RATE_STALE_PERIOD = "rateStalePeriod";
    bytes32 internal constant SETTING_EXCHANGE_FEE_RATE = "exchangeFeeRate";
    bytes32 internal constant SETTING_MINIMUM_STAKE_TIME = "minimumStakeTime";
    bytes32 internal constant SETTING_AGGREGATOR_WARNING_FLAGS = "aggregatorWarningFlags";
    bytes32 internal constant SETTING_TRADING_REWARDS_ENABLED = "tradingRewardsEnabled";
    bytes32 internal constant SETTING_DEBT_SNAPSHOT_STALE_TIME = "debtSnapshotStaleTime";

    bytes32 private constant CONTRACT_FLEXIBLESTORAGE = "FlexibleStorage";

    constructor() internal {
        appendToAddressCache(CONTRACT_FLEXIBLESTORAGE);
    }

    function flexibleStorage() internal view returns (IFlexibleStorage) {
        return IFlexibleStorage(requireAndGetAddress(CONTRACT_FLEXIBLESTORAGE, "Missing FlexibleStorage address"));
    }

    function getTradingRewardsEnabled() internal view returns (bool) {
        return flexibleStorage().getBoolValue(SETTING_CONTRACT_NAME, SETTING_TRADING_REWARDS_ENABLED);
    }

    function getWaitingPeriodSecs() internal view returns (uint) {
        return flexibleStorage().getUIntValue(SETTING_CONTRACT_NAME, SETTING_WAITING_PERIOD_SECS);
    }

    function getPriceDeviationThresholdFactor() internal view returns (uint) {
        return flexibleStorage().getUIntValue(SETTING_CONTRACT_NAME, SETTING_PRICE_DEVIATION_THRESHOLD_FACTOR);
    }

    function getIssuanceRatio() internal view returns (uint) {
        // lookup on flexible storage directly for gas savings (rather than via SystemSettings)
        return flexibleStorage().getUIntValue(SETTING_CONTRACT_NAME, SETTING_ISSUANCE_RATIO);
    }

    function getFeePeriodDuration() internal view returns (uint) {
        // lookup on flexible storage directly for gas savings (rather than via SystemSettings)
        return flexibleStorage().getUIntValue(SETTING_CONTRACT_NAME, SETTING_FEE_PERIOD_DURATION);
    }

    function getTargetThreshold() internal view returns (uint) {
        // lookup on flexible storage directly for gas savings (rather than via SystemSettings)
        return flexibleStorage().getUIntValue(SETTING_CONTRACT_NAME, SETTING_TARGET_THRESHOLD);
    }

    function getLiquidationDelay() internal view returns (uint) {
        return flexibleStorage().getUIntValue(SETTING_CONTRACT_NAME, SETTING_LIQUIDATION_DELAY);
    }

    function getLiquidationRatio() internal view returns (uint) {
        return flexibleStorage().getUIntValue(SETTING_CONTRACT_NAME, SETTING_LIQUIDATION_RATIO);
    }

    function getLiquidationPenalty() internal view returns (uint) {
        return flexibleStorage().getUIntValue(SETTING_CONTRACT_NAME, SETTING_LIQUIDATION_PENALTY);
    }

    function getRateStalePeriod() internal view returns (uint) {
        return flexibleStorage().getUIntValue(SETTING_CONTRACT_NAME, SETTING_RATE_STALE_PERIOD);
    }

    function getExchangeFeeRate(bytes32 currencyKey) internal view returns (uint) {
        return
            flexibleStorage().getUIntValue(
                SETTING_CONTRACT_NAME,
                keccak256(abi.encodePacked(SETTING_EXCHANGE_FEE_RATE, currencyKey))
            );
    }

    function getMinimumStakeTime() internal view returns (uint) {
        return flexibleStorage().getUIntValue(SETTING_CONTRACT_NAME, SETTING_MINIMUM_STAKE_TIME);
    }

    function getAggregatorWarningFlags() internal view returns (address) {
        return flexibleStorage().getAddressValue(SETTING_CONTRACT_NAME, SETTING_AGGREGATOR_WARNING_FLAGS);
    }

    function getDebtSnapshotStaleTime() internal view returns (uint) {
        return flexibleStorage().getUIntValue(SETTING_CONTRACT_NAME, SETTING_DEBT_SNAPSHOT_STALE_TIME);
    }
}


// https://docs.synthetix.io/contracts/source/interfaces/iexchangerates
interface IExchangeRates {
    // Structs
    struct RateAndUpdatedTime {
        uint216 rate;
        uint40 time;
    }

    struct InversePricing {
        uint entryPoint;
        uint upperLimit;
        uint lowerLimit;
        bool frozenAtUpperLimit;
        bool frozenAtLowerLimit;
    }

    // Views
    function aggregators(bytes32 currencyKey) external view returns (address);

    function aggregatorWarningFlags() external view returns (address);

    function anyRateIsInvalid(bytes32[] calldata currencyKeys) external view returns (bool);

    function canFreezeRate(bytes32 currencyKey) external view returns (bool);

    function currentRoundForRate(bytes32 currencyKey) external view returns (uint);

    function currenciesUsingAggregator(address aggregator) external view returns (bytes32[] memory);

    function effectiveValue(
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey
    ) external view returns (uint value);

    function effectiveValueAndRates(
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey
    )
        external
        view
        returns (
            uint value,
            uint sourceRate,
            uint destinationRate
        );

    function effectiveValueAtRound(
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey,
        uint roundIdForSrc,
        uint roundIdForDest
    ) external view returns (uint value);

    function getCurrentRoundId(bytes32 currencyKey) external view returns (uint);

    function getLastRoundIdBeforeElapsedSecs(
        bytes32 currencyKey,
        uint startingRoundId,
        uint startingTimestamp,
        uint timediff
    ) external view returns (uint);

    function inversePricing(bytes32 currencyKey)
        external
        view
        returns (
            uint entryPoint,
            uint upperLimit,
            uint lowerLimit,
            bool frozenAtUpperLimit,
            bool frozenAtLowerLimit
        );

    function lastRateUpdateTimes(bytes32 currencyKey) external view returns (uint256);

    function oracle() external view returns (address);

    function rateAndTimestampAtRound(bytes32 currencyKey, uint roundId) external view returns (uint rate, uint time);

    function rateAndUpdatedTime(bytes32 currencyKey) external view returns (uint rate, uint time);

    function rateAndInvalid(bytes32 currencyKey) external view returns (uint rate, bool isInvalid);

    function rateForCurrency(bytes32 currencyKey) external view returns (uint);

    function rateIsFlagged(bytes32 currencyKey) external view returns (bool);

    function rateIsFrozen(bytes32 currencyKey) external view returns (bool);

    function rateIsInvalid(bytes32 currencyKey) external view returns (bool);

    function rateIsStale(bytes32 currencyKey) external view returns (bool);

    function rateStalePeriod() external view returns (uint);

    function ratesAndUpdatedTimeForCurrencyLastNRounds(bytes32 currencyKey, uint numRounds)
        external
        view
        returns (uint[] memory rates, uint[] memory times);

    function ratesAndInvalidForCurrencies(bytes32[] calldata currencyKeys)
        external
        view
        returns (uint[] memory rates, bool anyRateInvalid);

    function ratesForCurrencies(bytes32[] calldata currencyKeys) external view returns (uint[] memory);

    // Mutative functions
    function freezeRate(bytes32 currencyKey) external;
}


/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");

        return c;
    }

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

        return c;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
        if (a == 0) {
            return 0;
        }

        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");

        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        // Solidity only automatically asserts when dividing by 0
        require(b > 0, "SafeMath: division by zero");
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold

        return c;
    }

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


// Libraries


// https://docs.synthetix.io/contracts/source/libraries/safedecimalmath
library SafeDecimalMath {
    using SafeMath for uint;

    /* Number of decimal places in the representations. */
    uint8 public constant decimals = 18;
    uint8 public constant highPrecisionDecimals = 27;

    /* The number representing 1.0. */
    uint public constant UNIT = 10**uint(decimals);

    /* The number representing 1.0 for higher fidelity numbers. */
    uint public constant PRECISE_UNIT = 10**uint(highPrecisionDecimals);
    uint private constant UNIT_TO_HIGH_PRECISION_CONVERSION_FACTOR = 10**uint(highPrecisionDecimals - decimals);

    /**
     * @return Provides an interface to UNIT.
     */
    function unit() external pure returns (uint) {
        return UNIT;
    }

    /**
     * @return Provides an interface to PRECISE_UNIT.
     */
    function preciseUnit() external pure returns (uint) {
        return PRECISE_UNIT;
    }

    /**
     * @return The result of multiplying x and y, interpreting the operands as fixed-point
     * decimals.
     *
     * @dev A unit factor is divided out after the product of x and y is evaluated,
     * so that product must be less than 2**256. As this is an integer division,
     * the internal division always rounds down. This helps save on gas. Rounding
     * is more expensive on gas.
     */
    function multiplyDecimal(uint x, uint y) internal pure returns (uint) {
        /* Divide by UNIT to remove the extra factor introduced by the product. */
        return x.mul(y) / UNIT;
    }

    /**
     * @return The result of safely multiplying x and y, interpreting the operands
     * as fixed-point decimals of the specified precision unit.
     *
     * @dev The operands should be in the form of a the specified unit factor which will be
     * divided out after the product of x and y is evaluated, so that product must be
     * less than 2**256.
     *
     * Unlike multiplyDecimal, this function rounds the result to the nearest increment.
     * Rounding is useful when you need to retain fidelity for small decimal numbers
     * (eg. small fractions or percentages).
     */
    function _multiplyDecimalRound(
        uint x,
        uint y,
        uint precisionUnit
    ) private pure returns (uint) {
        /* Divide by UNIT to remove the extra factor introduced by the product. */
        uint quotientTimesTen = x.mul(y) / (precisionUnit / 10);

        if (quotientTimesTen % 10 >= 5) {
            quotientTimesTen += 10;
        }

        return quotientTimesTen / 10;
    }

    /**
     * @return The result of safely multiplying x and y, interpreting the operands
     * as fixed-point decimals of a precise unit.
     *
     * @dev The operands should be in the precise unit factor which will be
     * divided out after the product of x and y is evaluated, so that product must be
     * less than 2**256.
     *
     * Unlike multiplyDecimal, this function rounds the result to the nearest increment.
     * Rounding is useful when you need to retain fidelity for small decimal numbers
     * (eg. small fractions or percentages).
     */
    function multiplyDecimalRoundPrecise(uint x, uint y) internal pure returns (uint) {
        return _multiplyDecimalRound(x, y, PRECISE_UNIT);
    }

    /**
     * @return The result of safely multiplying x and y, interpreting the operands
     * as fixed-point decimals of a standard unit.
     *
     * @dev The operands should be in the standard unit factor which will be
     * divided out after the product of x and y is evaluated, so that product must be
     * less than 2**256.
     *
     * Unlike multiplyDecimal, this function rounds the result to the nearest increment.
     * Rounding is useful when you need to retain fidelity for small decimal numbers
     * (eg. small fractions or percentages).
     */
    function multiplyDecimalRound(uint x, uint y) internal pure returns (uint) {
        return _multiplyDecimalRound(x, y, UNIT);
    }

    /**
     * @return The result of safely dividing x and y. The return value is a high
     * precision decimal.
     *
     * @dev y is divided after the product of x and the standard precision unit
     * is evaluated, so the product of x and UNIT must be less than 2**256. As
     * this is an integer division, the result is always rounded down.
     * This helps save on gas. Rounding is more expensive on gas.
     */
    function divideDecimal(uint x, uint y) internal pure returns (uint) {
        /* Reintroduce the UNIT factor that will be divided out by y. */
        return x.mul(UNIT).div(y);
    }

    /**
     * @return The result of safely dividing x and y. The return value is as a rounded
     * decimal in the precision unit specified in the parameter.
     *
     * @dev y is divided after the product of x and the specified precision unit
     * is evaluated, so the product of x and the specified precision unit must
     * be less than 2**256. The result is rounded to the nearest increment.
     */
    function _divideDecimalRound(
        uint x,
        uint y,
        uint precisionUnit
    ) private pure returns (uint) {
        uint resultTimesTen = x.mul(precisionUnit * 10).div(y);

        if (resultTimesTen % 10 >= 5) {
            resultTimesTen += 10;
        }

        return resultTimesTen / 10;
    }

    /**
     * @return The result of safely dividing x and y. The return value is as a rounded
     * standard precision decimal.
     *
     * @dev y is divided after the product of x and the standard precision unit
     * is evaluated, so the product of x and the standard precision unit must
     * be less than 2**256. The result is rounded to the nearest increment.
     */
    function divideDecimalRound(uint x, uint y) internal pure returns (uint) {
        return _divideDecimalRound(x, y, UNIT);
    }

    /**
     * @return The result of safely dividing x and y. The return value is as a rounded
     * high precision decimal.
     *
     * @dev y is divided after the product of x and the high precision unit
     * is evaluated, so the product of x and the high precision unit must
     * be less than 2**256. The result is rounded to the nearest increment.
     */
    function divideDecimalRoundPrecise(uint x, uint y) internal pure returns (uint) {
        return _divideDecimalRound(x, y, PRECISE_UNIT);
    }

    /**
     * @dev Convert a standard decimal representation to a high precision one.
     */
    function decimalToPreciseDecimal(uint i) internal pure returns (uint) {
        return i.mul(UNIT_TO_HIGH_PRECISION_CONVERSION_FACTOR);
    }

    /**
     * @dev Convert a high precision decimal to a standard decimal representation.
     */
    function preciseDecimalToDecimal(uint i) internal pure returns (uint) {
        uint quotientTimesTen = i / (UNIT_TO_HIGH_PRECISION_CONVERSION_FACTOR / 10);

        if (quotientTimesTen % 10 >= 5) {
            quotientTimesTen += 10;
        }

        return quotientTimesTen / 10;
    }
}


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

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


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

}


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

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

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

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

}


interface FlagsInterface {
  function getFlag(address) external view returns (bool);
  function getFlags(address[] calldata) external view returns (bool[] memory);
  function raiseFlag(address) external;
  function raiseFlags(address[] calldata) external;
  function lowerFlags(address[] calldata) external;
  function setRaisingAccessController(address) external;
}


interface IVirtualSynth {
    // Views
    function balanceOfUnderlying(address account) external view returns (uint);

    function rate() external view returns (uint);

    function readyToSettle() external view returns (bool);

    function secsLeftInWaitingPeriod() external view returns (uint);

    function settled() external view returns (bool);

    function synth() external view returns (ISynth);

    // Mutative functions
    function settle(address account) external;
}


// https://docs.synthetix.io/contracts/source/interfaces/iexchanger
interface IExchanger {
    // Views
    function calculateAmountAfterSettlement(
        address from,
        bytes32 currencyKey,
        uint amount,
        uint refunded
    ) external view returns (uint amountAfterSettlement);

    function isSynthRateInvalid(bytes32 currencyKey) external view returns (bool);

    function maxSecsLeftInWaitingPeriod(address account, bytes32 currencyKey) external view returns (uint);

    function settlementOwing(address account, bytes32 currencyKey)
        external
        view
        returns (
            uint reclaimAmount,
            uint rebateAmount,
            uint numEntries
        );

    function hasWaitingPeriodOrSettlementOwing(address account, bytes32 currencyKey) external view returns (bool);

    function feeRateForExchange(bytes32 sourceCurrencyKey, bytes32 destinationCurrencyKey)
        external
        view
        returns (uint exchangeFeeRate);

    function getAmountsForExchange(
        uint sourceAmount,
        bytes32 sourceCurrencyKey,
        bytes32 destinationCurrencyKey
    )
        external
        view
        returns (
            uint amountReceived,
            uint fee,
            uint exchangeFeeRate
        );

    function priceDeviationThresholdFactor() external view returns (uint);

    function waitingPeriodSecs() external view returns (uint);

    // Mutative functions
    function exchange(
        address from,
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey,
        address destinationAddress
    ) external returns (uint amountReceived);

    function exchangeOnBehalf(
        address exchangeForAddress,
        address from,
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey
    ) external returns (uint amountReceived);

    function exchangeWithTracking(
        address from,
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey,
        address destinationAddress,
        address originator,
        bytes32 trackingCode
    ) external returns (uint amountReceived);

    function exchangeOnBehalfWithTracking(
        address exchangeForAddress,
        address from,
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey,
        address originator,
        bytes32 trackingCode
    ) external returns (uint amountReceived);

    function exchangeWithVirtual(
        address from,
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey,
        address destinationAddress
    ) external returns (uint amountReceived, IVirtualSynth vSynth);


    function settle(address from, bytes32 currencyKey)
        external
        returns (
            uint reclaimed,
            uint refunded,
            uint numEntries
        );

    function setLastExchangeRateForSynth(bytes32 currencyKey, uint rate) external;

    function suspendSynthWithInvalidRate(bytes32 currencyKey) external;
}


// Inheritance


// Libraries


// Internal references
// AggregatorInterface from Chainlink represents a decentralized pricing network for a single currency key

// FlagsInterface from Chainlink addresses SIP-76


// https://docs.synthetix.io/contracts/source/contracts/exchangerates
contract ExchangeRates is Owned, MixinResolver, MixinSystemSettings, IExchangeRates {
    using SafeMath for uint;
    using SafeDecimalMath for uint;

    // Exchange rates and update times stored by currency code, e.g. 'SNX', or 'sUSD'
    mapping(bytes32 => mapping(uint => RateAndUpdatedTime)) private _rates;

    // The address of the oracle which pushes rate updates to this contract
    address public oracle;

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

    mapping(bytes32 => uint8) public currencyKeyDecimals;

    // List of aggregator keys for convenient iteration
    bytes32[] public aggregatorKeys;

    // Do not allow the oracle to submit times any further forward into the future than this constant.
    uint private constant ORACLE_FUTURE_LIMIT = 10 minutes;

    mapping(bytes32 => InversePricing) public inversePricing;

    bytes32[] public invertedKeys;

    mapping(bytes32 => uint) public currentRoundForRate;

    mapping(bytes32 => uint) public roundFrozen;

    /* ========== ADDRESS RESOLVER CONFIGURATION ========== */
    bytes32 private constant CONTRACT_EXCHANGER = "Exchanger";

    bytes32[24] private addressesToCache = [CONTRACT_EXCHANGER];

    //
    // ========== CONSTRUCTOR ==========

    constructor(
        address _owner,
        address _oracle,
        address _resolver,
        bytes32[] memory _currencyKeys,
        uint[] memory _newRates
    ) public Owned(_owner) MixinResolver(_resolver, addressesToCache) MixinSystemSettings() {
        require(_currencyKeys.length == _newRates.length, "Currency key length and rate length must match.");

        oracle = _oracle;

        // The sUSD rate is always 1 and is never stale.
        _setRate("sUSD", SafeDecimalMath.unit(), now);

        internalUpdateRates(_currencyKeys, _newRates, now);
    }

    /* ========== SETTERS ========== */

    function setOracle(address _oracle) external onlyOwner {
        oracle = _oracle;
        emit OracleUpdated(oracle);
    }

    /* ========== MUTATIVE FUNCTIONS ========== */

    function updateRates(
        bytes32[] calldata currencyKeys,
        uint[] calldata newRates,
        uint timeSent
    ) external onlyOracle returns (bool) {
        return internalUpdateRates(currencyKeys, newRates, timeSent);
    }

    function deleteRate(bytes32 currencyKey) external onlyOracle {
        require(_getRate(currencyKey) > 0, "Rate is zero");

        delete _rates[currencyKey][currentRoundForRate[currencyKey]];

        currentRoundForRate[currencyKey]--;

        emit RateDeleted(currencyKey);
    }

    function setInversePricing(
        bytes32 currencyKey,
        uint entryPoint,
        uint upperLimit,
        uint lowerLimit,
        bool freezeAtUpperLimit,
        bool freezeAtLowerLimit
    ) external onlyOwner {
        // 0 < lowerLimit < entryPoint => 0 < entryPoint
        require(lowerLimit > 0, "lowerLimit must be above 0");
        require(upperLimit > entryPoint, "upperLimit must be above the entryPoint");
        require(upperLimit < entryPoint.mul(2), "upperLimit must be less than double entryPoint");
        require(lowerLimit < entryPoint, "lowerLimit must be below the entryPoint");

        require(!(freezeAtUpperLimit && freezeAtLowerLimit), "Cannot freeze at both limits");

        InversePricing storage inverse = inversePricing[currencyKey];
        if (inverse.entryPoint == 0) {
            // then we are adding a new inverse pricing, so add this
            invertedKeys.push(currencyKey);
        }
        inverse.entryPoint = entryPoint;
        inverse.upperLimit = upperLimit;
        inverse.lowerLimit = lowerLimit;

        if (freezeAtUpperLimit || freezeAtLowerLimit) {
            // When indicating to freeze, we need to know the rate to freeze it at - either upper or lower
            // this is useful in situations where ExchangeRates is updated and there are existing inverted
            // rates already frozen in the current contract that need persisting across the upgrade

            inverse.frozenAtUpperLimit = freezeAtUpperLimit;
            inverse.frozenAtLowerLimit = freezeAtLowerLimit;
            uint roundId = _getCurrentRoundId(currencyKey);
            roundFrozen[currencyKey] = roundId;
            emit InversePriceFrozen(currencyKey, freezeAtUpperLimit ? upperLimit : lowerLimit, roundId, msg.sender);
        } else {
            // unfreeze if need be
            inverse.frozenAtUpperLimit = false;
            inverse.frozenAtLowerLimit = false;
            // remove any tracking
            roundFrozen[currencyKey] = 0;
        }

        // SIP-78
        uint rate = _getRate(currencyKey);
        if (rate > 0) {
            exchanger().setLastExchangeRateForSynth(currencyKey, rate);
        }

        emit InversePriceConfigured(currencyKey, entryPoint, upperLimit, lowerLimit);
    }

    function removeInversePricing(bytes32 currencyKey) external onlyOwner {
        require(inversePricing[currencyKey].entryPoint > 0, "No inverted price exists");

        delete inversePricing[currencyKey];

        // now remove inverted key from array
        bool wasRemoved = removeFromArray(currencyKey, invertedKeys);

        if (wasRemoved) {
            emit InversePriceConfigured(currencyKey, 0, 0, 0);
        }
    }

    function addAggregator(bytes32 currencyKey, address aggregatorAddress) external onlyOwner {
        AggregatorV2V3Interface aggregator = AggregatorV2V3Interface(aggregatorAddress);
        // This check tries to make sure that a valid aggregator is being added.
        // It checks if the aggregator is an existing smart contract that has implemented `latestTimestamp` function.

        require(aggregator.latestRound() >= 0, "Given Aggregator is invalid");
        uint8 decimals = aggregator.decimals();
        require(decimals <= 18, "Aggregator decimals should be lower or equal to 18");
        if (address(aggregators[currencyKey]) == address(0)) {
            aggregatorKeys.push(currencyKey);
        }
        aggregators[currencyKey] = aggregator;
        currencyKeyDecimals[currencyKey] = decimals;
        emit AggregatorAdded(currencyKey, address(aggregator));
    }

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

        bool wasRemoved = removeFromArray(currencyKey, aggregatorKeys);

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

    // SIP-75 Public keeper function to freeze a synth that is out of bounds
    function freezeRate(bytes32 currencyKey) external {
        InversePricing storage inverse = inversePricing[currencyKey];
        require(inverse.entryPoint > 0, "Cannot freeze non-inverse rate");
        require(!inverse.frozenAtUpperLimit && !inverse.frozenAtLowerLimit, "The rate is already frozen");

        uint rate = _getRate(currencyKey);

        if (rate > 0 && (rate >= inverse.upperLimit || rate <= inverse.lowerLimit)) {
            inverse.frozenAtUpperLimit = (rate == inverse.upperLimit);
            inverse.frozenAtLowerLimit = (rate == inverse.lowerLimit);
            uint currentRoundId = _getCurrentRoundId(currencyKey);
            roundFrozen[currencyKey] = currentRoundId;
            emit InversePriceFrozen(currencyKey, rate, currentRoundId, msg.sender);
        } else {
            revert("Rate within bounds");
        }
    }

    /* ========== VIEWS ========== */

    // SIP-75 View to determine if freezeRate can be called safely
    function canFreezeRate(bytes32 currencyKey) external view returns (bool) {
        InversePricing memory inverse = inversePricing[currencyKey];
        if (inverse.entryPoint == 0 || inverse.frozenAtUpperLimit || inverse.frozenAtLowerLimit) {
            return false;
        } else {
            uint rate = _getRate(currencyKey);
            return (rate > 0 && (rate >= inverse.upperLimit || rate <= inverse.lowerLimit));
        }
    }

    function currenciesUsingAggregator(address aggregator) external view returns (bytes32[] memory currencies) {
        uint count = 0;
        currencies = new bytes32[](aggregatorKeys.length);
        for (uint i = 0; i < aggregatorKeys.length; i++) {
            bytes32 currencyKey = aggregatorKeys[i];
            if (address(aggregators[currencyKey]) == aggregator) {
                currencies[count++] = currencyKey;
            }
        }
    }

    function rateStalePeriod() external view returns (uint) {
        return getRateStalePeriod();
    }

    function aggregatorWarningFlags() external view returns (address) {
        return getAggregatorWarningFlags();
    }

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

    function getLastRoundIdBeforeElapsedSecs(
        bytes32 currencyKey,
        uint startingRoundId,
        uint startingTimestamp,
        uint timediff
    ) external view returns (uint) {
        uint roundId = startingRoundId;
        uint nextTimestamp = 0;
        while (true) {
            (, nextTimestamp) = _getRateAndTimestampAtRound(currencyKey, roundId + 1);
            // if there's no new round, then the previous roundId was the latest
            if (nextTimestamp == 0 || nextTimestamp > startingTimestamp + timediff) {
                return roundId;
            }
            roundId++;
        }
        return roundId;
    }

    function getCurrentRoundId(bytes32 currencyKey) external view returns (uint) {
        return _getCurrentRoundId(currencyKey);
    }

    function effectiveValueAtRound(
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey,
        uint roundIdForSrc,
        uint roundIdForDest
    ) external view returns (uint value) {
        // If there's no change in the currency, then just return the amount they gave us
        if (sourceCurrencyKey == destinationCurrencyKey) return sourceAmount;

        (uint srcRate, ) = _getRateAndTimestampAtRound(sourceCurrencyKey, roundIdForSrc);
        (uint destRate, ) = _getRateAndTimestampAtRound(destinationCurrencyKey, roundIdForDest);
        if (destRate == 0) {
            // prevent divide-by 0 error (this can happen when roundIDs jump epochs due
            // to aggregator upgrades)
            return 0;
        }
        // Calculate the effective value by going from source -> USD -> destination
        value = sourceAmount.multiplyDecimalRound(srcRate).divideDecimalRound(destRate);
    }

    function rateAndTimestampAtRound(bytes32 currencyKey, uint roundId) external view returns (uint rate, uint time) {
        return _getRateAndTimestampAtRound(currencyKey, roundId);
    }

    function lastRateUpdateTimes(bytes32 currencyKey) external view returns (uint256) {
        return _getUpdatedTime(currencyKey);
    }

    function lastRateUpdateTimesForCurrencies(bytes32[] calldata currencyKeys) external view returns (uint[] memory) {
        uint[] memory lastUpdateTimes = new uint[](currencyKeys.length);

        for (uint i = 0; i < currencyKeys.length; i++) {
            lastUpdateTimes[i] = _getUpdatedTime(currencyKeys[i]);
        }

        return lastUpdateTimes;
    }

    function effectiveValue(
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey
    ) external view returns (uint value) {
        (value, , ) = _effectiveValueAndRates(sourceCurrencyKey, sourceAmount, destinationCurrencyKey);
    }

    function effectiveValueAndRates(
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey
    )
        external
        view
        returns (
            uint value,
            uint sourceRate,
            uint destinationRate
        )
    {
        return _effectiveValueAndRates(sourceCurrencyKey, sourceAmount, destinationCurrencyKey);
    }

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

    function ratesAndUpdatedTimeForCurrencyLastNRounds(bytes32 currencyKey, uint numRounds)
        external
        view
        returns (uint[] memory rates, uint[] memory times)
    {
        rates = new uint[](numRounds);
        times = new uint[](numRounds);

        uint roundId = _getCurrentRoundId(currencyKey);
        for (uint i = 0; i < numRounds; i++) {
            // fetch the rate and treat is as current, so inverse limits if frozen will always be applied
            // regardless of current rate
            (rates[i], times[i]) = _getRateAndTimestampAtRound(currencyKey, roundId);

            if (roundId == 0) {
                // if we hit the last round, then return what we have
                return (rates, times);
            } else {
                roundId--;
            }
        }
    }

    function ratesForCurrencies(bytes32[] calldata currencyKeys) external view returns (uint[] memory) {
        uint[] memory _localRates = new uint[](currencyKeys.length);

        for (uint i = 0; i < currencyKeys.length; i++) {
            _localRates[i] = _getRate(currencyKeys[i]);
        }

        return _localRates;
    }

    function rateAndInvalid(bytes32 currencyKey) external view returns (uint rate, bool isInvalid) {
        RateAndUpdatedTime memory rateAndTime = _getRateAndUpdatedTime(currencyKey);

        if (currencyKey == "sUSD") {
            return (rateAndTime.rate, false);
        }
        return (
            rateAndTime.rate,
            _rateIsStaleWithTime(getRateStalePeriod(), rateAndTime.time) ||
                _rateIsFlagged(currencyKey, FlagsInterface(getAggregatorWarningFlags()))
        );
    }

    function ratesAndInvalidForCurrencies(bytes32[] calldata currencyKeys)
        external
        view
        returns (uint[] memory rates, bool anyRateInvalid)
    {
        rates = new uint[](currencyKeys.length);

        uint256 _rateStalePeriod = getRateStalePeriod();

        // fetch all flags at once
        bool[] memory flagList = getFlagsForRates(currencyKeys);

        for (uint i = 0; i < currencyKeys.length; i++) {
            // do one lookup of the rate & time to minimize gas
            RateAndUpdatedTime memory rateEntry = _getRateAndUpdatedTime(currencyKeys[i]);
            rates[i] = rateEntry.rate;
            if (!anyRateInvalid && currencyKeys[i] != "sUSD") {
                anyRateInvalid = flagList[i] || _rateIsStaleWithTime(_rateStalePeriod, rateEntry.time);
            }
        }
    }

    function rateIsStale(bytes32 currencyKey) external view returns (bool) {
        return _rateIsStale(currencyKey, getRateStalePeriod());
    }

    function rateIsFrozen(bytes32 currencyKey) external view returns (bool) {
        return _rateIsFrozen(currencyKey);
    }

    function rateIsInvalid(bytes32 currencyKey) external view returns (bool) {
        return
            _rateIsStale(currencyKey, getRateStalePeriod()) ||
            _rateIsFlagged(currencyKey, FlagsInterface(getAggregatorWarningFlags()));
    }

    function rateIsFlagged(bytes32 currencyKey) external view returns (bool) {
        return _rateIsFlagged(currencyKey, FlagsInterface(getAggregatorWarningFlags()));
    }

    function anyRateIsInvalid(bytes32[] calldata currencyKeys) external view returns (bool) {
        // Loop through each key and check whether the data point is stale.

        uint256 _rateStalePeriod = getRateStalePeriod();
        bool[] memory flagList = getFlagsForRates(currencyKeys);

        for (uint i = 0; i < currencyKeys.length; i++) {
            if (flagList[i] || _rateIsStale(currencyKeys[i], _rateStalePeriod)) {
                return true;
            }
        }

        return false;
    }

    /* ========== INTERNAL FUNCTIONS ========== */

    function exchanger() internal view returns (IExchanger) {
        return IExchanger(requireAndGetAddress(CONTRACT_EXCHANGER, "Missing Exchanger address"));
    }

    function getFlagsForRates(bytes32[] memory currencyKeys) internal view returns (bool[] memory flagList) {
        FlagsInterface _flags = FlagsInterface(getAggregatorWarningFlags());

        // fetch all flags at once
        if (_flags != FlagsInterface(0)) {
            address[] memory _aggregators = new address[](currencyKeys.length);

            for (uint i = 0; i < currencyKeys.length; i++) {
                _aggregators[i] = address(aggregators[currencyKeys[i]]);
            }

            flagList = _flags.getFlags(_aggregators);
        } else {
            flagList = new bool[](currencyKeys.length);
        }
    }

    function _setRate(
        bytes32 currencyKey,
        uint256 rate,
        uint256 time
    ) internal {
        // Note: this will effectively start the rounds at 1, which matches Chainlink's Agggregators
        currentRoundForRate[currencyKey]++;

        _rates[currencyKey][currentRoundForRate[currencyKey]] = RateAndUpdatedTime({
            rate: uint216(rate),
            time: uint40(time)
        });
    }

    function internalUpdateRates(
        bytes32[] memory currencyKeys,
        uint[] memory newRates,
        uint timeSent
    ) internal returns (bool) {
        require(currencyKeys.length == newRates.length, "Currency key array length must match rates array length.");
        require(timeSent < (now + ORACLE_FUTURE_LIMIT), "Time is too far into the future");

        // Loop through each key and perform update.
        for (uint i = 0; i < currencyKeys.length; i++) {
            bytes32 currencyKey = currencyKeys[i];

            // Should not set any rate to zero ever, as no asset will ever be
            // truely worthless and still valid. In this scenario, we should
            // delete the rate and remove it from the system.
            require(newRates[i] != 0, "Zero is not a valid rate, please call deleteRate instead.");
            require(currencyKey != "sUSD", "Rate of sUSD cannot be updated, it's always UNIT.");

            // We should only update the rate if it's at least the same age as the last rate we've got.
            if (timeSent < _getUpdatedTime(currencyKey)) {
                continue;
            }

            // Ok, go ahead with the update.
            _setRate(currencyKey, newRates[i], timeSent);
        }

        emit RatesUpdated(currencyKeys, newRates);

        return true;
    }

    function removeFromArray(bytes32 entry, bytes32[] storage array) internal returns (bool) {
        for (uint i = 0; i < array.length; i++) {
            if (array[i] == entry) {
                delete array[i];

                // Copy the last key into the place of the one we just deleted
                // If there's only one key, this is array[0] = array[0].
                // If we're deleting the last one, it's also a NOOP in the same way.
                array[i] = array[array.length - 1];

                // Decrease the size of the array by one.
                array.length--;

                return true;
            }
        }
        return false;
    }

    function _rateOrInverted(
        bytes32 currencyKey,
        uint rate,
        uint roundId
    ) internal view returns (uint newRate) {
        // if an inverse mapping exists, adjust the price accordingly
        InversePricing memory inverse = inversePricing[currencyKey];
        if (inverse.entryPoint == 0 || rate == 0) {
            // when no inverse is set or when given a 0 rate, return the rate, regardless of the inverse status
            // (the latter is so when a new inverse is set but the underlying has no rate, it will return 0 as
            // the rate, not the lowerLimit)
            return rate;
        }

        newRate = rate;

        // Determine when round was frozen (if any)
        uint roundWhenRateFrozen = roundFrozen[currencyKey];
        // And if we're looking at a rate after frozen, and it's currently frozen, then apply the bounds limit even
        // if the current price is back within bounds
        if (roundId >= roundWhenRateFrozen && inverse.frozenAtUpperLimit) {
            newRate = inverse.upperLimit;
        } else if (roundId >= roundWhenRateFrozen && inverse.frozenAtLowerLimit) {
            newRate = inverse.lowerLimit;
        } else {
            // this ensures any rate outside the limit will never be returned
            uint doubleEntryPoint = inverse.entryPoint.mul(2);
            if (doubleEntryPoint <= rate) {
                // avoid negative numbers for unsigned ints, so set this to 0
                // which by the requirement that lowerLimit be > 0 will
                // cause this to freeze the price to the lowerLimit
                newRate = 0;
            } else {
                newRate = doubleEntryPoint.sub(rate);
            }

            // now ensure the rate is between the bounds
            if (newRate >= inverse.upperLimit) {
                newRate = inverse.upperLimit;
            } else if (newRate <= inverse.lowerLimit) {
                newRate = inverse.lowerLimit;
            }
        }
    }

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

    function _getRateAndUpdatedTime(bytes32 currencyKey) internal view returns (RateAndUpdatedTime memory) {
        AggregatorV2V3Interface aggregator = aggregators[currencyKey];

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

            if (success) {
                (uint80 roundId, int256 answer, , uint256 updatedAt, ) = abi.decode(
                    returnData,
                    (uint80, int256, uint256, uint256, uint80)
                );
                return
                    RateAndUpdatedTime({
                        rate: uint216(_rateOrInverted(currencyKey, _formatAggregatorAnswer(currencyKey, answer), roundId)),
                        time: uint40(updatedAt)
                    });
            }
        } else {
            uint roundId = currentRoundForRate[currencyKey];
            RateAndUpdatedTime memory entry = _rates[currencyKey][roundId];

            return RateAndUpdatedTime({rate: uint216(_rateOrInverted(currencyKey, entry.rate, roundId)), time: entry.time});
        }
    }

    function _getCurrentRoundId(bytes32 currencyKey) internal view returns (uint) {
        AggregatorV2V3Interface aggregator = aggregators[currencyKey];

        if (aggregator != AggregatorV2V3Interface(0)) {
            return aggregator.latestRound();
        } else {
            return currentRoundForRate[currencyKey];
        }
    }

    function _getRateAndTimestampAtRound(bytes32 currencyKey, uint roundId) internal view returns (uint rate, uint time) {
        AggregatorV2V3Interface aggregator = aggregators[currencyKey];

        if (aggregator != AggregatorV2V3Interface(0)) {
            // this view from the aggregator is the most gas efficient but it can throw when there's no data,
            // so let's call it low-level to suppress any reverts
            bytes memory payload = abi.encodeWithSignature("getRoundData(uint80)", roundId);
            // solhint-disable avoid-low-level-calls
            (bool success, bytes memory returnData) = address(aggregator).staticcall(payload);

            if (success) {
                (, int256 answer, , uint256 updatedAt, ) = abi.decode(
                    returnData,
                    (uint80, int256, uint256, uint256, uint80)
                );
                return (_rateOrInverted(currencyKey, _formatAggregatorAnswer(currencyKey, answer), roundId), updatedAt);
            }
        } else {
            RateAndUpdatedTime memory update = _rates[currencyKey][roundId];
            return (_rateOrInverted(currencyKey, update.rate, roundId), update.time);
        }
    }

    function _getRate(bytes32 currencyKey) internal view returns (uint256) {
        return _getRateAndUpdatedTime(currencyKey).rate;
    }

    function _getUpdatedTime(bytes32 currencyKey) internal view returns (uint256) {
        return _getRateAndUpdatedTime(currencyKey).time;
    }

    function _effectiveValueAndRates(
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey
    )
        internal
        view
        returns (
            uint value,
            uint sourceRate,
            uint destinationRate
        )
    {
        sourceRate = _getRate(sourceCurrencyKey);
        // If there's no change in the currency, then just return the amount they gave us
        if (sourceCurrencyKey == destinationCurrencyKey) {
            destinationRate = sourceRate;
            value = sourceAmount;
        } else {
            // Calculate the effective value by going from source -> USD -> destination
            destinationRate = _getRate(destinationCurrencyKey);
            // prevent divide-by 0 error (this happens if the dest is not a valid rate)
            if (destinationRate > 0) {
                value = sourceAmount.multiplyDecimalRound(sourceRate).divideDecimalRound(destinationRate);
            }
        }
    }

    function _rateIsStale(bytes32 currencyKey, uint _rateStalePeriod) internal view returns (bool) {
        // sUSD is a special case and is never stale (check before an SLOAD of getRateAndUpdatedTime)
        if (currencyKey == "sUSD") return false;

        return _rateIsStaleWithTime(_rateStalePeriod, _getUpdatedTime(currencyKey));
    }

    function _rateIsStaleWithTime(uint _rateStalePeriod, uint _time) internal view returns (bool) {
        return _time.add(_rateStalePeriod) < now;
    }

    function _rateIsFrozen(bytes32 currencyKey) internal view returns (bool) {
        InversePricing memory inverse = inversePricing[currencyKey];
        return inverse.frozenAtUpperLimit || inverse.frozenAtLowerLimit;
    }

    function _rateIsFlagged(bytes32 currencyKey, FlagsInterface flags) internal view returns (bool) {
        // sUSD is a special case and is never invalid
        if (currencyKey == "sUSD") return false;
        address aggregator = address(aggregators[currencyKey]);
        // when no aggregator or when the flags haven't been setup
        if (aggregator == address(0) || flags == FlagsInterface(0)) {
            return false;
        }
        return flags.getFlag(aggregator);
    }

    /* ========== MODIFIERS ========== */

    modifier onlyOracle {
        require(msg.sender == oracle, "Only the oracle can perform this action");
        _;
    }

    /* ========== EVENTS ========== */

    event OracleUpdated(address newOracle);
    event RatesUpdated(bytes32[] currencyKeys, uint[] newRates);
    event RateDeleted(bytes32 currencyKey);
    event InversePriceConfigured(bytes32 currencyKey, uint entryPoint, uint upperLimit, uint lowerLimit);
    event InversePriceFrozen(bytes32 currencyKey, uint rate, uint roundId, address initiator);
    event AggregatorAdded(bytes32 currencyKey, address aggregator);
    event AggregatorRemoved(bytes32 currencyKey, address aggregator);
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_oracle","type":"address"},{"internalType":"address","name":"_resolver","type":"address"},{"internalType":"bytes32[]","name":"_currencyKeys","type":"bytes32[]"},{"internalType":"uint256[]","name":"_newRates","type":"uint256[]"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"currencyKey","type":"bytes32"},{"indexed":false,"internalType":"address","name":"aggregator","type":"address"}],"name":"AggregatorAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"currencyKey","type":"bytes32"},{"indexed":false,"internalType":"address","name":"aggregator","type":"address"}],"name":"AggregatorRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"currencyKey","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"entryPoint","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"upperLimit","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lowerLimit","type":"uint256"}],"name":"InversePriceConfigured","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"currencyKey","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"rate","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"roundId","type":"uint256"},{"indexed":false,"internalType":"address","name":"initiator","type":"address"}],"name":"InversePriceFrozen","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newOracle","type":"address"}],"name":"OracleUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldOwner","type":"address"},{"indexed":false,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerNominated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"currencyKey","type":"bytes32"}],"name":"RateDeleted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32[]","name":"currencyKeys","type":"bytes32[]"},{"indexed":false,"internalType":"uint256[]","name":"newRates","type":"uint256[]"}],"name":"RatesUpdated","type":"event"},{"constant":true,"inputs":[],"name":"MAX_ADDRESSES_FROM_RESOLVER","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"acceptOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"currencyKey","type":"bytes32"},{"internalType":"address","name":"aggregatorAddress","type":"address"}],"name":"addAggregator","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"aggregatorKeys","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"aggregatorWarningFlags","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"aggregators","outputs":[{"internalType":"contract AggregatorV2V3Interface","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32[]","name":"currencyKeys","type":"bytes32[]"}],"name":"anyRateIsInvalid","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"currencyKey","type":"bytes32"}],"name":"canFreezeRate","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"aggregator","type":"address"}],"name":"currenciesUsingAggregator","outputs":[{"internalType":"bytes32[]","name":"currencies","type":"bytes32[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"currencyKeyDecimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"currentRoundForRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"currencyKey","type":"bytes32"}],"name":"deleteRate","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"sourceCurrencyKey","type":"bytes32"},{"internalType":"uint256","name":"sourceAmount","type":"uint256"},{"internalType":"bytes32","name":"destinationCurrencyKey","type":"bytes32"}],"name":"effectiveValue","outputs":[{"internalType":"uint256","name":"value","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"sourceCurrencyKey","type":"bytes32"},{"internalType":"uint256","name":"sourceAmount","type":"uint256"},{"internalType":"bytes32","name":"destinationCurrencyKey","type":"bytes32"}],"name":"effectiveValueAndRates","outputs":[{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"sourceRate","type":"uint256"},{"internalType":"uint256","name":"destinationRate","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"sourceCurrencyKey","type":"bytes32"},{"internalType":"uint256","name":"sourceAmount","type":"uint256"},{"internalType":"bytes32","name":"destinationCurrencyKey","type":"bytes32"},{"internalType":"uint256","name":"roundIdForSrc","type":"uint256"},{"internalType":"uint256","name":"roundIdForDest","type":"uint256"}],"name":"effectiveValueAtRound","outputs":[{"internalType":"uint256","name":"value","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"currencyKey","type":"bytes32"}],"name":"freezeRate","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"currencyKey","type":"bytes32"}],"name":"getCurrentRoundId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"currencyKey","type":"bytes32"},{"internalType":"uint256","name":"startingRoundId","type":"uint256"},{"internalType":"uint256","name":"startingTimestamp","type":"uint256"},{"internalType":"uint256","name":"timediff","type":"uint256"}],"name":"getLastRoundIdBeforeElapsedSecs","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getResolverAddressesRequired","outputs":[{"internalType":"bytes32[24]","name":"addressesRequired","type":"bytes32[24]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"inversePricing","outputs":[{"internalType":"uint256","name":"entryPoint","type":"uint256"},{"internalType":"uint256","name":"upperLimit","type":"uint256"},{"internalType":"uint256","name":"lowerLimit","type":"uint256"},{"internalType":"bool","name":"frozenAtUpperLimit","type":"bool"},{"internalType":"bool","name":"frozenAtLowerLimit","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"invertedKeys","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"contract AddressResolver","name":"_resolver","type":"address"}],"name":"isResolverCached","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"currencyKey","type":"bytes32"}],"name":"lastRateUpdateTimes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32[]","name":"currencyKeys","type":"bytes32[]"}],"name":"lastRateUpdateTimesForCurrencies","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"nominateNewOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"nominatedOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"oracle","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"currencyKey","type":"bytes32"}],"name":"rateAndInvalid","outputs":[{"internalType":"uint256","name":"rate","type":"uint256"},{"internalType":"bool","name":"isInvalid","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"currencyKey","type":"bytes32"},{"internalType":"uint256","name":"roundId","type":"uint256"}],"name":"rateAndTimestampAtRound","outputs":[{"internalType":"uint256","name":"rate","type":"uint256"},{"internalType":"uint256","name":"time","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"currencyKey","type":"bytes32"}],"name":"rateAndUpdatedTime","outputs":[{"internalType":"uint256","name":"rate","type":"uint256"},{"internalType":"uint256","name":"time","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"currencyKey","type":"bytes32"}],"name":"rateForCurrency","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"currencyKey","type":"bytes32"}],"name":"rateIsFlagged","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"currencyKey","type":"bytes32"}],"name":"rateIsFrozen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"currencyKey","type":"bytes32"}],"name":"rateIsInvalid","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"currencyKey","type":"bytes32"}],"name":"rateIsStale","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"rateStalePeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32[]","name":"currencyKeys","type":"bytes32[]"}],"name":"ratesAndInvalidForCurrencies","outputs":[{"internalType":"uint256[]","name":"rates","type":"uint256[]"},{"internalType":"bool","name":"anyRateInvalid","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"currencyKey","type":"bytes32"},{"internalType":"uint256","name":"numRounds","type":"uint256"}],"name":"ratesAndUpdatedTimeForCurrencyLastNRounds","outputs":[{"internalType":"uint256[]","name":"rates","type":"uint256[]"},{"internalType":"uint256[]","name":"times","type":"uint256[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32[]","name":"currencyKeys","type":"bytes32[]"}],"name":"ratesForCurrencies","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"currencyKey","type":"bytes32"}],"name":"removeAggregator","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"currencyKey","type":"bytes32"}],"name":"removeInversePricing","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"resolver","outputs":[{"internalType":"contract AddressResolver","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"resolverAddressesRequired","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"roundFrozen","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"currencyKey","type":"bytes32"},{"internalType":"uint256","name":"entryPoint","type":"uint256"},{"internalType":"uint256","name":"upperLimit","type":"uint256"},{"internalType":"uint256","name":"lowerLimit","type":"uint256"},{"internalType":"bool","name":"freezeAtUpperLimit","type":"bool"},{"internalType":"bool","name":"freezeAtLowerLimit","type":"bool"}],"name":"setInversePricing","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_oracle","type":"address"}],"name":"setOracle","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"contract AddressResolver","name":"_resolver","type":"address"}],"name":"setResolverAndSyncCache","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32[]","name":"currencyKeys","type":"bytes32[]"},{"internalType":"uint256[]","name":"newRates","type":"uint256[]"},{"internalType":"uint256","name":"timeSent","type":"uint256"}],"name":"updateRates","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"}]

60a06040526822bc31b430b733b2b960b91b60809081526200002690600e90600162000e17565b503480156200003457600080fd5b506040516200526c3803806200526c833981810160405260a08110156200005a57600080fd5b8151602083015160408085015160608601805192519496939591949391820192846401000000008211156200008e57600080fd5b908301906020820185811115620000a457600080fd5b8251866020820283011164010000000082111715620000c257600080fd5b82525081516020918201928201910280838360005b83811015620000f1578181015183820152602001620000d7565b50505050905001604052602001805160405193929190846401000000008211156200011b57600080fd5b9083019060208201858111156200013157600080fd5b82518660208202830111640100000000821117156200014f57600080fd5b82525081516020918201928201910280838360005b838110156200017e57818101518382015260200162000164565b5050505090910161030081016040819052889550909350600e92506018915082845b815481526020019060010190808311620001a057508a93505050506001600160a01b03811662000217576040805162461bcd60e51b815260206004820152601960248201527f4f776e657220616464726573732063616e6e6f74206265203000000000000000604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b038316908117825560408051928352602083019190915280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a1506000546001600160a01b0316620002c2576040805162461bcd60e51b815260206004820152601160248201527013dddb995c881b5d5cdd081899481cd95d607a1b604482015290519081900360640190fd5b60005b60188110156200032a576000828260188110620002de57fe5b6020020151146200031b576004828260188110620002f857fe5b602090810291909101518254600181018455600093845291909220015562000321565b6200032a565b600101620002c5565b5050600280546001600160a01b0319166001600160a01b0392909216919091179055620003696e466c657869626c6553746f7261676560881b62000483565b8051825114620003ab5760405162461bcd60e51b815260040180806020018281038252602f8152602001806200517a602f913960400191505060405180910390fd5b83600660006101000a8154816001600160a01b0302191690836001600160a01b0316021790555062000461631cd554d160e21b7384d626b2bb4d0f064067e4bf80fce7055d8f3e7b63907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b1580156200042357600080fd5b505af415801562000438573d6000803e3d6000fd5b505050506040513d60208110156200044f57600080fd5b5051426001600160e01b03620005b616565b620004778282426001600160e01b036200062f16565b50505050505062000ec4565b6004805460018101825560008290527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b01829055546018116200050d576040805162461bcd60e51b815260206004820152601b60248201527f4d6178207265736f6c7665722063616368652073697a65206d65740000000000604482015290519081900360640190fd5b600254604080516321f8a72160e01b81526004810184905290516001600160a01b03909216916321f8a72191602480820192602092909190829003018186803b1580156200055a57600080fd5b505afa1580156200056f573d6000803e3d6000fd5b505050506040513d60208110156200058657600080fd5b505160009182526003602052604090912080546001600160a01b0319166001600160a01b03909216919091179055565b6000838152600c60209081526040808320805460010190819055815180830183526001600160d81b03968716815264ffffffffff958616818501908152978552600584528285209185529252909120905181549451909216600160d81b029183166001600160d81b031990941693909317909116179055565b60008251845114620006735760405162461bcd60e51b8152600401808060200182810382526038815260200180620051fb6038913960400191505060405180910390fd5b61025842018210620006cc576040805162461bcd60e51b815260206004820152601f60248201527f54696d6520697320746f6f2066617220696e746f207468652066757475726500604482015290519081900360640190fd5b60005b8451811015620007e5576000858281518110620006e857fe5b60200260200101519050848281518110620006ff57fe5b602002602001015160001415620007485760405162461bcd60e51b8152600401808060200182810382526039815260200180620052336039913960400191505060405180910390fd5b80631cd554d160e21b1415620007905760405162461bcd60e51b8152600401808060200182810382526031815260200180620051a96031913960400191505060405180910390fd5b620007a4816001600160e01b03620008b016565b841015620007b35750620007dc565b620007da81868481518110620007c557fe5b602002602001015186620005b660201b60201c565b505b600101620006cf565b507f1bc0fc8997efa076f59b5ef02c315bc5390f7a6d24d661ce12128c01a3b0ba578484604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b838110156200084f57818101518382015260200162000835565b50505050905001838103825284818151815260200191508051906020019060200280838360005b838110156200089057818101518382015260200162000876565b5050505090500194505050505060405180910390a15060015b9392505050565b6000620008c6826001600160e01b03620008d916565b6020015164ffffffffff1690505b919050565b620008e362000e5a565b6000828152600760205260409020546001600160a01b0316801562000a7f5760408051600481526024810182526020810180516001600160e01b0316633fabe5a360e21b1781529151815191926000926060926001600160a01b0387169286928291908083835b602083106200096b5780518252601f1990920191602091820191016200094a565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855afa9150503d8060008114620009cd576040519150601f19603f3d011682016040523d82523d6000602084013e620009d2565b606091505b5091509150811562000a765760008060008380602001905160a0811015620009f957600080fd5b5080516020820151606090920151604080518082019091529195509193509091508062000a4e8b62000a3581876001600160e01b0362000b2b16565b6001600160501b0388166001600160e01b0362000bf816565b6001600160d81b031681526020018264ffffffffff16815250975050505050505050620008d4565b50505062000b25565b6000838152600c602052604090205462000a9862000e5a565b5060008481526005602090815260408083208484528252918290208251808401845290546001600160d81b038082168352600160d81b90910464ffffffffff169282019290925282518084019093528051909291829162000afd918991168662000bf8565b6001600160d81b03168152602001826020015164ffffffffff168152509350505050620008d4565b50919050565b60008082121562000b83576040805162461bcd60e51b815260206004820152601b60248201527f4e656761746976652072617465206e6f7420737570706f727465640000000000604482015290519081900360640190fd5b60008381526008602052604090205460ff161562000bef57600083815260086020908152604082205462000bc79160129160ff169062003f0c62000d5b821b17901c565b600a0a905062000be6818462000db960201b620037611790919060201c565b91505062000bf2565b50805b92915050565b600062000c0462000e71565b506000848152600a6020908152604091829020825160a08101845281548082526001830154938201939093526002820154938101939093526003015460ff808216151560608501526101009091041615156080830152158062000c65575083155b1562000c755783915050620008a9565b6000858152600d602052604090205484925080841080159062000c99575081606001515b1562000cac578160200151925062000d52565b80841015801562000cbe575081608001515b1562000cd1578160400151925062000d52565b600062000cf26002846000015162000db960201b620037611790919060201c565b905085811162000d06576000935062000d23565b62000d20868262000d5b60201b62003f0c1790919060201c565b93505b8260200151841062000d3c578260200151935062000d50565b8260400151841162000d5057826040015193505b505b50509392505050565b60008282111562000db3576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60008262000dca5750600062000bf2565b8282028284828162000dd857fe5b0414620008a95760405162461bcd60e51b8152600401808060200182810382526021815260200180620051da6021913960400191505060405180910390fd5b826018810192821562000e48579160200282015b8281111562000e4857825182559160200191906001019062000e2b565b5062000e5692915062000ea4565b5090565b604080518082019091526000808252602082015290565b6040518060a001604052806000815260200160008152602001600081526020016000151581526020016000151581525090565b62000ec191905b8082111562000e56576000815560010162000eab565b90565b6142a68062000ed46000396000f3fe608060405234801561001057600080fd5b506004361061032a5760003560e01c8063654a60ac116101b2578063ac82f608116100f9578063c6c9d828116100a2578063ce8480ea1161007c578063ce8480ea14610cec578063de02795e14610d09578063e3235c9114610d26578063fdadbc7e14610d2e5761032a565b8063c6c9d82814610be3578063c8e5bbd514610c00578063c8e6f39514610ccf5761032a565b8063b295ad34116100d3578063b295ad3414610a7e578063bfa005ce14610ab1578063c2c8a67614610b735761032a565b8063ac82f60814610a05578063af3aea8614610a22578063b199c76414610a3f5761032a565b80637dc0d1d01161015b5780638da5cb5b116101355780638da5cb5b1461099f578063935f4abd146109a7578063ab49848c146109c45761032a565b80637dc0d1d0146109335780637f6e9d151461093b5780638295016a146109585761032a565b806379ba50971161018c57806379ba5097146108db5780637a018a1e146108e35780637adbf973146109005761032a565b8063654a60ac146108495780637103353e14610872578063728dec291461088f5761032a565b80632d7371e1116102765780634308a94f1161021f5780634f72def6116101f95780634f72def6146107f157806353a47bb71461080e578063631e1444146108165761032a565b80634308a94f1461079657806345938849146107cc5780634c36b837146107e95761032a565b806338aa1b991161025057806338aa1b991461070d5780633be99e6f1461072a5780633f0e084f1461075d5761032a565b80632d7371e1146106175780632ea913d4146106d35780633375fcd1146106f05761032a565b8063109e46a2116102d8578063266da16b116102b2578063266da16b146105925780632678df96146105c75780632bed9e0c146105fa5761032a565b8063109e46a2146105115780631627540c146105405780632528f0fe146105755761032a565b80630a7d36d1116103095780630a7d36d1146104515780630c71cd23146104c15780630ee4951b146104f75761032a565b80629919c01461032f57806304f3bcec1461036057806305a046e514610391575b600080fd5b61034c6004803603602081101561034557600080fd5b5035610d51565b604080519115158252519081900360200190f35b610368610d6c565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b610401600480360360208110156103a757600080fd5b8101906020810181356401000000008111156103c257600080fd5b8201836020820111156103d457600080fd5b803590602001918460208302840111640100000000831117156103f657600080fd5b509092509050610d88565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561043d578181015183820152602001610425565b505050509050019250505060405180910390f35b61034c6004803603602081101561046757600080fd5b81019060208101813564010000000081111561048257600080fd5b82018360208201111561049457600080fd5b803590602001918460208302840111640100000000831117156104b657600080fd5b509092509050610e0a565b6104de600480360360208110156104d757600080fd5b5035610ebd565b6040805192835290151560208301528051918290030190f35b6104ff610f83565b60408051918252519081900360200190f35b6104ff6004803603608081101561052757600080fd5b5080359060208101359060408101359060600135610f93565b6105736004803603602081101561055657600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610fd6565b005b61034c6004803603602081101561058b57600080fd5b5035611057565b6104ff600480360360a08110156105a857600080fd5b5080359060208101359060408101359060608101359060800135611077565b610401600480360360208110156105dd57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166110e4565b6105736004803603602081101561061057600080fd5b50356111a5565b61063a6004803603604081101561062d57600080fd5b50803590602001356112f1565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b8381101561067e578181015183820152602001610666565b50505050905001838103825284818151815260200191508051906020019060200280838360005b838110156106bd5781810151838201526020016106a5565b5050505090500194505050505060405180910390f35b6104ff600480360360208110156106e957600080fd5b50356113e2565b61034c6004803603602081101561070657600080fd5b5035611400565b61034c6004803603602081101561072357600080fd5b50356114c6565b6105736004803603602081101561074057600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166114d4565b6105736004803603604081101561077357600080fd5b508035906020013573ffffffffffffffffffffffffffffffffffffffff16611671565b6107b3600480360360208110156107ac57600080fd5b5035611921565b6040805192835260208301919091528051918290030190f35b610573600480360360208110156107e257600080fd5b503561196d565b610368611aa8565b6104ff6004803603602081101561080757600080fd5b5035611ab2565b610368611abf565b61034c6004803603602081101561082c57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611adb565b6104ff6004803603606081101561085f57600080fd5b5080359060208101359060400135611c43565b6103686004803603602081101561088857600080fd5b5035611c5b565b6108ac600480360360208110156108a557600080fd5b5035611c83565b604080519586526020860194909452848401929092521515606084015215156080830152519081900360a00190f35b610573611cb6565b6104ff600480360360208110156108f957600080fd5b5035611db1565b6105736004803603602081101561091657600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611dbc565b610368611e43565b6104ff6004803603602081101561095157600080fd5b5035611e5f565b6109816004803603606081101561096e57600080fd5b5080359060208101359060400135611e71565b60408051938452602084019290925282820152519081900360600190f35b610368611e91565b6104ff600480360360208110156109bd57600080fd5b5035611ead565b6109cc611ebf565b604051808261030080838360005b838110156109f25781810151838201526020016109da565b5050505090500191505060405180910390f35b6104ff60048036036020811015610a1b57600080fd5b5035611f09565b61034c60048036036020811015610a3857600080fd5b5035611f38565b610573600480360360c0811015610a5557600080fd5b50803590602081013590604081013590606081013590608081013515159060a001351515611f43565b610a9b60048036036020811015610a9457600080fd5b5035612318565b6040805160ff9092168252519081900360200190f35b61034c60048036036060811015610ac757600080fd5b810190602081018135640100000000811115610ae257600080fd5b820183602082011115610af457600080fd5b80359060200191846020830284011164010000000083111715610b1657600080fd5b919390929091602081019035640100000000811115610b3457600080fd5b820183602082011115610b4657600080fd5b80359060200191846020830284011164010000000083111715610b6857600080fd5b91935091503561232d565b61040160048036036020811015610b8957600080fd5b810190602081018135640100000000811115610ba457600080fd5b820183602082011115610bb657600080fd5b80359060200191846020830284011164010000000083111715610bd857600080fd5b5090925090506123ff565b6104ff60048036036020811015610bf957600080fd5b5035612477565b610c7060048036036020811015610c1657600080fd5b810190602081018135640100000000811115610c3157600080fd5b820183602082011115610c4357600080fd5b80359060200191846020830284011164010000000083111715610c6557600080fd5b509092509050612484565b604051808060200183151515158152602001828103825284818151815260200191508051906020019060200280838360005b83811015610cba578181015183820152602001610ca2565b50505050905001935050505060405180910390f35b61057360048036036020811015610ce557600080fd5b50356125f8565b6104ff60048036036020811015610d0257600080fd5b5035612706565b61057360048036036020811015610d1f57600080fd5b5035612711565b6104ff612939565b6107b360048036036040811015610d4457600080fd5b508035906020013561293e565b6000610d6482610d5f612956565b612a29565b90505b919050565b60025473ffffffffffffffffffffffffffffffffffffffff1681565b60608083839050604051908082528060200260200182016040528015610db8578160200160208202803883390190505b50905060005b83811015610e0057610de1858583818110610dd557fe5b90506020020135612a74565b828281518110610ded57fe5b6020908102919091010152600101610dbe565b5090505b92915050565b600080610e15612956565b90506060610e55858580806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250612a9092505050565b905060005b84811015610eb157818181518110610e6e57fe5b602002602001015180610e985750610e98868683818110610e8b57fe5b9050602002013584612a29565b15610ea95760019350505050610e04565b600101610e5a565b50600095945050505050565b600080610ec8613fd3565b610ed184612d3e565b9050837f73555344000000000000000000000000000000000000000000000000000000001415610f2457517affffffffffffffffffffffffffffffffffffffffffffffffffffff16915060009050610f7e565b8051610f42610f31612956565b836020015164ffffffffff16613021565b80610f595750610f5985610f5461303c565b6130de565b7affffffffffffffffffffffffffffffffffffffffffffffffffffff90911693509150505b915091565b6000610f8d612956565b90505b90565b600083815b610fa58783600101613216565b915050801580610fb6575083850181115b15610fc357509050610fce565b600190910190610f98565b949350505050565b610fde61347e565b6001805473ffffffffffffffffffffffffffffffffffffffff83167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116811790915560408051918252517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce229181900360200190a150565b600061106582610d5f612956565b80610d645750610d6482610f5461303c565b6000838614156110885750836110db565b60006110948785613216565b50905060006110a38685613216565b509050806110b6576000925050506110db565b6110d6816110ca898563ffffffff6134d616565b9063ffffffff6134eb16565b925050505b95945050505050565b600954604080518281526020808402820101909152606091600091908015611116578160200160208202803883390190505b50915060005b60095481101561119e5760006009828154811061113557fe5b6000918252602080832090910154808352600790915260409091205490915073ffffffffffffffffffffffffffffffffffffffff9081169086161415611195578084848060010195508151811061118857fe5b6020026020010181815250505b5060010161111c565b5050919050565b6111ad61347e565b60008181526007602052604090205473ffffffffffffffffffffffffffffffffffffffff1680611224576040805162461bcd60e51b815260206004820152601c60248201527f4e6f2061676772656761746f722065786973747320666f72206b657900000000604482015290519081900360640190fd5b600082815260076020908152604080832080547fffffffffffffffffffffffff00000000000000000000000000000000000000001690556008909152812080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055611293836009613500565b905080156112ec576040805184815273ffffffffffffffffffffffffffffffffffffffff8416602082015281517fec70e890fc7db7de4059b114c9093a1f41283d18ffcfbcac45566feea4d4f777929181900390910190a15b505050565b6060808260405190808252806020026020018201604052801561131e578160200160208202803883390190505b5091508260405190808252806020026020018201604052801561134b578160200160208202803883390190505b5090506000611359856135e0565b905060005b848110156113d8576113708683613216565b85838151811061137c57fe5b6020026020010185848151811061138f57fe5b602090810291909101019190915252816113ab57506113db9050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9091019060010161135e565b50505b9250929050565b600b81815481106113ef57fe5b600091825260209091200154905081565b600061140a613fea565b506000828152600a6020908152604091829020825160a08101845281548082526001830154938201939093526002820154938101939093526003015460ff808216151560608501526101009091041615156080830152158061146d575080606001515b80611479575080608001515b15611488576000915050610d67565b600061149384611f09565b90506000811180156114b757508160200151811015806114b7575081604001518111155b92505050610d67565b50919050565b6000610d6482610f5461303c565b6114dc61347e565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff831617905560005b60045481101561166d5760006004828154811061153857fe5b60009182526020918290200154600254604080517fdacb2d010000000000000000000000000000000000000000000000000000000081526004810184905260248101829052601760448201527f5265736f6c766572206d697373696e67207461726765740000000000000000006064820152905192945073ffffffffffffffffffffffffffffffffffffffff9091169263dacb2d0192608480840193829003018186803b1580156115e857600080fd5b505afa1580156115fc573d6000803e3d6000fd5b505050506040513d602081101561161257600080fd5b505160009182526003602052604090912080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff90921691909117905560010161151f565b5050565b61167961347e565b600081905060008173ffffffffffffffffffffffffffffffffffffffff1663668a0f026040518163ffffffff1660e01b815260040160206040518083038186803b1580156116c657600080fd5b505afa1580156116da573d6000803e3d6000fd5b505050506040513d60208110156116f057600080fd5b50511015611745576040805162461bcd60e51b815260206004820152601b60248201527f476976656e2041676772656761746f7220697320696e76616c69640000000000604482015290519081900360640190fd5b60008173ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561178d57600080fd5b505afa1580156117a1573d6000803e3d6000fd5b505050506040513d60208110156117b757600080fd5b50519050601260ff821611156117fe5760405162461bcd60e51b81526004018080602001828103825260328152602001806141e06032913960400191505060405180910390fd5b60008481526007602052604090205473ffffffffffffffffffffffffffffffffffffffff1661185d57600980546001810182556000919091527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af018490555b600084815260076020908152604080832080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8716908117909155600883529281902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff861617905580518781529182019290925281517f0bcae573430f69c5361e5d76534d3f61d2d803958778680cd74be9dc6299bc63929181900390910190a150505050565b60008061192c613fd3565b61193584612d3e565b80516020909101517affffffffffffffffffffffffffffffffffffffffffffffffffffff909116935064ffffffffff16915050915091565b60065473ffffffffffffffffffffffffffffffffffffffff1633146119c35760405162461bcd60e51b81526004018080602001828103825260278152602001806140dc6027913960400191505060405180910390fd5b60006119ce82611f09565b11611a20576040805162461bcd60e51b815260206004820152600c60248201527f52617465206973207a65726f0000000000000000000000000000000000000000604482015290519081900360640190fd5b6000818152600560209081526040808320600c808452828520805486529184528285208590559385905292825282547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01909255815183815291517fe69d655565c7ff1353d8eaeea62fb7904fa9696987431ec351be288c865f1ae19281900390910190a150565b6000610f8d61303c565b600981815481106113ef57fe5b60015473ffffffffffffffffffffffffffffffffffffffff1681565b60025460009073ffffffffffffffffffffffffffffffffffffffff838116911614611b0857506000610d67565b60005b600454811015611c3a57600060048281548110611b2457fe5b6000918252602080832090910154808352600382526040928390205460025484517f21f8a72100000000000000000000000000000000000000000000000000000000815260048101849052945192955073ffffffffffffffffffffffffffffffffffffffff918216949116926321f8a72192602480840193829003018186803b158015611bb057600080fd5b505afa158015611bc4573d6000803e3d6000fd5b505050506040513d6020811015611bda57600080fd5b505173ffffffffffffffffffffffffffffffffffffffff16141580611c21575060008181526003602052604090205473ffffffffffffffffffffffffffffffffffffffff16155b15611c3157600092505050610d67565b50600101611b0b565b50600192915050565b6000611c5084848461369c565b509095945050505050565b60076020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b600a6020526000908152604090208054600182015460028301546003909301549192909160ff8082169161010090041685565b60015473ffffffffffffffffffffffffffffffffffffffff163314611d0c5760405162461bcd60e51b81526004018080602001828103825260358152602001806140766035913960400191505060405180910390fd5b6000546001546040805173ffffffffffffffffffffffffffffffffffffffff938416815292909116602083015280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a160018054600080547fffffffffffffffffffffffff000000000000000000000000000000000000000090811673ffffffffffffffffffffffffffffffffffffffff841617909155169055565b6000610d64826135e0565b611dc461347e565b600680547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff838116919091179182905560408051929091168252517f3df77beb5db05fcdd70a30fc8adf3f83f9501b68579455adbd100b8180940394916020908290030190a150565b60065473ffffffffffffffffffffffffffffffffffffffff1681565b600d6020526000908152604090205481565b6000806000611e8186868661369c565b9250925092505b93509350939050565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b600c6020526000908152604090205481565b611ec761401d565b60005b600454811015611f055760048181548110611ee157fe5b9060005260206000200154828260188110611ef857fe5b6020020152600101611eca565b5090565b6000611f1482612d3e565b517affffffffffffffffffffffffffffffffffffffffffffffffffffff1692915050565b6000610d64826136ee565b611f4b61347e565b60008311611fa0576040805162461bcd60e51b815260206004820152601a60248201527f6c6f7765724c696d6974206d7573742062652061626f76652030000000000000604482015290519081900360640190fd5b848411611fde5760405162461bcd60e51b815260040180806020018281038252602781526020018061424b6027913960400191505060405180910390fd5b611fef85600263ffffffff61376116565b841061202c5760405162461bcd60e51b815260040180806020018281038252602e8152602001806141b2602e913960400191505060405180910390fd5b84831061206a5760405162461bcd60e51b815260040180806020018281038252602781526020018061418b6027913960400191505060405180910390fd5b8180156120745750805b156120c6576040805162461bcd60e51b815260206004820152601c60248201527f43616e6e6f7420667265657a6520617420626f7468206c696d69747300000000604482015290519081900360640190fd5b6000868152600a60205260409020805461211057600b80546001810182556000919091527f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db9018790555b8581556001810185905560028101849055828061212a5750815b156121ff576003810180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016841515177fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100841515021790556000612192886135e0565b6000898152600d6020526040902081905590507ff72828471e37526c68fd812a1fa6eeff993c3f81bd96c0242dc5b3e144145df088856121d257866121d4565b875b604080519283526020830191909152818101849052336060830152519081900360800190a150612239565b6003810180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001690556000878152600d60205260408120555b600061224488611f09565b905080156122c7576122546137ba565b73ffffffffffffffffffffffffffffffffffffffff1663ce09694089836040518363ffffffff1660e01b81526004018083815260200182815260200192505050600060405180830381600087803b1580156122ae57600080fd5b505af11580156122c2573d6000803e3d6000fd5b505050505b60408051898152602081018990528082018890526060810187905290517f37efb38e92b0f94698f6df0c9070e2f00946862a042ac09e34ae8c547684240a9181900360800190a15050505050505050565b60086020526000908152604090205460ff1681565b60065460009073ffffffffffffffffffffffffffffffffffffffff1633146123865760405162461bcd60e51b81526004018080602001828103825260278152602001806140dc6027913960400191505060405180910390fd5b6123f586868080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808a0282810182019093528982529093508992508891829185019084908082843760009201919091525087925061381b915050565b9695505050505050565b6060808383905060405190808252806020026020018201604052801561242f578160200160208202803883390190505b50905060005b83811015610e005761245885858381811061244c57fe5b90506020020135611f09565b82828151811061246457fe5b6020908102919091010152600101612435565b600481815481106113ef57fe5b60606000838390506040519080825280602002602001820160405280156124b5578160200160208202803883390190505b50915060006124c2612956565b90506060612502868680806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250612a9092505050565b905060005b858110156125ee57612517613fd3565b61253288888481811061252657fe5b90506020020135612d3e565b905080600001517affffffffffffffffffffffffffffffffffffffffffffffffffffff1686838151811061256257fe5b602002602001018181525050841580156125ae575087878381811061258357fe5b905060200201357f735553440000000000000000000000000000000000000000000000000000000014155b156125e5578282815181106125bf57fe5b6020026020010151806125e257506125e284826020015164ffffffffff16613021565b94505b50600101612507565b5050509250929050565b61260061347e565b6000818152600a6020526040902054612660576040805162461bcd60e51b815260206004820152601860248201527f4e6f20696e766572746564207072696365206578697374730000000000000000604482015290519081900360640190fd5b6000818152600a60205260408120818155600181018290556002810182905560030180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001690556126b382600b613500565b9050801561166d5760408051838152600060208201819052818301819052606082015290517f37efb38e92b0f94698f6df0c9070e2f00946862a042ac09e34ae8c547684240a9181900360800190a15050565b6000610d6482612a74565b6000818152600a602052604090208054612772576040805162461bcd60e51b815260206004820152601e60248201527f43616e6e6f7420667265657a65206e6f6e2d696e766572736520726174650000604482015290519081900360640190fd5b600381015460ff1615801561279157506003810154610100900460ff16155b6127e2576040805162461bcd60e51b815260206004820152601a60248201527f546865207261746520697320616c72656164792066726f7a656e000000000000604482015290519081900360640190fd5b60006127ed83611f09565b90506000811180156128115750816001015481101580612811575081600201548111155b156128ec57600182015460038301805460028501548414610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff009092169385149390931716919091179055600061288a846135e0565b6000858152600d6020908152604091829020839055815187815290810185905280820183905233606082015290519192507ff72828471e37526c68fd812a1fa6eeff993c3f81bd96c0242dc5b3e144145df0919081900360800190a1506112ec565b6040805162461bcd60e51b815260206004820152601260248201527f526174652077697468696e20626f756e64730000000000000000000000000000604482015290519081900360640190fd5b601881565b60008061294b8484613216565b915091509250929050565b6000612960613a8f565b73ffffffffffffffffffffffffffffffffffffffff166323257c2b7f53797374656d53657474696e67730000000000000000000000000000000000007f726174655374616c65506572696f6400000000000000000000000000000000006040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b1580156129f857600080fd5b505afa158015612a0c573d6000803e3d6000fd5b505050506040513d6020811015612a2257600080fd5b5051905090565b6000827f73555344000000000000000000000000000000000000000000000000000000001415612a5b57506000610e04565b612a6d82612a6885612a74565b613021565b9392505050565b6000612a7f82612d3e565b6020015164ffffffffff1692915050565b60606000612a9c61303c565b905073ffffffffffffffffffffffffffffffffffffffff811615612d0b5760608351604051908082528060200260200182016040528015612ae7578160200160208202803883390190505b50905060005b8451811015612b765760076000868381518110612b0657fe5b6020026020010151815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16828281518110612b4957fe5b73ffffffffffffffffffffffffffffffffffffffff90921660209283029190910190910152600101612aed565b506040517f7d723cac00000000000000000000000000000000000000000000000000000000815260206004820181815283516024840152835173ffffffffffffffffffffffffffffffffffffffff861693637d723cac93869392839260440191808601910280838360005b83811015612bf9578181015183820152602001612be1565b505050509050019250505060006040518083038186803b158015612c1c57600080fd5b505afa158015612c30573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526020811015612c7757600080fd5b8101908080516040519392919084640100000000821115612c9757600080fd5b908301906020820185811115612cac57600080fd5b8251866020820283011164010000000082111715612cc957600080fd5b82525081516020918201928201910280838360005b83811015612cf6578181015183820152602001612cde565b505050509050016040525050509250506114c0565b8251604051908082528060200260200182016040528015612d36578160200160208202803883390190505b509392505050565b612d46613fd3565b60008281526007602052604090205473ffffffffffffffffffffffffffffffffffffffff168015612f405760408051600481526024810182526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167ffeaf968c0000000000000000000000000000000000000000000000000000000017815291518151919260009260609273ffffffffffffffffffffffffffffffffffffffff87169286928291908083835b60208310612e3157805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101612df4565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855afa9150503d8060008114612e91576040519150601f19603f3d011682016040523d82523d6000602084013e612e96565b606091505b50915091508115612f385760008060008380602001905160a0811015612ebb57600080fd5b50805160208201516060909201516040805180820190915291955091935090915080612efd8b612eeb8187613af0565b8769ffffffffffffffffffff16613b99565b7affffffffffffffffffffffffffffffffffffffffffffffffffffff1681526020018264ffffffffff16815250975050505050505050610d67565b5050506114c0565b6000838152600c6020526040902054612f57613fd3565b5060008481526005602090815260408083208484528252918290208251808401845290547affffffffffffffffffffffffffffffffffffffffffffffffffffff80821683527b0100000000000000000000000000000000000000000000000000000090910464ffffffffff1692820192909252825180840190935280519092918291612fe69189911686613b99565b7affffffffffffffffffffffffffffffffffffffffffffffffffffff168152602001826020015164ffffffffff168152509350505050610d67565b600042613034838563ffffffff613cd716565b109392505050565b6000613046613a8f565b73ffffffffffffffffffffffffffffffffffffffff16639ee5955a7f53797374656d53657474696e67730000000000000000000000000000000000007f61676772656761746f725761726e696e67466c616773000000000000000000006040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b1580156129f857600080fd5b6000827f7355534400000000000000000000000000000000000000000000000000000000141561311057506000610e04565b60008381526007602052604090205473ffffffffffffffffffffffffffffffffffffffff16801580613156575073ffffffffffffffffffffffffffffffffffffffff8316155b15613165576000915050610e04565b8273ffffffffffffffffffffffffffffffffffffffff1663357e47fe826040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156131e257600080fd5b505afa1580156131f6573d6000803e3d6000fd5b505050506040513d602081101561320c57600080fd5b5051949350505050565b600082815260076020526040812054819073ffffffffffffffffffffffffffffffffffffffff1680156133d65760408051602480820187905282518083039091018152604490910182526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f9a6fc8f50000000000000000000000000000000000000000000000000000000017815291518151919260009260609273ffffffffffffffffffffffffffffffffffffffff87169286928291908083835b6020831061331257805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016132d5565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855afa9150503d8060008114613372576040519150601f19603f3d011682016040523d82523d6000602084013e613377565b606091505b509150915081156133ce576000808280602001905160a081101561339a57600080fd5b50602081015160609091015190925090506133bf8a6133b98185613af0565b8b613b99565b975095506113db945050505050565b505050613476565b6133de613fd3565b5060008581526005602090815260408083208784528252918290208251808401909352547affffffffffffffffffffffffffffffffffffffffffffffffffffff81168084527b0100000000000000000000000000000000000000000000000000000090910464ffffffffff169183019190915261345d90879087613b99565b60209091015190935064ffffffffff1691506113db9050565b509250929050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146134d45760405162461bcd60e51b815260040180806020018281038252602f815260200180614103602f913960400191505060405180910390fd5b565b6000612a6d8383670de0b6b3a7640000613d31565b6000612a6d8383670de0b6b3a7640000613d6e565b6000805b82548110156135d6578383828154811061351a57fe5b906000526020600020015414156135ce5782818154811061353757fe5b6000918252602082200155825483907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff810190811061357257fe5b906000526020600020015483828154811061358957fe5b60009182526020909120015582546135c3847fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff830161403c565b506001915050610e04565b600101613504565b5060009392505050565b60008181526007602052604081205473ffffffffffffffffffffffffffffffffffffffff168015613686578073ffffffffffffffffffffffffffffffffffffffff1663668a0f026040518163ffffffff1660e01b815260040160206040518083038186803b15801561365157600080fd5b505afa158015613665573d6000803e3d6000fd5b505050506040513d602081101561367b57600080fd5b50519150610d679050565b50506000818152600c6020526040902054610d67565b60008060006136aa86611f09565b9150838614156136be575083915080611e88565b6136c784611f09565b90508015611e88576136e3816110ca878563ffffffff6134d616565b925093509350939050565b60006136f8613fea565b506000828152600a6020908152604091829020825160a0810184528154815260018201549281019290925260028101549282019290925260039091015460ff808216151560608401819052610100909204161515608083015280612a6d57506080015192915050565b60008261377057506000610e04565b8282028284828161377d57fe5b0414612a6d5760405162461bcd60e51b81526004018080602001828103825260218152602001806141326021913960400191505060405180910390fd5b6000610f8d7f45786368616e67657200000000000000000000000000000000000000000000006040518060400160405280601981526020017f4d697373696e672045786368616e676572206164647265737300000000000000815250613da0565b6000825184511461385d5760405162461bcd60e51b81526004018080602001828103825260388152602001806141536038913960400191505060405180910390fd5b610258420182106138b5576040805162461bcd60e51b815260206004820152601f60248201527f54696d6520697320746f6f2066617220696e746f207468652066757475726500604482015290519081900360640190fd5b60005b84518110156139c95760008582815181106138cf57fe5b602002602001015190508482815181106138e557fe5b60200260200101516000141561392c5760405162461bcd60e51b81526004018080602001828103825260398152602001806142126039913960400191505060405180910390fd5b807f7355534400000000000000000000000000000000000000000000000000000000141561398b5760405162461bcd60e51b81526004018080602001828103825260318152602001806140ab6031913960400191505060405180910390fd5b61399481612a74565b8410156139a157506139c1565b6139bf818684815181106139b157fe5b602002602001015186613e4f565b505b6001016138b8565b507f1bc0fc8997efa076f59b5ef02c315bc5390f7a6d24d661ce12128c01a3b0ba578484604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b83811015613a31578181015183820152602001613a19565b50505050905001838103825284818151815260200191508051906020019060200280838360005b83811015613a70578181015183820152602001613a58565b5050505090500194505050505060405180910390a15060019392505050565b6000610f8d7f466c657869626c6553746f7261676500000000000000000000000000000000006040518060400160405280601f81526020017f4d697373696e6720466c657869626c6553746f72616765206164647265737300815250613da0565b600080821215613b47576040805162461bcd60e51b815260206004820152601b60248201527f4e656761746976652072617465206e6f7420737570706f727465640000000000604482015290519081900360640190fd5b60008381526008602052604090205460ff16156114c057600083815260086020526040812054613b7c9060129060ff16613f0c565b600a0a9050613b91838263ffffffff61376116565b915050610e04565b6000613ba3613fea565b506000848152600a6020908152604091829020825160a08101845281548082526001830154938201939093526002820154938101939093526003015460ff8082161515606085015261010090910416151560808301521580613c03575083155b15613c115783915050612a6d565b6000858152600d6020526040902054849250808410801590613c34575081606001515b15613c455781602001519250613cce565b808410158015613c56575081608001515b15613c675781604001519250613cce565b8151600090613c7d90600263ffffffff61376116565b9050858111613c8f5760009350613ca2565b613c9f818763ffffffff613f0c16565b93505b82602001518410613cb95782602001519350613ccc565b82604001518411613ccc57826040015193505b505b50509392505050565b600082820183811015612a6d576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600080600a8304613d48868663ffffffff61376116565b81613d4f57fe5b0490506005600a825b0610613d6257600a015b600a9004949350505050565b600080613d9484613d8887600a870263ffffffff61376116565b9063ffffffff613f6916565b90506005600a82613d58565b60008281526003602052604081205473ffffffffffffffffffffffffffffffffffffffff168281610e005760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015613e14578181015183820152602001613dfc565b50505050905090810190601f168015613e415780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b6000838152600c60209081526040808320805460010190819055815180830183527affffffffffffffffffffffffffffffffffffffffffffffffffffff968716815264ffffffffff9586168185019081529785526005845282852091855292529091209051815494519092167b01000000000000000000000000000000000000000000000000000000029183167fffffffffff00000000000000000000000000000000000000000000000000000090941693909317909116179055565b600082821115613f63576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6000808211613fbf576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b6000828481613fca57fe5b04949350505050565b604080518082019091526000808252602082015290565b6040518060a001604052806000815260200160008152602001600081526020016000151581526020016000151581525090565b6040518061030001604052806018906020820280388339509192915050565b8154818355818111156112ec576000838152602090206112ec918101908301610f9091905b80821115611f05576000815560010161406156fe596f75206d757374206265206e6f6d696e61746564206265666f726520796f752063616e20616363657074206f776e65727368697052617465206f6620735553442063616e6e6f7420626520757064617465642c206974277320616c7761797320554e49542e4f6e6c7920746865206f7261636c652063616e20706572666f726d207468697320616374696f6e4f6e6c792074686520636f6e7472616374206f776e6572206d617920706572666f726d207468697320616374696f6e536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7743757272656e6379206b6579206172726179206c656e677468206d757374206d61746368207261746573206172726179206c656e6774682e6c6f7765724c696d6974206d7573742062652062656c6f772074686520656e747279506f696e7475707065724c696d6974206d757374206265206c657373207468616e20646f75626c6520656e747279506f696e7441676772656761746f7220646563696d616c732073686f756c64206265206c6f776572206f7220657175616c20746f2031385a65726f206973206e6f7420612076616c696420726174652c20706c656173652063616c6c2064656c6574655261746520696e73746561642e75707065724c696d6974206d7573742062652061626f76652074686520656e747279506f696e74a265627a7a72315820d76563ae40513d1d7a52a695a046874f24fbb820214f5f61085690b2d053341064736f6c6343000510003243757272656e6379206b6579206c656e67746820616e642072617465206c656e677468206d757374206d617463682e52617465206f6620735553442063616e6e6f7420626520757064617465642c206974277320616c7761797320554e49542e536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7743757272656e6379206b6579206172726179206c656e677468206d757374206d61746368207261746573206172726179206c656e6774682e5a65726f206973206e6f7420612076616c696420726174652c20706c656173652063616c6c2064656c6574655261746520696e73746561642e000000000000000000000000de910777c787903f78c89e7a0bf7f4c435cbb1fe000000000000000000000000ac1ed4fabbd5204e02950d68b6fc8c446ac953620000000000000000000000004e3b31eb0e5cb73641ee1e65e7dcefe520ba3ef200000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000001534e580000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000036714bb70ddb8000

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061032a5760003560e01c8063654a60ac116101b2578063ac82f608116100f9578063c6c9d828116100a2578063ce8480ea1161007c578063ce8480ea14610cec578063de02795e14610d09578063e3235c9114610d26578063fdadbc7e14610d2e5761032a565b8063c6c9d82814610be3578063c8e5bbd514610c00578063c8e6f39514610ccf5761032a565b8063b295ad34116100d3578063b295ad3414610a7e578063bfa005ce14610ab1578063c2c8a67614610b735761032a565b8063ac82f60814610a05578063af3aea8614610a22578063b199c76414610a3f5761032a565b80637dc0d1d01161015b5780638da5cb5b116101355780638da5cb5b1461099f578063935f4abd146109a7578063ab49848c146109c45761032a565b80637dc0d1d0146109335780637f6e9d151461093b5780638295016a146109585761032a565b806379ba50971161018c57806379ba5097146108db5780637a018a1e146108e35780637adbf973146109005761032a565b8063654a60ac146108495780637103353e14610872578063728dec291461088f5761032a565b80632d7371e1116102765780634308a94f1161021f5780634f72def6116101f95780634f72def6146107f157806353a47bb71461080e578063631e1444146108165761032a565b80634308a94f1461079657806345938849146107cc5780634c36b837146107e95761032a565b806338aa1b991161025057806338aa1b991461070d5780633be99e6f1461072a5780633f0e084f1461075d5761032a565b80632d7371e1146106175780632ea913d4146106d35780633375fcd1146106f05761032a565b8063109e46a2116102d8578063266da16b116102b2578063266da16b146105925780632678df96146105c75780632bed9e0c146105fa5761032a565b8063109e46a2146105115780631627540c146105405780632528f0fe146105755761032a565b80630a7d36d1116103095780630a7d36d1146104515780630c71cd23146104c15780630ee4951b146104f75761032a565b80629919c01461032f57806304f3bcec1461036057806305a046e514610391575b600080fd5b61034c6004803603602081101561034557600080fd5b5035610d51565b604080519115158252519081900360200190f35b610368610d6c565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b610401600480360360208110156103a757600080fd5b8101906020810181356401000000008111156103c257600080fd5b8201836020820111156103d457600080fd5b803590602001918460208302840111640100000000831117156103f657600080fd5b509092509050610d88565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561043d578181015183820152602001610425565b505050509050019250505060405180910390f35b61034c6004803603602081101561046757600080fd5b81019060208101813564010000000081111561048257600080fd5b82018360208201111561049457600080fd5b803590602001918460208302840111640100000000831117156104b657600080fd5b509092509050610e0a565b6104de600480360360208110156104d757600080fd5b5035610ebd565b6040805192835290151560208301528051918290030190f35b6104ff610f83565b60408051918252519081900360200190f35b6104ff6004803603608081101561052757600080fd5b5080359060208101359060408101359060600135610f93565b6105736004803603602081101561055657600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610fd6565b005b61034c6004803603602081101561058b57600080fd5b5035611057565b6104ff600480360360a08110156105a857600080fd5b5080359060208101359060408101359060608101359060800135611077565b610401600480360360208110156105dd57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166110e4565b6105736004803603602081101561061057600080fd5b50356111a5565b61063a6004803603604081101561062d57600080fd5b50803590602001356112f1565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b8381101561067e578181015183820152602001610666565b50505050905001838103825284818151815260200191508051906020019060200280838360005b838110156106bd5781810151838201526020016106a5565b5050505090500194505050505060405180910390f35b6104ff600480360360208110156106e957600080fd5b50356113e2565b61034c6004803603602081101561070657600080fd5b5035611400565b61034c6004803603602081101561072357600080fd5b50356114c6565b6105736004803603602081101561074057600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166114d4565b6105736004803603604081101561077357600080fd5b508035906020013573ffffffffffffffffffffffffffffffffffffffff16611671565b6107b3600480360360208110156107ac57600080fd5b5035611921565b6040805192835260208301919091528051918290030190f35b610573600480360360208110156107e257600080fd5b503561196d565b610368611aa8565b6104ff6004803603602081101561080757600080fd5b5035611ab2565b610368611abf565b61034c6004803603602081101561082c57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611adb565b6104ff6004803603606081101561085f57600080fd5b5080359060208101359060400135611c43565b6103686004803603602081101561088857600080fd5b5035611c5b565b6108ac600480360360208110156108a557600080fd5b5035611c83565b604080519586526020860194909452848401929092521515606084015215156080830152519081900360a00190f35b610573611cb6565b6104ff600480360360208110156108f957600080fd5b5035611db1565b6105736004803603602081101561091657600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611dbc565b610368611e43565b6104ff6004803603602081101561095157600080fd5b5035611e5f565b6109816004803603606081101561096e57600080fd5b5080359060208101359060400135611e71565b60408051938452602084019290925282820152519081900360600190f35b610368611e91565b6104ff600480360360208110156109bd57600080fd5b5035611ead565b6109cc611ebf565b604051808261030080838360005b838110156109f25781810151838201526020016109da565b5050505090500191505060405180910390f35b6104ff60048036036020811015610a1b57600080fd5b5035611f09565b61034c60048036036020811015610a3857600080fd5b5035611f38565b610573600480360360c0811015610a5557600080fd5b50803590602081013590604081013590606081013590608081013515159060a001351515611f43565b610a9b60048036036020811015610a9457600080fd5b5035612318565b6040805160ff9092168252519081900360200190f35b61034c60048036036060811015610ac757600080fd5b810190602081018135640100000000811115610ae257600080fd5b820183602082011115610af457600080fd5b80359060200191846020830284011164010000000083111715610b1657600080fd5b919390929091602081019035640100000000811115610b3457600080fd5b820183602082011115610b4657600080fd5b80359060200191846020830284011164010000000083111715610b6857600080fd5b91935091503561232d565b61040160048036036020811015610b8957600080fd5b810190602081018135640100000000811115610ba457600080fd5b820183602082011115610bb657600080fd5b80359060200191846020830284011164010000000083111715610bd857600080fd5b5090925090506123ff565b6104ff60048036036020811015610bf957600080fd5b5035612477565b610c7060048036036020811015610c1657600080fd5b810190602081018135640100000000811115610c3157600080fd5b820183602082011115610c4357600080fd5b80359060200191846020830284011164010000000083111715610c6557600080fd5b509092509050612484565b604051808060200183151515158152602001828103825284818151815260200191508051906020019060200280838360005b83811015610cba578181015183820152602001610ca2565b50505050905001935050505060405180910390f35b61057360048036036020811015610ce557600080fd5b50356125f8565b6104ff60048036036020811015610d0257600080fd5b5035612706565b61057360048036036020811015610d1f57600080fd5b5035612711565b6104ff612939565b6107b360048036036040811015610d4457600080fd5b508035906020013561293e565b6000610d6482610d5f612956565b612a29565b90505b919050565b60025473ffffffffffffffffffffffffffffffffffffffff1681565b60608083839050604051908082528060200260200182016040528015610db8578160200160208202803883390190505b50905060005b83811015610e0057610de1858583818110610dd557fe5b90506020020135612a74565b828281518110610ded57fe5b6020908102919091010152600101610dbe565b5090505b92915050565b600080610e15612956565b90506060610e55858580806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250612a9092505050565b905060005b84811015610eb157818181518110610e6e57fe5b602002602001015180610e985750610e98868683818110610e8b57fe5b9050602002013584612a29565b15610ea95760019350505050610e04565b600101610e5a565b50600095945050505050565b600080610ec8613fd3565b610ed184612d3e565b9050837f73555344000000000000000000000000000000000000000000000000000000001415610f2457517affffffffffffffffffffffffffffffffffffffffffffffffffffff16915060009050610f7e565b8051610f42610f31612956565b836020015164ffffffffff16613021565b80610f595750610f5985610f5461303c565b6130de565b7affffffffffffffffffffffffffffffffffffffffffffffffffffff90911693509150505b915091565b6000610f8d612956565b90505b90565b600083815b610fa58783600101613216565b915050801580610fb6575083850181115b15610fc357509050610fce565b600190910190610f98565b949350505050565b610fde61347e565b6001805473ffffffffffffffffffffffffffffffffffffffff83167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116811790915560408051918252517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce229181900360200190a150565b600061106582610d5f612956565b80610d645750610d6482610f5461303c565b6000838614156110885750836110db565b60006110948785613216565b50905060006110a38685613216565b509050806110b6576000925050506110db565b6110d6816110ca898563ffffffff6134d616565b9063ffffffff6134eb16565b925050505b95945050505050565b600954604080518281526020808402820101909152606091600091908015611116578160200160208202803883390190505b50915060005b60095481101561119e5760006009828154811061113557fe5b6000918252602080832090910154808352600790915260409091205490915073ffffffffffffffffffffffffffffffffffffffff9081169086161415611195578084848060010195508151811061118857fe5b6020026020010181815250505b5060010161111c565b5050919050565b6111ad61347e565b60008181526007602052604090205473ffffffffffffffffffffffffffffffffffffffff1680611224576040805162461bcd60e51b815260206004820152601c60248201527f4e6f2061676772656761746f722065786973747320666f72206b657900000000604482015290519081900360640190fd5b600082815260076020908152604080832080547fffffffffffffffffffffffff00000000000000000000000000000000000000001690556008909152812080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055611293836009613500565b905080156112ec576040805184815273ffffffffffffffffffffffffffffffffffffffff8416602082015281517fec70e890fc7db7de4059b114c9093a1f41283d18ffcfbcac45566feea4d4f777929181900390910190a15b505050565b6060808260405190808252806020026020018201604052801561131e578160200160208202803883390190505b5091508260405190808252806020026020018201604052801561134b578160200160208202803883390190505b5090506000611359856135e0565b905060005b848110156113d8576113708683613216565b85838151811061137c57fe5b6020026020010185848151811061138f57fe5b602090810291909101019190915252816113ab57506113db9050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9091019060010161135e565b50505b9250929050565b600b81815481106113ef57fe5b600091825260209091200154905081565b600061140a613fea565b506000828152600a6020908152604091829020825160a08101845281548082526001830154938201939093526002820154938101939093526003015460ff808216151560608501526101009091041615156080830152158061146d575080606001515b80611479575080608001515b15611488576000915050610d67565b600061149384611f09565b90506000811180156114b757508160200151811015806114b7575081604001518111155b92505050610d67565b50919050565b6000610d6482610f5461303c565b6114dc61347e565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff831617905560005b60045481101561166d5760006004828154811061153857fe5b60009182526020918290200154600254604080517fdacb2d010000000000000000000000000000000000000000000000000000000081526004810184905260248101829052601760448201527f5265736f6c766572206d697373696e67207461726765740000000000000000006064820152905192945073ffffffffffffffffffffffffffffffffffffffff9091169263dacb2d0192608480840193829003018186803b1580156115e857600080fd5b505afa1580156115fc573d6000803e3d6000fd5b505050506040513d602081101561161257600080fd5b505160009182526003602052604090912080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff90921691909117905560010161151f565b5050565b61167961347e565b600081905060008173ffffffffffffffffffffffffffffffffffffffff1663668a0f026040518163ffffffff1660e01b815260040160206040518083038186803b1580156116c657600080fd5b505afa1580156116da573d6000803e3d6000fd5b505050506040513d60208110156116f057600080fd5b50511015611745576040805162461bcd60e51b815260206004820152601b60248201527f476976656e2041676772656761746f7220697320696e76616c69640000000000604482015290519081900360640190fd5b60008173ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561178d57600080fd5b505afa1580156117a1573d6000803e3d6000fd5b505050506040513d60208110156117b757600080fd5b50519050601260ff821611156117fe5760405162461bcd60e51b81526004018080602001828103825260328152602001806141e06032913960400191505060405180910390fd5b60008481526007602052604090205473ffffffffffffffffffffffffffffffffffffffff1661185d57600980546001810182556000919091527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af018490555b600084815260076020908152604080832080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8716908117909155600883529281902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff861617905580518781529182019290925281517f0bcae573430f69c5361e5d76534d3f61d2d803958778680cd74be9dc6299bc63929181900390910190a150505050565b60008061192c613fd3565b61193584612d3e565b80516020909101517affffffffffffffffffffffffffffffffffffffffffffffffffffff909116935064ffffffffff16915050915091565b60065473ffffffffffffffffffffffffffffffffffffffff1633146119c35760405162461bcd60e51b81526004018080602001828103825260278152602001806140dc6027913960400191505060405180910390fd5b60006119ce82611f09565b11611a20576040805162461bcd60e51b815260206004820152600c60248201527f52617465206973207a65726f0000000000000000000000000000000000000000604482015290519081900360640190fd5b6000818152600560209081526040808320600c808452828520805486529184528285208590559385905292825282547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01909255815183815291517fe69d655565c7ff1353d8eaeea62fb7904fa9696987431ec351be288c865f1ae19281900390910190a150565b6000610f8d61303c565b600981815481106113ef57fe5b60015473ffffffffffffffffffffffffffffffffffffffff1681565b60025460009073ffffffffffffffffffffffffffffffffffffffff838116911614611b0857506000610d67565b60005b600454811015611c3a57600060048281548110611b2457fe5b6000918252602080832090910154808352600382526040928390205460025484517f21f8a72100000000000000000000000000000000000000000000000000000000815260048101849052945192955073ffffffffffffffffffffffffffffffffffffffff918216949116926321f8a72192602480840193829003018186803b158015611bb057600080fd5b505afa158015611bc4573d6000803e3d6000fd5b505050506040513d6020811015611bda57600080fd5b505173ffffffffffffffffffffffffffffffffffffffff16141580611c21575060008181526003602052604090205473ffffffffffffffffffffffffffffffffffffffff16155b15611c3157600092505050610d67565b50600101611b0b565b50600192915050565b6000611c5084848461369c565b509095945050505050565b60076020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b600a6020526000908152604090208054600182015460028301546003909301549192909160ff8082169161010090041685565b60015473ffffffffffffffffffffffffffffffffffffffff163314611d0c5760405162461bcd60e51b81526004018080602001828103825260358152602001806140766035913960400191505060405180910390fd5b6000546001546040805173ffffffffffffffffffffffffffffffffffffffff938416815292909116602083015280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a160018054600080547fffffffffffffffffffffffff000000000000000000000000000000000000000090811673ffffffffffffffffffffffffffffffffffffffff841617909155169055565b6000610d64826135e0565b611dc461347e565b600680547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff838116919091179182905560408051929091168252517f3df77beb5db05fcdd70a30fc8adf3f83f9501b68579455adbd100b8180940394916020908290030190a150565b60065473ffffffffffffffffffffffffffffffffffffffff1681565b600d6020526000908152604090205481565b6000806000611e8186868661369c565b9250925092505b93509350939050565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b600c6020526000908152604090205481565b611ec761401d565b60005b600454811015611f055760048181548110611ee157fe5b9060005260206000200154828260188110611ef857fe5b6020020152600101611eca565b5090565b6000611f1482612d3e565b517affffffffffffffffffffffffffffffffffffffffffffffffffffff1692915050565b6000610d64826136ee565b611f4b61347e565b60008311611fa0576040805162461bcd60e51b815260206004820152601a60248201527f6c6f7765724c696d6974206d7573742062652061626f76652030000000000000604482015290519081900360640190fd5b848411611fde5760405162461bcd60e51b815260040180806020018281038252602781526020018061424b6027913960400191505060405180910390fd5b611fef85600263ffffffff61376116565b841061202c5760405162461bcd60e51b815260040180806020018281038252602e8152602001806141b2602e913960400191505060405180910390fd5b84831061206a5760405162461bcd60e51b815260040180806020018281038252602781526020018061418b6027913960400191505060405180910390fd5b8180156120745750805b156120c6576040805162461bcd60e51b815260206004820152601c60248201527f43616e6e6f7420667265657a6520617420626f7468206c696d69747300000000604482015290519081900360640190fd5b6000868152600a60205260409020805461211057600b80546001810182556000919091527f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db9018790555b8581556001810185905560028101849055828061212a5750815b156121ff576003810180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016841515177fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100841515021790556000612192886135e0565b6000898152600d6020526040902081905590507ff72828471e37526c68fd812a1fa6eeff993c3f81bd96c0242dc5b3e144145df088856121d257866121d4565b875b604080519283526020830191909152818101849052336060830152519081900360800190a150612239565b6003810180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001690556000878152600d60205260408120555b600061224488611f09565b905080156122c7576122546137ba565b73ffffffffffffffffffffffffffffffffffffffff1663ce09694089836040518363ffffffff1660e01b81526004018083815260200182815260200192505050600060405180830381600087803b1580156122ae57600080fd5b505af11580156122c2573d6000803e3d6000fd5b505050505b60408051898152602081018990528082018890526060810187905290517f37efb38e92b0f94698f6df0c9070e2f00946862a042ac09e34ae8c547684240a9181900360800190a15050505050505050565b60086020526000908152604090205460ff1681565b60065460009073ffffffffffffffffffffffffffffffffffffffff1633146123865760405162461bcd60e51b81526004018080602001828103825260278152602001806140dc6027913960400191505060405180910390fd5b6123f586868080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808a0282810182019093528982529093508992508891829185019084908082843760009201919091525087925061381b915050565b9695505050505050565b6060808383905060405190808252806020026020018201604052801561242f578160200160208202803883390190505b50905060005b83811015610e005761245885858381811061244c57fe5b90506020020135611f09565b82828151811061246457fe5b6020908102919091010152600101612435565b600481815481106113ef57fe5b60606000838390506040519080825280602002602001820160405280156124b5578160200160208202803883390190505b50915060006124c2612956565b90506060612502868680806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250612a9092505050565b905060005b858110156125ee57612517613fd3565b61253288888481811061252657fe5b90506020020135612d3e565b905080600001517affffffffffffffffffffffffffffffffffffffffffffffffffffff1686838151811061256257fe5b602002602001018181525050841580156125ae575087878381811061258357fe5b905060200201357f735553440000000000000000000000000000000000000000000000000000000014155b156125e5578282815181106125bf57fe5b6020026020010151806125e257506125e284826020015164ffffffffff16613021565b94505b50600101612507565b5050509250929050565b61260061347e565b6000818152600a6020526040902054612660576040805162461bcd60e51b815260206004820152601860248201527f4e6f20696e766572746564207072696365206578697374730000000000000000604482015290519081900360640190fd5b6000818152600a60205260408120818155600181018290556002810182905560030180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001690556126b382600b613500565b9050801561166d5760408051838152600060208201819052818301819052606082015290517f37efb38e92b0f94698f6df0c9070e2f00946862a042ac09e34ae8c547684240a9181900360800190a15050565b6000610d6482612a74565b6000818152600a602052604090208054612772576040805162461bcd60e51b815260206004820152601e60248201527f43616e6e6f7420667265657a65206e6f6e2d696e766572736520726174650000604482015290519081900360640190fd5b600381015460ff1615801561279157506003810154610100900460ff16155b6127e2576040805162461bcd60e51b815260206004820152601a60248201527f546865207261746520697320616c72656164792066726f7a656e000000000000604482015290519081900360640190fd5b60006127ed83611f09565b90506000811180156128115750816001015481101580612811575081600201548111155b156128ec57600182015460038301805460028501548414610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff009092169385149390931716919091179055600061288a846135e0565b6000858152600d6020908152604091829020839055815187815290810185905280820183905233606082015290519192507ff72828471e37526c68fd812a1fa6eeff993c3f81bd96c0242dc5b3e144145df0919081900360800190a1506112ec565b6040805162461bcd60e51b815260206004820152601260248201527f526174652077697468696e20626f756e64730000000000000000000000000000604482015290519081900360640190fd5b601881565b60008061294b8484613216565b915091509250929050565b6000612960613a8f565b73ffffffffffffffffffffffffffffffffffffffff166323257c2b7f53797374656d53657474696e67730000000000000000000000000000000000007f726174655374616c65506572696f6400000000000000000000000000000000006040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b1580156129f857600080fd5b505afa158015612a0c573d6000803e3d6000fd5b505050506040513d6020811015612a2257600080fd5b5051905090565b6000827f73555344000000000000000000000000000000000000000000000000000000001415612a5b57506000610e04565b612a6d82612a6885612a74565b613021565b9392505050565b6000612a7f82612d3e565b6020015164ffffffffff1692915050565b60606000612a9c61303c565b905073ffffffffffffffffffffffffffffffffffffffff811615612d0b5760608351604051908082528060200260200182016040528015612ae7578160200160208202803883390190505b50905060005b8451811015612b765760076000868381518110612b0657fe5b6020026020010151815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16828281518110612b4957fe5b73ffffffffffffffffffffffffffffffffffffffff90921660209283029190910190910152600101612aed565b506040517f7d723cac00000000000000000000000000000000000000000000000000000000815260206004820181815283516024840152835173ffffffffffffffffffffffffffffffffffffffff861693637d723cac93869392839260440191808601910280838360005b83811015612bf9578181015183820152602001612be1565b505050509050019250505060006040518083038186803b158015612c1c57600080fd5b505afa158015612c30573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526020811015612c7757600080fd5b8101908080516040519392919084640100000000821115612c9757600080fd5b908301906020820185811115612cac57600080fd5b8251866020820283011164010000000082111715612cc957600080fd5b82525081516020918201928201910280838360005b83811015612cf6578181015183820152602001612cde565b505050509050016040525050509250506114c0565b8251604051908082528060200260200182016040528015612d36578160200160208202803883390190505b509392505050565b612d46613fd3565b60008281526007602052604090205473ffffffffffffffffffffffffffffffffffffffff168015612f405760408051600481526024810182526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167ffeaf968c0000000000000000000000000000000000000000000000000000000017815291518151919260009260609273ffffffffffffffffffffffffffffffffffffffff87169286928291908083835b60208310612e3157805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101612df4565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855afa9150503d8060008114612e91576040519150601f19603f3d011682016040523d82523d6000602084013e612e96565b606091505b50915091508115612f385760008060008380602001905160a0811015612ebb57600080fd5b50805160208201516060909201516040805180820190915291955091935090915080612efd8b612eeb8187613af0565b8769ffffffffffffffffffff16613b99565b7affffffffffffffffffffffffffffffffffffffffffffffffffffff1681526020018264ffffffffff16815250975050505050505050610d67565b5050506114c0565b6000838152600c6020526040902054612f57613fd3565b5060008481526005602090815260408083208484528252918290208251808401845290547affffffffffffffffffffffffffffffffffffffffffffffffffffff80821683527b0100000000000000000000000000000000000000000000000000000090910464ffffffffff1692820192909252825180840190935280519092918291612fe69189911686613b99565b7affffffffffffffffffffffffffffffffffffffffffffffffffffff168152602001826020015164ffffffffff168152509350505050610d67565b600042613034838563ffffffff613cd716565b109392505050565b6000613046613a8f565b73ffffffffffffffffffffffffffffffffffffffff16639ee5955a7f53797374656d53657474696e67730000000000000000000000000000000000007f61676772656761746f725761726e696e67466c616773000000000000000000006040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b1580156129f857600080fd5b6000827f7355534400000000000000000000000000000000000000000000000000000000141561311057506000610e04565b60008381526007602052604090205473ffffffffffffffffffffffffffffffffffffffff16801580613156575073ffffffffffffffffffffffffffffffffffffffff8316155b15613165576000915050610e04565b8273ffffffffffffffffffffffffffffffffffffffff1663357e47fe826040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156131e257600080fd5b505afa1580156131f6573d6000803e3d6000fd5b505050506040513d602081101561320c57600080fd5b5051949350505050565b600082815260076020526040812054819073ffffffffffffffffffffffffffffffffffffffff1680156133d65760408051602480820187905282518083039091018152604490910182526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f9a6fc8f50000000000000000000000000000000000000000000000000000000017815291518151919260009260609273ffffffffffffffffffffffffffffffffffffffff87169286928291908083835b6020831061331257805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016132d5565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855afa9150503d8060008114613372576040519150601f19603f3d011682016040523d82523d6000602084013e613377565b606091505b509150915081156133ce576000808280602001905160a081101561339a57600080fd5b50602081015160609091015190925090506133bf8a6133b98185613af0565b8b613b99565b975095506113db945050505050565b505050613476565b6133de613fd3565b5060008581526005602090815260408083208784528252918290208251808401909352547affffffffffffffffffffffffffffffffffffffffffffffffffffff81168084527b0100000000000000000000000000000000000000000000000000000090910464ffffffffff169183019190915261345d90879087613b99565b60209091015190935064ffffffffff1691506113db9050565b509250929050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146134d45760405162461bcd60e51b815260040180806020018281038252602f815260200180614103602f913960400191505060405180910390fd5b565b6000612a6d8383670de0b6b3a7640000613d31565b6000612a6d8383670de0b6b3a7640000613d6e565b6000805b82548110156135d6578383828154811061351a57fe5b906000526020600020015414156135ce5782818154811061353757fe5b6000918252602082200155825483907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff810190811061357257fe5b906000526020600020015483828154811061358957fe5b60009182526020909120015582546135c3847fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff830161403c565b506001915050610e04565b600101613504565b5060009392505050565b60008181526007602052604081205473ffffffffffffffffffffffffffffffffffffffff168015613686578073ffffffffffffffffffffffffffffffffffffffff1663668a0f026040518163ffffffff1660e01b815260040160206040518083038186803b15801561365157600080fd5b505afa158015613665573d6000803e3d6000fd5b505050506040513d602081101561367b57600080fd5b50519150610d679050565b50506000818152600c6020526040902054610d67565b60008060006136aa86611f09565b9150838614156136be575083915080611e88565b6136c784611f09565b90508015611e88576136e3816110ca878563ffffffff6134d616565b925093509350939050565b60006136f8613fea565b506000828152600a6020908152604091829020825160a0810184528154815260018201549281019290925260028101549282019290925260039091015460ff808216151560608401819052610100909204161515608083015280612a6d57506080015192915050565b60008261377057506000610e04565b8282028284828161377d57fe5b0414612a6d5760405162461bcd60e51b81526004018080602001828103825260218152602001806141326021913960400191505060405180910390fd5b6000610f8d7f45786368616e67657200000000000000000000000000000000000000000000006040518060400160405280601981526020017f4d697373696e672045786368616e676572206164647265737300000000000000815250613da0565b6000825184511461385d5760405162461bcd60e51b81526004018080602001828103825260388152602001806141536038913960400191505060405180910390fd5b610258420182106138b5576040805162461bcd60e51b815260206004820152601f60248201527f54696d6520697320746f6f2066617220696e746f207468652066757475726500604482015290519081900360640190fd5b60005b84518110156139c95760008582815181106138cf57fe5b602002602001015190508482815181106138e557fe5b60200260200101516000141561392c5760405162461bcd60e51b81526004018080602001828103825260398152602001806142126039913960400191505060405180910390fd5b807f7355534400000000000000000000000000000000000000000000000000000000141561398b5760405162461bcd60e51b81526004018080602001828103825260318152602001806140ab6031913960400191505060405180910390fd5b61399481612a74565b8410156139a157506139c1565b6139bf818684815181106139b157fe5b602002602001015186613e4f565b505b6001016138b8565b507f1bc0fc8997efa076f59b5ef02c315bc5390f7a6d24d661ce12128c01a3b0ba578484604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b83811015613a31578181015183820152602001613a19565b50505050905001838103825284818151815260200191508051906020019060200280838360005b83811015613a70578181015183820152602001613a58565b5050505090500194505050505060405180910390a15060019392505050565b6000610f8d7f466c657869626c6553746f7261676500000000000000000000000000000000006040518060400160405280601f81526020017f4d697373696e6720466c657869626c6553746f72616765206164647265737300815250613da0565b600080821215613b47576040805162461bcd60e51b815260206004820152601b60248201527f4e656761746976652072617465206e6f7420737570706f727465640000000000604482015290519081900360640190fd5b60008381526008602052604090205460ff16156114c057600083815260086020526040812054613b7c9060129060ff16613f0c565b600a0a9050613b91838263ffffffff61376116565b915050610e04565b6000613ba3613fea565b506000848152600a6020908152604091829020825160a08101845281548082526001830154938201939093526002820154938101939093526003015460ff8082161515606085015261010090910416151560808301521580613c03575083155b15613c115783915050612a6d565b6000858152600d6020526040902054849250808410801590613c34575081606001515b15613c455781602001519250613cce565b808410158015613c56575081608001515b15613c675781604001519250613cce565b8151600090613c7d90600263ffffffff61376116565b9050858111613c8f5760009350613ca2565b613c9f818763ffffffff613f0c16565b93505b82602001518410613cb95782602001519350613ccc565b82604001518411613ccc57826040015193505b505b50509392505050565b600082820183811015612a6d576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600080600a8304613d48868663ffffffff61376116565b81613d4f57fe5b0490506005600a825b0610613d6257600a015b600a9004949350505050565b600080613d9484613d8887600a870263ffffffff61376116565b9063ffffffff613f6916565b90506005600a82613d58565b60008281526003602052604081205473ffffffffffffffffffffffffffffffffffffffff168281610e005760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015613e14578181015183820152602001613dfc565b50505050905090810190601f168015613e415780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b6000838152600c60209081526040808320805460010190819055815180830183527affffffffffffffffffffffffffffffffffffffffffffffffffffff968716815264ffffffffff9586168185019081529785526005845282852091855292529091209051815494519092167b01000000000000000000000000000000000000000000000000000000029183167fffffffffff00000000000000000000000000000000000000000000000000000090941693909317909116179055565b600082821115613f63576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6000808211613fbf576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b6000828481613fca57fe5b04949350505050565b604080518082019091526000808252602082015290565b6040518060a001604052806000815260200160008152602001600081526020016000151581526020016000151581525090565b6040518061030001604052806018906020820280388339509192915050565b8154818355818111156112ec576000838152602090206112ec918101908301610f9091905b80821115611f05576000815560010161406156fe596f75206d757374206265206e6f6d696e61746564206265666f726520796f752063616e20616363657074206f776e65727368697052617465206f6620735553442063616e6e6f7420626520757064617465642c206974277320616c7761797320554e49542e4f6e6c7920746865206f7261636c652063616e20706572666f726d207468697320616374696f6e4f6e6c792074686520636f6e7472616374206f776e6572206d617920706572666f726d207468697320616374696f6e536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7743757272656e6379206b6579206172726179206c656e677468206d757374206d61746368207261746573206172726179206c656e6774682e6c6f7765724c696d6974206d7573742062652062656c6f772074686520656e747279506f696e7475707065724c696d6974206d757374206265206c657373207468616e20646f75626c6520656e747279506f696e7441676772656761746f7220646563696d616c732073686f756c64206265206c6f776572206f7220657175616c20746f2031385a65726f206973206e6f7420612076616c696420726174652c20706c656173652063616c6c2064656c6574655261746520696e73746561642e75707065724c696d6974206d7573742062652061626f76652074686520656e747279506f696e74a265627a7a72315820d76563ae40513d1d7a52a695a046874f24fbb820214f5f61085690b2d053341064736f6c63430005100032

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

000000000000000000000000de910777c787903f78c89e7a0bf7f4c435cbb1fe000000000000000000000000ac1ed4fabbd5204e02950d68b6fc8c446ac953620000000000000000000000004e3b31eb0e5cb73641ee1e65e7dcefe520ba3ef200000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000001534e580000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000036714bb70ddb8000

-----Decoded View---------------
Arg [0] : _owner (address): 0xDe910777C787903F78C89e7a0bf7F4C435cBB1Fe
Arg [1] : _oracle (address): 0xaC1ED4Fabbd5204E02950D68b6FC8c446AC95362
Arg [2] : _resolver (address): 0x4E3b31eB0E5CB73641EE1E65E7dCEFe520bA3ef2
Arg [3] : _currencyKeys (bytes32[]): System.Byte[]
Arg [4] : _newRates (uint256[]): 3923000000000000000

-----Encoded View---------------
9 Constructor Arguments found :
Arg [0] : 000000000000000000000000de910777c787903f78c89e7a0bf7f4c435cbb1fe
Arg [1] : 000000000000000000000000ac1ed4fabbd5204e02950d68b6fc8c446ac95362
Arg [2] : 0000000000000000000000004e3b31eb0e5cb73641ee1e65e7dcefe520ba3ef2
Arg [3] : 00000000000000000000000000000000000000000000000000000000000000a0
Arg [4] : 00000000000000000000000000000000000000000000000000000000000000e0
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [6] : 534e580000000000000000000000000000000000000000000000000000000000
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [8] : 00000000000000000000000000000000000000000000000036714bb70ddb8000


Libraries Used


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.