ETH Price: $2,604.93 (-1.60%)

Contract

0x1d53a13D78766C0Db6eF73eC0ae1138eA2b6f5D4
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Settle110022602020-10-06 12:40:261416 days ago1601988026IN
0x1d53a13D...eA2b6f5D4
0 ETH0.0186282793
Settle109910172020-10-04 18:42:411418 days ago1601836961IN
0x1d53a13D...eA2b6f5D4
0 ETH0.0158659688
Settle109878192020-10-04 6:38:501418 days ago1601793530IN
0x1d53a13D...eA2b6f5D4
0 ETH0.0061826647
Settle109404642020-09-26 20:51:491425 days ago1601153509IN
0x1d53a13D...eA2b6f5D4
0 ETH0.0089340274
Settle109375282020-09-26 9:48:531426 days ago1601113733IN
0x1d53a13D...eA2b6f5D4
0 ETH0.0122183661
Settle109273682020-09-24 20:00:521427 days ago1600977652IN
0x1d53a13D...eA2b6f5D4
0 ETH0.0103830386
Settle109219912020-09-24 0:12:211428 days ago1600906341IN
0x1d53a13D...eA2b6f5D4
0 ETH0.009923173
Settle109191952020-09-23 13:39:101429 days ago1600868350IN
0x1d53a13D...eA2b6f5D4
0 ETH0.08305752130
Settle109191692020-09-23 13:32:481429 days ago1600867968IN
0x1d53a13D...eA2b6f5D4
0 ETH0.00578026123
Settle109089042020-09-21 23:50:311430 days ago1600732231IN
0x1d53a13D...eA2b6f5D4
0 ETH0.0122339790
Settle109065872020-09-21 15:25:281431 days ago1600701928IN
0x1d53a13D...eA2b6f5D4
0 ETH0.04859001235
Settle109046512020-09-21 8:27:001431 days ago1600676820IN
0x1d53a13D...eA2b6f5D4
0 ETH0.01774388130.9
Settle109045432020-09-21 8:04:121431 days ago1600675452IN
0x1d53a13D...eA2b6f5D4
0 ETH0.01735078128
Settle108961502020-09-20 1:17:141432 days ago1600564634IN
0x1d53a13D...eA2b6f5D4
0 ETH0.02033295150
Settle108951342020-09-19 21:34:571432 days ago1600551297IN
0x1d53a13D...eA2b6f5D4
0 ETH0.05305273108
Settle108629102020-09-14 22:51:441437 days ago1600123904IN
0x1d53a13D...eA2b6f5D4
0 ETH0.01613152119
Settle108492792020-09-12 20:22:471439 days ago1599942167IN
0x1d53a13D...eA2b6f5D4
0 ETH0.02271863110
Settle108432082020-09-11 22:08:551440 days ago1599862135IN
0x1d53a13D...eA2b6f5D4
0 ETH0.0171417483
Settle108383892020-09-11 4:25:561441 days ago1599798356IN
0x1d53a13D...eA2b6f5D4
0 ETH0.02032095150
Settle108237262020-09-08 22:22:561443 days ago1599603776IN
0x1d53a13D...eA2b6f5D4
0 ETH0.0111455282
Settle108208932020-09-08 12:05:281444 days ago1599566728IN
0x1d53a13D...eA2b6f5D4
0 ETH0.0141001482
Settle108116142020-09-07 1:38:201445 days ago1599442700IN
0x1d53a13D...eA2b6f5D4
0 ETH0.0257948789
Settle108082972020-09-06 13:41:231446 days ago1599399683IN
0x1d53a13D...eA2b6f5D4
0 ETH0.0156316115
Settle108050622020-09-06 1:52:321446 days ago1599357152IN
0x1d53a13D...eA2b6f5D4
0 ETH0.0234380599
Settle108046512020-09-06 0:21:141446 days ago1599351674IN
0x1d53a13D...eA2b6f5D4
0 ETH0.04631604120
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Exchanger

Compiler Version
v0.5.16+commit.9c3226ce

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2020-09-01
*/

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

* Synthetix: Exchanger.sol
*
* Latest source (may be newer): https://github.com/Synthetixio/synthetix/blob/master/contracts/Exchanger.sol
* Docs: https://docs.synthetix.io/contracts/Exchanger
*
* Contract Dependencies: 
*	- IAddressResolver
*	- IExchanger
*	- 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/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 {
        require(msg.sender == owner, "Only the contract owner may perform this action");
        _;
    }

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


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


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


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


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


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


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


/**
 * @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/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 IERC20 {
    // ERC20 Optional Views
    function name() external view returns (string memory);

    function symbol() external view returns (string memory);

    function decimals() external view returns (uint8);

    // Views
    function totalSupply() external view returns (uint);

    function balanceOf(address owner) external view returns (uint);

    function allowance(address owner, address spender) external view returns (uint);

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

    function approve(address spender, uint value) external returns (bool);

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

    // Events
    event Transfer(address indexed from, address indexed to, uint value);

    event Approval(address indexed owner, address indexed spender, uint value);
}


interface ISystemStatus {
    struct Status {
        bool canSuspend;
        bool canResume;
    }

    struct Suspension {
        bool suspended;
        // reason is an integer code,
        // 0 => no reason, 1 => upgrading, 2+ => defined by system usage
        uint248 reason;
    }

    // Views
    function accessControl(bytes32 section, address account) external view returns (bool canSuspend, bool canResume);

    function requireSystemActive() external view;

    function requireIssuanceActive() external view;

    function requireExchangeActive() external view;

    function requireSynthActive(bytes32 currencyKey) external view;

    function requireSynthsActive(bytes32 sourceCurrencyKey, bytes32 destinationCurrencyKey) external view;

    function synthSuspension(bytes32 currencyKey) external view returns (bool suspended, uint248 reason);

    // Restricted functions
    function suspendSynth(bytes32 currencyKey, uint256 reason) external;

    function updateAccessControl(
        bytes32 section,
        address account,
        bool canSuspend,
        bool canResume
    ) external;
}


interface IExchangeState {
    // Views
    struct ExchangeEntry {
        bytes32 src;
        uint amount;
        bytes32 dest;
        uint amountReceived;
        uint exchangeFeeRate;
        uint timestamp;
        uint roundIdForSrc;
        uint roundIdForDest;
    }

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

    function getEntryAt(
        address account,
        bytes32 currencyKey,
        uint index
    )
        external
        view
        returns (
            bytes32 src,
            uint amount,
            bytes32 dest,
            uint amountReceived,
            uint exchangeFeeRate,
            uint timestamp,
            uint roundIdForSrc,
            uint roundIdForDest
        );

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

    // Mutative functions
    function appendExchangeEntry(
        address account,
        bytes32 src,
        uint amount,
        bytes32 dest,
        uint amountReceived,
        uint exchangeFeeRate,
        uint timestamp,
        uint roundIdForSrc,
        uint roundIdForDest
    ) external;

    function removeEntries(address account, bytes32 currencyKey) external;
}


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


interface ISynthetix {
    // 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 collateral(address account) external view returns (uint);

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

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

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

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

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

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

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

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

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

    function transferableSynthetix(address account) external view returns (uint transferable);

    // Mutative Functions
    function burnSynths(uint amount) external;

    function burnSynthsOnBehalf(address burnForAddress, uint amount) external;

    function burnSynthsToTarget() external;

    function burnSynthsToTargetOnBehalf(address burnForAddress) external;

    function exchange(
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey
    ) external returns (uint amountReceived);

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

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

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

    function issueMaxSynths() external;

    function issueMaxSynthsOnBehalf(address issueForAddress) external;

    function issueSynths(uint amount) external;

    function issueSynthsOnBehalf(address issueForAddress, uint amount) external;

    function mint() external returns (bool);

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

    function liquidateDelinquentAccount(address account, uint susdAmount) external returns (bool);
}


interface IFeePool {
    // Views

    // solhint-disable-next-line func-name-mixedcase
    function FEE_ADDRESS() external view returns (address);

    function feesAvailable(address account) external view returns (uint, uint);

    function feePeriodDuration() external view returns (uint);

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

    function targetThreshold() external view returns (uint);

    function totalFeesAvailable() external view returns (uint);

    function totalRewardsAvailable() external view returns (uint);

    // Mutative Functions
    function claimFees() external returns (bool);

    function claimOnBehalf(address claimingForAddress) external returns (bool);

    function closeCurrentFeePeriod() external;

    // Restricted: used internally to Synthetix
    function appendAccountIssuanceRecord(
        address account,
        uint lockedAmount,
        uint debtEntryIndex
    ) external;

    function recordFeePaid(uint sUSDAmount) external;

    function setRewardsToDistribute(uint amount) external;
}


interface IDelegateApprovals {
    // Views
    function canBurnFor(address authoriser, address delegate) external view returns (bool);

    function canIssueFor(address authoriser, address delegate) external view returns (bool);

    function canClaimFor(address authoriser, address delegate) external view returns (bool);

    function canExchangeFor(address authoriser, address delegate) external view returns (bool);

    // Mutative
    function approveAllDelegatePowers(address delegate) external;

    function removeAllDelegatePowers(address delegate) external;

    function approveBurnOnBehalf(address delegate) external;

    function removeBurnOnBehalf(address delegate) external;

    function approveIssueOnBehalf(address delegate) external;

    function removeIssueOnBehalf(address delegate) external;

    function approveClaimOnBehalf(address delegate) external;

    function removeClaimOnBehalf(address delegate) external;

    function approveExchangeOnBehalf(address delegate) external;

    function removeExchangeOnBehalf(address delegate) external;
}


interface ITradingRewards {
    /* ========== VIEWS ========== */

    function getAvailableRewards() external view returns (uint);

    function getUnassignedRewards() external view returns (uint);

    function getRewardsToken() external view returns (address);

    function getPeriodController() external view returns (address);

    function getCurrentPeriod() external view returns (uint);

    function getPeriodIsClaimable(uint periodID) external view returns (bool);

    function getPeriodIsFinalized(uint periodID) external view returns (bool);

    function getPeriodRecordedFees(uint periodID) external view returns (uint);

    function getPeriodTotalRewards(uint periodID) external view returns (uint);

    function getPeriodAvailableRewards(uint periodID) external view returns (uint);

    function getUnaccountedFeesForAccountForPeriod(address account, uint periodID) external view returns (uint);

    function getAvailableRewardsForAccountForPeriod(address account, uint periodID) external view returns (uint);

    function getAvailableRewardsForAccountForPeriods(address account, uint[] calldata periodIDs)
        external
        view
        returns (uint totalRewards);

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

    function claimRewardsForPeriod(uint periodID) external;

    function claimRewardsForPeriods(uint[] calldata periodIDs) external;

    /* ========== RESTRICTED FUNCTIONS ========== */

    function recordExchangeFeeForAccount(uint usdFeeAmount, address account) external;

    function closeCurrentPeriodWithRewards(uint rewards) external;

    function recoverEther(address payable recoverAddress) external;

    function recoverTokens(address tokenAddress, address recoverAddress) external;

    function recoverUnassignedRewardTokens(address recoverAddress) external;

    function recoverAssignedRewardTokensAndDestroyPeriod(address recoverAddress, uint periodID) external;

    function setPeriodController(address newPeriodController) external;
}


// Inheritance


// Libraries


// Internal references


// Used to have strongly-typed access to internal mutative functions in Synthetix
interface ISynthetixInternal {
    function emitExchangeTracking(
        bytes32 trackingCode,
        bytes32 toCurrencyKey,
        uint256 toAmount
    ) external;

    function emitSynthExchange(
        address account,
        bytes32 fromCurrencyKey,
        uint fromAmount,
        bytes32 toCurrencyKey,
        uint toAmount,
        address toAddress
    ) external;

    function emitExchangeReclaim(
        address account,
        bytes32 currencyKey,
        uint amount
    ) external;

    function emitExchangeRebate(
        address account,
        bytes32 currencyKey,
        uint amount
    ) external;
}


// https://docs.synthetix.io/contracts/Exchanger
contract Exchanger is Owned, MixinResolver, MixinSystemSettings, IExchanger {
    using SafeMath for uint;
    using SafeDecimalMath for uint;

    struct ExchangeEntrySettlement {
        bytes32 src;
        uint amount;
        bytes32 dest;
        uint reclaim;
        uint rebate;
        uint srcRoundIdAtPeriodEnd;
        uint destRoundIdAtPeriodEnd;
        uint timestamp;
    }

    bytes32 private constant sUSD = "sUSD";

    // SIP-65: Decentralized circuit breaker
    uint public constant CIRCUIT_BREAKER_SUSPENSION_REASON = 65;

    mapping(bytes32 => uint) public lastExchangeRate;

    /* ========== ADDRESS RESOLVER CONFIGURATION ========== */

    bytes32 private constant CONTRACT_SYSTEMSTATUS = "SystemStatus";
    bytes32 private constant CONTRACT_EXCHANGESTATE = "ExchangeState";
    bytes32 private constant CONTRACT_EXRATES = "ExchangeRates";
    bytes32 private constant CONTRACT_SYNTHETIX = "Synthetix";
    bytes32 private constant CONTRACT_FEEPOOL = "FeePool";
    bytes32 private constant CONTRACT_TRADING_REWARDS = "TradingRewards";
    bytes32 private constant CONTRACT_DELEGATEAPPROVALS = "DelegateApprovals";
    bytes32 private constant CONTRACT_ISSUER = "Issuer";

    bytes32[24] private addressesToCache = [
        CONTRACT_SYSTEMSTATUS,
        CONTRACT_EXCHANGESTATE,
        CONTRACT_EXRATES,
        CONTRACT_SYNTHETIX,
        CONTRACT_FEEPOOL,
        CONTRACT_TRADING_REWARDS,
        CONTRACT_DELEGATEAPPROVALS,
        CONTRACT_ISSUER
    ];

    constructor(address _owner, address _resolver)
        public
        Owned(_owner)
        MixinResolver(_resolver, addressesToCache)
        MixinSystemSettings()
    {}

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

    function systemStatus() internal view returns (ISystemStatus) {
        return ISystemStatus(requireAndGetAddress(CONTRACT_SYSTEMSTATUS, "Missing SystemStatus address"));
    }

    function exchangeState() internal view returns (IExchangeState) {
        return IExchangeState(requireAndGetAddress(CONTRACT_EXCHANGESTATE, "Missing ExchangeState address"));
    }

    function exchangeRates() internal view returns (IExchangeRates) {
        return IExchangeRates(requireAndGetAddress(CONTRACT_EXRATES, "Missing ExchangeRates address"));
    }

    function synthetix() internal view returns (ISynthetix) {
        return ISynthetix(requireAndGetAddress(CONTRACT_SYNTHETIX, "Missing Synthetix address"));
    }

    function feePool() internal view returns (IFeePool) {
        return IFeePool(requireAndGetAddress(CONTRACT_FEEPOOL, "Missing FeePool address"));
    }

    function tradingRewards() internal view returns (ITradingRewards) {
        return ITradingRewards(requireAndGetAddress(CONTRACT_TRADING_REWARDS, "Missing TradingRewards address"));
    }

    function delegateApprovals() internal view returns (IDelegateApprovals) {
        return IDelegateApprovals(requireAndGetAddress(CONTRACT_DELEGATEAPPROVALS, "Missing DelegateApprovals address"));
    }

    function issuer() internal view returns (IIssuer) {
        return IIssuer(requireAndGetAddress(CONTRACT_ISSUER, "Missing Issuer address"));
    }

    function maxSecsLeftInWaitingPeriod(address account, bytes32 currencyKey) public view returns (uint) {
        return secsLeftInWaitingPeriodForExchange(exchangeState().getMaxTimestamp(account, currencyKey));
    }

    function waitingPeriodSecs() external view returns (uint) {
        return getWaitingPeriodSecs();
    }

    function tradingRewardsEnabled() external view returns (bool) {
        return getTradingRewardsEnabled();
    }

    function priceDeviationThresholdFactor() external view returns (uint) {
        return getPriceDeviationThresholdFactor();
    }

    function settlementOwing(address account, bytes32 currencyKey)
        public
        view
        returns (
            uint reclaimAmount,
            uint rebateAmount,
            uint numEntries
        )
    {
        (reclaimAmount, rebateAmount, numEntries, ) = _settlementOwing(account, currencyKey);
    }

    // Internal function to emit events for each individual rebate and reclaim entry
    function _settlementOwing(address account, bytes32 currencyKey)
        internal
        view
        returns (
            uint reclaimAmount,
            uint rebateAmount,
            uint numEntries,
            ExchangeEntrySettlement[] memory
        )
    {
        // Need to sum up all reclaim and rebate amounts for the user and the currency key
        numEntries = exchangeState().getLengthOfEntries(account, currencyKey);

        // For each unsettled exchange
        ExchangeEntrySettlement[] memory settlements = new ExchangeEntrySettlement[](numEntries);
        for (uint i = 0; i < numEntries; i++) {
            uint reclaim;
            uint rebate;
            // fetch the entry from storage
            IExchangeState.ExchangeEntry memory exchangeEntry = _getExchangeEntry(account, currencyKey, i);

            // determine the last round ids for src and dest pairs when period ended or latest if not over
            (uint srcRoundIdAtPeriodEnd, uint destRoundIdAtPeriodEnd) = getRoundIdsAtPeriodEnd(exchangeEntry);

            // given these round ids, determine what effective value they should have received
            uint destinationAmount = exchangeRates().effectiveValueAtRound(
                exchangeEntry.src,
                exchangeEntry.amount,
                exchangeEntry.dest,
                srcRoundIdAtPeriodEnd,
                destRoundIdAtPeriodEnd
            );

            // and deduct the fee from this amount using the exchangeFeeRate from storage
            uint amountShouldHaveReceived = _getAmountReceivedForExchange(destinationAmount, exchangeEntry.exchangeFeeRate);

            // SIP-65 settlements where the amount at end of waiting period is beyond the threshold, then
            // settle with no reclaim or rebate
            if (!_isDeviationAboveThreshold(exchangeEntry.amountReceived, amountShouldHaveReceived)) {
                if (exchangeEntry.amountReceived > amountShouldHaveReceived) {
                    // if they received more than they should have, add to the reclaim tally
                    reclaim = exchangeEntry.amountReceived.sub(amountShouldHaveReceived);
                    reclaimAmount = reclaimAmount.add(reclaim);
                } else if (amountShouldHaveReceived > exchangeEntry.amountReceived) {
                    // if less, add to the rebate tally
                    rebate = amountShouldHaveReceived.sub(exchangeEntry.amountReceived);
                    rebateAmount = rebateAmount.add(rebate);
                }
            }

            settlements[i] = ExchangeEntrySettlement({
                src: exchangeEntry.src,
                amount: exchangeEntry.amount,
                dest: exchangeEntry.dest,
                reclaim: reclaim,
                rebate: rebate,
                srcRoundIdAtPeriodEnd: srcRoundIdAtPeriodEnd,
                destRoundIdAtPeriodEnd: destRoundIdAtPeriodEnd,
                timestamp: exchangeEntry.timestamp
            });
        }

        return (reclaimAmount, rebateAmount, numEntries, settlements);
    }

    function _getExchangeEntry(
        address account,
        bytes32 currencyKey,
        uint index
    ) internal view returns (IExchangeState.ExchangeEntry memory) {
        (
            bytes32 src,
            uint amount,
            bytes32 dest,
            uint amountReceived,
            uint exchangeFeeRate,
            uint timestamp,
            uint roundIdForSrc,
            uint roundIdForDest
        ) = exchangeState().getEntryAt(account, currencyKey, index);

        return
            IExchangeState.ExchangeEntry({
                src: src,
                amount: amount,
                dest: dest,
                amountReceived: amountReceived,
                exchangeFeeRate: exchangeFeeRate,
                timestamp: timestamp,
                roundIdForSrc: roundIdForSrc,
                roundIdForDest: roundIdForDest
            });
    }

    function hasWaitingPeriodOrSettlementOwing(address account, bytes32 currencyKey) external view returns (bool) {
        if (maxSecsLeftInWaitingPeriod(account, currencyKey) != 0) {
            return true;
        }

        (uint reclaimAmount, , , ) = _settlementOwing(account, currencyKey);

        return reclaimAmount > 0;
    }

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

    function calculateAmountAfterSettlement(
        address from,
        bytes32 currencyKey,
        uint amount,
        uint refunded
    ) public view returns (uint amountAfterSettlement) {
        amountAfterSettlement = amount;

        // balance of a synth will show an amount after settlement
        uint balanceOfSourceAfterSettlement = IERC20(address(issuer().synths(currencyKey))).balanceOf(from);

        // when there isn't enough supply (either due to reclamation settlement or because the number is too high)
        if (amountAfterSettlement > balanceOfSourceAfterSettlement) {
            // then the amount to exchange is reduced to their remaining supply
            amountAfterSettlement = balanceOfSourceAfterSettlement;
        }

        if (refunded > 0) {
            amountAfterSettlement = amountAfterSettlement.add(refunded);
        }
    }

    function isSynthRateInvalid(bytes32 currencyKey) external view returns (bool) {
        return _isSynthRateInvalid(currencyKey, exchangeRates().rateForCurrency(currencyKey));
    }

    /* ========== MUTATIVE FUNCTIONS ========== */
    function exchange(
        address from,
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey,
        address destinationAddress
    ) external onlySynthetixorSynth returns (uint amountReceived) {
        uint fee;
        (amountReceived, fee) = _exchange(from, sourceCurrencyKey, sourceAmount, destinationCurrencyKey, destinationAddress);

        _processTradingRewards(fee, destinationAddress);
    }

    function exchangeOnBehalf(
        address exchangeForAddress,
        address from,
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey
    ) external onlySynthetixorSynth returns (uint amountReceived) {
        require(delegateApprovals().canExchangeFor(exchangeForAddress, from), "Not approved to act on behalf");

        uint fee;
        (amountReceived, fee) = _exchange(
            exchangeForAddress,
            sourceCurrencyKey,
            sourceAmount,
            destinationCurrencyKey,
            exchangeForAddress
        );

        _processTradingRewards(fee, exchangeForAddress);
    }

    function exchangeWithTracking(
        address from,
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey,
        address destinationAddress,
        address originator,
        bytes32 trackingCode
    ) external onlySynthetixorSynth returns (uint amountReceived) {
        uint fee;
        (amountReceived, fee) = _exchange(from, sourceCurrencyKey, sourceAmount, destinationCurrencyKey, destinationAddress);

        _processTradingRewards(fee, originator);

        _emitTrackingEvent(trackingCode, destinationCurrencyKey, amountReceived);
    }

    function exchangeOnBehalfWithTracking(
        address exchangeForAddress,
        address from,
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey,
        address originator,
        bytes32 trackingCode
    ) external onlySynthetixorSynth returns (uint amountReceived) {
        require(delegateApprovals().canExchangeFor(exchangeForAddress, from), "Not approved to act on behalf");

        uint fee;
        (amountReceived, fee) = _exchange(
            exchangeForAddress,
            sourceCurrencyKey,
            sourceAmount,
            destinationCurrencyKey,
            exchangeForAddress
        );

        _processTradingRewards(fee, originator);

        _emitTrackingEvent(trackingCode, destinationCurrencyKey, amountReceived);
    }

    function _emitTrackingEvent(
        bytes32 trackingCode,
        bytes32 toCurrencyKey,
        uint256 toAmount
    ) internal {
        ISynthetixInternal(address(synthetix())).emitExchangeTracking(trackingCode, toCurrencyKey, toAmount);
    }

    function _processTradingRewards(uint fee, address originator) internal {
        if (fee > 0 && originator != address(0) && getTradingRewardsEnabled()) {
            tradingRewards().recordExchangeFeeForAccount(fee, originator);
        }
    }

    function _exchange(
        address from,
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey,
        address destinationAddress
    ) internal returns (uint amountReceived, uint fee) {
        _ensureCanExchange(sourceCurrencyKey, sourceAmount, destinationCurrencyKey);

        (, uint refunded, uint numEntriesSettled) = _internalSettle(from, sourceCurrencyKey);

        uint sourceAmountAfterSettlement = sourceAmount;

        // when settlement was required
        if (numEntriesSettled > 0) {
            // ensure the sourceAmount takes this into account
            sourceAmountAfterSettlement = calculateAmountAfterSettlement(from, sourceCurrencyKey, sourceAmount, refunded);

            // If, after settlement the user has no balance left (highly unlikely), then return to prevent
            // emitting events of 0 and don't revert so as to ensure the settlement queue is emptied
            if (sourceAmountAfterSettlement == 0) {
                return (0, 0);
            }
        }

        uint exchangeFeeRate;
        uint sourceRate;
        uint destinationRate;

        // Note: `fee` is denominated in the destinationCurrencyKey.
        (amountReceived, fee, exchangeFeeRate, sourceRate, destinationRate) = _getAmountsForExchangeMinusFees(
            sourceAmountAfterSettlement,
            sourceCurrencyKey,
            destinationCurrencyKey
        );

        // SIP-65: Decentralized Circuit Breaker
        if (_isSynthRateInvalid(sourceCurrencyKey, sourceRate)) {
            systemStatus().suspendSynth(sourceCurrencyKey, CIRCUIT_BREAKER_SUSPENSION_REASON);
            return (0, 0);
        } else {
            lastExchangeRate[sourceCurrencyKey] = sourceRate;
        }

        if (_isSynthRateInvalid(destinationCurrencyKey, destinationRate)) {
            systemStatus().suspendSynth(destinationCurrencyKey, CIRCUIT_BREAKER_SUSPENSION_REASON);
            return (0, 0);
        } else {
            lastExchangeRate[destinationCurrencyKey] = destinationRate;
        }

        // Note: We don't need to check their balance as the burn() below will do a safe subtraction which requires
        // the subtraction to not overflow, which would happen if their balance is not sufficient.

        // Burn the source amount
        issuer().synths(sourceCurrencyKey).burn(from, sourceAmountAfterSettlement);

        // Issue their new synths
        issuer().synths(destinationCurrencyKey).issue(destinationAddress, amountReceived);

        // Remit the fee if required
        if (fee > 0) {
            // Normalize fee to sUSD
            // Note: `fee` is being reused to avoid stack too deep errors.
            fee = exchangeRates().effectiveValue(destinationCurrencyKey, fee, sUSD);

            // Remit the fee in sUSDs
            issuer().synths(sUSD).issue(feePool().FEE_ADDRESS(), fee);

            // Tell the fee pool about this
            feePool().recordFeePaid(fee);
        }

        // Note: As of this point, `fee` is denominated in sUSD.

        // Nothing changes as far as issuance data goes because the total value in the system hasn't changed.

        // Let the DApps know there was a Synth exchange
        ISynthetixInternal(address(synthetix())).emitSynthExchange(
            from,
            sourceCurrencyKey,
            sourceAmountAfterSettlement,
            destinationCurrencyKey,
            amountReceived,
            destinationAddress
        );

        // persist the exchange information for the dest key
        appendExchange(
            destinationAddress,
            sourceCurrencyKey,
            sourceAmountAfterSettlement,
            destinationCurrencyKey,
            amountReceived,
            exchangeFeeRate
        );
    }

    // Note: this function can intentionally be called by anyone on behalf of anyone else (the caller just pays the gas)
    function settle(address from, bytes32 currencyKey)
        external
        returns (
            uint reclaimed,
            uint refunded,
            uint numEntriesSettled
        )
    {
        systemStatus().requireSynthActive(currencyKey);
        return _internalSettle(from, currencyKey);
    }

    function suspendSynthWithInvalidRate(bytes32 currencyKey) external {
        systemStatus().requireSystemActive();
        require(issuer().synths(currencyKey) != ISynth(0), "No such synth");
        require(_isSynthRateInvalid(currencyKey, exchangeRates().rateForCurrency(currencyKey)), "Synth price is valid");
        systemStatus().suspendSynth(currencyKey, CIRCUIT_BREAKER_SUSPENSION_REASON);
    }

    // SIP-78
    function setLastExchangeRateForSynth(bytes32 currencyKey, uint rate) external onlyExchangeRates {
        require(rate > 0, "Rate must be above 0");
        lastExchangeRate[currencyKey] = rate;
    }

    /* ========== INTERNAL FUNCTIONS ========== */
    function _ensureCanExchange(
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey
    ) internal view {
        require(sourceCurrencyKey != destinationCurrencyKey, "Can't be same synth");
        require(sourceAmount > 0, "Zero amount");

        bytes32[] memory synthKeys = new bytes32[](2);
        synthKeys[0] = sourceCurrencyKey;
        synthKeys[1] = destinationCurrencyKey;
        require(!exchangeRates().anyRateIsInvalid(synthKeys), "Src/dest rate invalid or not found");
    }

    function _isSynthRateInvalid(bytes32 currencyKey, uint currentRate) internal view returns (bool) {
        if (currentRate == 0) {
            return true;
        }

        uint lastRateFromExchange = lastExchangeRate[currencyKey];

        if (lastRateFromExchange > 0) {
            return _isDeviationAboveThreshold(lastRateFromExchange, currentRate);
        }

        // if no last exchange for this synth, then we need to look up last 3 rates (+1 for current rate)
        (uint[] memory rates, ) = exchangeRates().ratesAndUpdatedTimeForCurrencyLastNRounds(currencyKey, 4);

        // start at index 1 to ignore current rate
        for (uint i = 1; i < rates.length; i++) {
            // ignore any empty rates in the past (otherwise we will never be able to get validity)
            if (rates[i] > 0 && _isDeviationAboveThreshold(rates[i], currentRate)) {
                return true;
            }
        }

        return false;
    }

    function _isDeviationAboveThreshold(uint base, uint comparison) internal view returns (bool) {
        if (base == 0 || comparison == 0) {
            return true;
        }

        uint factor;
        if (comparison > base) {
            factor = comparison.divideDecimal(base);
        } else {
            factor = base.divideDecimal(comparison);
        }

        return factor >= getPriceDeviationThresholdFactor();
    }

    function _internalSettle(address from, bytes32 currencyKey)
        internal
        returns (
            uint reclaimed,
            uint refunded,
            uint numEntriesSettled
        )
    {
        require(maxSecsLeftInWaitingPeriod(from, currencyKey) == 0, "Cannot settle during waiting period");

        (
            uint reclaimAmount,
            uint rebateAmount,
            uint entries,
            ExchangeEntrySettlement[] memory settlements
        ) = _settlementOwing(from, currencyKey);

        if (reclaimAmount > rebateAmount) {
            reclaimed = reclaimAmount.sub(rebateAmount);
            reclaim(from, currencyKey, reclaimed);
        } else if (rebateAmount > reclaimAmount) {
            refunded = rebateAmount.sub(reclaimAmount);
            refund(from, currencyKey, refunded);
        }

        // emit settlement event for each settled exchange entry
        for (uint i = 0; i < settlements.length; i++) {
            emit ExchangeEntrySettled(
                from,
                settlements[i].src,
                settlements[i].amount,
                settlements[i].dest,
                settlements[i].reclaim,
                settlements[i].rebate,
                settlements[i].srcRoundIdAtPeriodEnd,
                settlements[i].destRoundIdAtPeriodEnd,
                settlements[i].timestamp
            );
        }

        numEntriesSettled = entries;

        // Now remove all entries, even if no reclaim and no rebate
        exchangeState().removeEntries(from, currencyKey);
    }

    function reclaim(
        address from,
        bytes32 currencyKey,
        uint amount
    ) internal {
        // burn amount from user
        issuer().synths(currencyKey).burn(from, amount);
        ISynthetixInternal(address(synthetix())).emitExchangeReclaim(from, currencyKey, amount);
    }

    function refund(
        address from,
        bytes32 currencyKey,
        uint amount
    ) internal {
        // issue amount to user
        issuer().synths(currencyKey).issue(from, amount);
        ISynthetixInternal(address(synthetix())).emitExchangeRebate(from, currencyKey, amount);
    }

    function secsLeftInWaitingPeriodForExchange(uint timestamp) internal view returns (uint) {
        uint _waitingPeriodSecs = getWaitingPeriodSecs();
        if (timestamp == 0 || now >= timestamp.add(_waitingPeriodSecs)) {
            return 0;
        }

        return timestamp.add(_waitingPeriodSecs).sub(now);
    }

    function feeRateForExchange(bytes32 sourceCurrencyKey, bytes32 destinationCurrencyKey)
        external
        view
        returns (uint exchangeFeeRate)
    {
        exchangeFeeRate = _feeRateForExchange(sourceCurrencyKey, destinationCurrencyKey);
    }

    function _feeRateForExchange(
        bytes32, // API for source in case pricing model evolves to include source rate /* sourceCurrencyKey */
        bytes32 destinationCurrencyKey
    ) internal view returns (uint exchangeFeeRate) {
        return getExchangeFeeRate(destinationCurrencyKey);
    }

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

    function _getAmountsForExchangeMinusFees(
        uint sourceAmount,
        bytes32 sourceCurrencyKey,
        bytes32 destinationCurrencyKey
    )
        internal
        view
        returns (
            uint amountReceived,
            uint fee,
            uint exchangeFeeRate,
            uint sourceRate,
            uint destinationRate
        )
    {
        uint destinationAmount;
        (destinationAmount, sourceRate, destinationRate) = exchangeRates().effectiveValueAndRates(
            sourceCurrencyKey,
            sourceAmount,
            destinationCurrencyKey
        );
        exchangeFeeRate = _feeRateForExchange(sourceCurrencyKey, destinationCurrencyKey);
        amountReceived = _getAmountReceivedForExchange(destinationAmount, exchangeFeeRate);
        fee = destinationAmount.sub(amountReceived);
    }

    function _getAmountReceivedForExchange(uint destinationAmount, uint exchangeFeeRate)
        internal
        pure
        returns (uint amountReceived)
    {
        amountReceived = destinationAmount.multiplyDecimal(SafeDecimalMath.unit().sub(exchangeFeeRate));
    }

    function appendExchange(
        address account,
        bytes32 src,
        uint amount,
        bytes32 dest,
        uint amountReceived,
        uint exchangeFeeRate
    ) internal {
        IExchangeRates exRates = exchangeRates();
        uint roundIdForSrc = exRates.getCurrentRoundId(src);
        uint roundIdForDest = exRates.getCurrentRoundId(dest);
        exchangeState().appendExchangeEntry(
            account,
            src,
            amount,
            dest,
            amountReceived,
            exchangeFeeRate,
            now,
            roundIdForSrc,
            roundIdForDest
        );

        emit ExchangeEntryAppended(
            account,
            src,
            amount,
            dest,
            amountReceived,
            exchangeFeeRate,
            roundIdForSrc,
            roundIdForDest
        );
    }

    function getRoundIdsAtPeriodEnd(IExchangeState.ExchangeEntry memory exchangeEntry)
        internal
        view
        returns (uint srcRoundIdAtPeriodEnd, uint destRoundIdAtPeriodEnd)
    {
        IExchangeRates exRates = exchangeRates();
        uint _waitingPeriodSecs = getWaitingPeriodSecs();

        srcRoundIdAtPeriodEnd = exRates.getLastRoundIdBeforeElapsedSecs(
            exchangeEntry.src,
            exchangeEntry.roundIdForSrc,
            exchangeEntry.timestamp,
            _waitingPeriodSecs
        );
        destRoundIdAtPeriodEnd = exRates.getLastRoundIdBeforeElapsedSecs(
            exchangeEntry.dest,
            exchangeEntry.roundIdForDest,
            exchangeEntry.timestamp,
            _waitingPeriodSecs
        );
    }

    // ========== MODIFIERS ==========

    modifier onlySynthetixorSynth() {
        ISynthetix _synthetix = synthetix();
        require(
            msg.sender == address(_synthetix) || _synthetix.synthsByAddress(msg.sender) != bytes32(0),
            "Exchanger: Only synthetix or a synth contract can perform this action"
        );
        _;
    }

    modifier onlyExchangeRates() {
        IExchangeRates _exchangeRates = exchangeRates();
        require(msg.sender == address(_exchangeRates), "Restricted to ExchangeRates");
        _;
    }

    // ========== EVENTS ==========
    event ExchangeEntryAppended(
        address indexed account,
        bytes32 src,
        uint256 amount,
        bytes32 dest,
        uint256 amountReceived,
        uint256 exchangeFeeRate,
        uint256 roundIdForSrc,
        uint256 roundIdForDest
    );

    event ExchangeEntrySettled(
        address indexed from,
        bytes32 src,
        uint256 amount,
        bytes32 dest,
        uint256 reclaim,
        uint256 rebate,
        uint256 srcRoundIdAtPeriodEnd,
        uint256 destRoundIdAtPeriodEnd,
        uint256 exchangeTimestamp
    );
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_resolver","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"bytes32","name":"src","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"dest","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"amountReceived","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"exchangeFeeRate","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"roundIdForSrc","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"roundIdForDest","type":"uint256"}],"name":"ExchangeEntryAppended","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"bytes32","name":"src","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"dest","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"reclaim","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rebate","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"srcRoundIdAtPeriodEnd","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"destRoundIdAtPeriodEnd","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"exchangeTimestamp","type":"uint256"}],"name":"ExchangeEntrySettled","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"},{"constant":true,"inputs":[],"name":"CIRCUIT_BREAKER_SUSPENSION_REASON","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"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":true,"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"bytes32","name":"currencyKey","type":"bytes32"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"refunded","type":"uint256"}],"name":"calculateAmountAfterSettlement","outputs":[{"internalType":"uint256","name":"amountAfterSettlement","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"bytes32","name":"sourceCurrencyKey","type":"bytes32"},{"internalType":"uint256","name":"sourceAmount","type":"uint256"},{"internalType":"bytes32","name":"destinationCurrencyKey","type":"bytes32"},{"internalType":"address","name":"destinationAddress","type":"address"}],"name":"exchange","outputs":[{"internalType":"uint256","name":"amountReceived","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"exchangeForAddress","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"bytes32","name":"sourceCurrencyKey","type":"bytes32"},{"internalType":"uint256","name":"sourceAmount","type":"uint256"},{"internalType":"bytes32","name":"destinationCurrencyKey","type":"bytes32"}],"name":"exchangeOnBehalf","outputs":[{"internalType":"uint256","name":"amountReceived","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"exchangeForAddress","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"bytes32","name":"sourceCurrencyKey","type":"bytes32"},{"internalType":"uint256","name":"sourceAmount","type":"uint256"},{"internalType":"bytes32","name":"destinationCurrencyKey","type":"bytes32"},{"internalType":"address","name":"originator","type":"address"},{"internalType":"bytes32","name":"trackingCode","type":"bytes32"}],"name":"exchangeOnBehalfWithTracking","outputs":[{"internalType":"uint256","name":"amountReceived","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"bytes32","name":"sourceCurrencyKey","type":"bytes32"},{"internalType":"uint256","name":"sourceAmount","type":"uint256"},{"internalType":"bytes32","name":"destinationCurrencyKey","type":"bytes32"},{"internalType":"address","name":"destinationAddress","type":"address"},{"internalType":"address","name":"originator","type":"address"},{"internalType":"bytes32","name":"trackingCode","type":"bytes32"}],"name":"exchangeWithTracking","outputs":[{"internalType":"uint256","name":"amountReceived","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"sourceCurrencyKey","type":"bytes32"},{"internalType":"bytes32","name":"destinationCurrencyKey","type":"bytes32"}],"name":"feeRateForExchange","outputs":[{"internalType":"uint256","name":"exchangeFeeRate","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"sourceAmount","type":"uint256"},{"internalType":"bytes32","name":"sourceCurrencyKey","type":"bytes32"},{"internalType":"bytes32","name":"destinationCurrencyKey","type":"bytes32"}],"name":"getAmountsForExchange","outputs":[{"internalType":"uint256","name":"amountReceived","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"exchangeFeeRate","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":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"currencyKey","type":"bytes32"}],"name":"hasWaitingPeriodOrSettlementOwing","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":"isSynthRateInvalid","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"lastExchangeRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"currencyKey","type":"bytes32"}],"name":"maxSecsLeftInWaitingPeriod","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":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"priceDeviationThresholdFactor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","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":false,"inputs":[{"internalType":"bytes32","name":"currencyKey","type":"bytes32"},{"internalType":"uint256","name":"rate","type":"uint256"}],"name":"setLastExchangeRateForSynth","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":"address","name":"from","type":"address"},{"internalType":"bytes32","name":"currencyKey","type":"bytes32"}],"name":"settle","outputs":[{"internalType":"uint256","name":"reclaimed","type":"uint256"},{"internalType":"uint256","name":"refunded","type":"uint256"},{"internalType":"uint256","name":"numEntriesSettled","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"currencyKey","type":"bytes32"}],"name":"settlementOwing","outputs":[{"internalType":"uint256","name":"reclaimAmount","type":"uint256"},{"internalType":"uint256","name":"rebateAmount","type":"uint256"},{"internalType":"uint256","name":"numEntries","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"currencyKey","type":"bytes32"}],"name":"suspendSynthWithInvalidRate","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"tradingRewardsEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"waitingPeriodSecs","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"}]

6101806040526b53797374656d53746174757360a01b60809081526c45786368616e6765537461746560981b60a0526c45786368616e6765526174657360981b60c052680a6f2dce8d0cae8d2f60bb1b60e05266119959541bdbdb60ca1b610100526d54726164696e675265776172647360901b610120527044656c6567617465417070726f76616c7360781b610140526524b9b9bab2b960d11b61016052620000ae90600690600862000407565b50348015620000bc57600080fd5b5060405162003f2c38038062003f2c83398181016040526040811015620000e257600080fd5b50805160209091015160408051610300810191829052829160069060189082845b8154815260200190600101908083116200010357508793505050506001600160a01b0381166200017a576040805162461bcd60e51b815260206004820152601960248201527f4f776e657220616464726573732063616e6e6f74206265203000000000000000604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b038316908117825560408051928352602083019190915280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a1506000546001600160a01b031662000225576040805162461bcd60e51b815260206004820152601160248201527013dddb995c881b5d5cdd081899481cd95d607a1b604482015290519081900360640190fd5b60005b60188110156200028d5760008282601881106200024157fe5b6020020151146200027e5760048282601881106200025b57fe5b602090810291909101518254600181018455600093845291909220015562000284565b6200028d565b60010162000228565b5050600280546001600160a01b0319166001600160a01b0392909216919091179055620002cc6e466c657869626c6553746f7261676560881b620002d4565b50506200046a565b6004805460018101825560008290527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b01829055546018116200035e576040805162461bcd60e51b815260206004820152601b60248201527f4d6178207265736f6c7665722063616368652073697a65206d65740000000000604482015290519081900360640190fd5b600254604080516321f8a72160e01b81526004810184905290516001600160a01b03909216916321f8a72191602480820192602092909190829003018186803b158015620003ab57600080fd5b505afa158015620003c0573d6000803e3d6000fd5b505050506040513d6020811015620003d757600080fd5b505160009182526003602052604090912080546001600160a01b0319166001600160a01b03909216919091179055565b826018810192821562000438579160200282015b82811115620004385782518255916020019190600101906200041b565b50620004469291506200044a565b5090565b6200046791905b8082111562000446576000815560010162000451565b90565b613ab2806200047a6000396000f3fe608060405234801561001057600080fd5b50600436106101cf5760003560e01c8063631e144411610104578063ab49848c116100a2578063d6f32e0611610071578063d6f32e0614610573578063dfffca761461059f578063e3235c91146105ef578063f450aa34146105f7576101cf565b8063ab49848c146104ea578063c193f0d81461052b578063c6c9d82814610533578063ce09694014610550576101cf565b80637dd1a57a116100de5780637dd1a57a1461046d57806386baa45c1461048a57806389257117146104da5780638da5cb5b146104e2576101cf565b8063631e1444146103fd5780636a1c47581461042357806379ba509714610465576101cf565b80631b16802c116101715780633fa70f451161014b5780633fa70f45146103845780634c268fc81461038c57806353a47bb7146103c457806357af302c146103cc576101cf565b80631b16802c1461032a578063372a395a146103565780633be99e6f1461035e576101cf565b80630b9e31c9116101ad5780630b9e31c9146102785780631627540c1461029757806319d5c665146102bd5780631a5c609514610307576101cf565b806304f3bcec146101d4578063059c29ec146101f85780630a1e187d14610236575b600080fd5b6101dc610620565b604080516001600160a01b039092168252519081900360200190f35b6102246004803603604081101561020e57600080fd5b506001600160a01b03813516906020013561062f565b60408051918252519081900360200190f35b610224600480360360a081101561024c57600080fd5b506001600160a01b038135811691602081013591604082013591606081013591608090910135166106d3565b6102956004803603602081101561028e57600080fd5b50356107cf565b005b610295600480360360208110156102ad57600080fd5b50356001600160a01b0316610a2e565b6102e9600480360360408110156102d357600080fd5b506001600160a01b038135169060200135610acb565b60408051938452602084019290925282820152519081900360600190f35b6102246004803603604081101561031d57600080fd5b5080359060200135610ae9565b6102e96004803603604081101561034057600080fd5b506001600160a01b038135169060200135610af5565b610224610b74565b6102956004803603602081101561037457600080fd5b50356001600160a01b0316610b83565b610224610cf1565b610224600480360360808110156103a257600080fd5b506001600160a01b038135169060208101359060408101359060600135610cf6565b6101dc610e16565b6103e9600480360360208110156103e257600080fd5b5035610e25565b604080519115158252519081900360200190f35b6103e96004803603602081101561041357600080fd5b50356001600160a01b0316610e7e565b610224600480360360a081101561043957600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060800135610f99565b610295611162565b6102246004803603602081101561048357600080fd5b503561121e565b610224600480360360e08110156104a057600080fd5b506001600160a01b038135811691602081013591604082013591606081013591608082013581169160a08101359091169060c00135611230565b610224611339565b6101dc611343565b6104f2611352565b604051808261030080838360005b83811015610518578181015183820152602001610500565b5050505090500191505060405180910390f35b6103e961139c565b6102246004803603602081101561054957600080fd5b50356113a6565b6102956004803603604081101561056657600080fd5b50803590602001356113c4565b6103e96004803603604081101561058957600080fd5b506001600160a01b03813516906020013561148c565b610224600480360360e08110156105b557600080fd5b506001600160a01b038135811691602081013582169160408201359160608101359160808201359160a08101359091169060c001356114be565b610224611692565b6102e96004803603606081101561060d57600080fd5b5080359060208101359060400135611697565b6002546001600160a01b031681565b60006106ca61063c6116b7565b6001600160a01b031663f1406dc885856040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b031681526020018281526020019250505060206040518083038186803b15801561069957600080fd5b505afa1580156106ad573d6000803e3d6000fd5b505050506040513d60208110156106c357600080fd5b5051611708565b90505b92915050565b6000806106de611767565b9050336001600160a01b038216148061076b5750604080516316b2213f60e01b815233600482015290516000916001600160a01b038416916316b2213f91602480820192602092909190829003018186803b15801561073c57600080fd5b505afa158015610750573d6000803e3d6000fd5b505050506040513d602081101561076657600080fd5b505114155b6107a65760405162461bcd60e51b81526004018080602001828103825260458152602001806139a46045913960600191505060405180910390fd5b60006107b588888888886117b4565b90935090506107c48185611e3d565b505095945050505050565b6107d7611eec565b6001600160a01b031663086dabd16040518163ffffffff1660e01b815260040160006040518083038186803b15801561080f57600080fd5b505afa158015610823573d6000803e3d6000fd5b5050505060006001600160a01b031661083a611f3c565b6001600160a01b03166332608039836040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561087d57600080fd5b505afa158015610891573d6000803e3d6000fd5b505050506040513d60208110156108a757600080fd5b50516001600160a01b031614156108f5576040805162461bcd60e51b815260206004820152600d60248201526c09cde40e6eac6d040e6f2dce8d609b1b604482015290519081900360640190fd5b61097581610901611f7f565b6001600160a01b031663ac82f608846040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561094457600080fd5b505afa158015610958573d6000803e3d6000fd5b505050506040513d602081101561096e57600080fd5b5051611fd0565b6109bd576040805162461bcd60e51b815260206004820152601460248201527314de5b9d1a081c1c9a58d9481a5cc81d985b1a5960621b604482015290519081900360640190fd5b6109c5611eec565b6001600160a01b031663abc0bb6e8260416040518363ffffffff1660e01b81526004018083815260200182815260200192505050600060405180830381600087803b158015610a1357600080fd5b505af1158015610a27573d6000803e3d6000fd5b5050505050565b6000546001600160a01b03163314610a775760405162461bcd60e51b815260040180806020018281038252602f8152602001806139e9602f913960400191505060405180910390fd5b600180546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce229181900360200190a150565b6000806000610ada8585612220565b50919790965090945092505050565b60006106ca83836124ee565b6000806000610b02611eec565b6001600160a01b03166342a28e21856040518263ffffffff1660e01b81526004018082815260200191505060006040518083038186803b158015610b4557600080fd5b505afa158015610b59573d6000803e3d6000fd5b50505050610b6785856124f9565b9250925092509250925092565b6000610b7e61277f565b905090565b6000546001600160a01b03163314610bcc5760405162461bcd60e51b815260040180806020018281038252602f8152602001806139e9602f913960400191505060405180910390fd5b600280546001600160a01b0319166001600160a01b03831617905560005b600454811015610ced57600060048281548110610c0357fe5b600091825260209182902001546002546040805163dacb2d0160e01b81526004810184905260248101829052601760448201527f5265736f6c766572206d697373696e6720746172676574000000000000000000606482015290519294506001600160a01b039091169263dacb2d0192608480840193829003018186803b158015610c8d57600080fd5b505afa158015610ca1573d6000803e3d6000fd5b505050506040513d6020811015610cb757600080fd5b505160009182526003602052604090912080546001600160a01b0319166001600160a01b03909216919091179055600101610bea565b5050565b604181565b816000610d01611f3c565b6001600160a01b03166332608039866040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b158015610d4457600080fd5b505afa158015610d58573d6000803e3d6000fd5b505050506040513d6020811015610d6e57600080fd5b5051604080516370a0823160e01b81526001600160a01b038981166004830152915191909216916370a08231916024808301926020929190829003018186803b158015610dba57600080fd5b505afa158015610dce573d6000803e3d6000fd5b505050506040513d6020811015610de457600080fd5b5051905080821115610df4578091505b8215610e0d57610e0a828463ffffffff61283616565b91505b50949350505050565b6001546001600160a01b031681565b6000610e7682610e33611f7f565b6001600160a01b031663ac82f608856040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561094457600080fd5b90505b919050565b6002546000906001600160a01b03838116911614610e9e57506000610e79565b60005b600454811015610f9057600060048281548110610eba57fe5b6000918252602080832090910154808352600382526040928390205460025484516321f8a72160e01b81526004810184905294519295506001600160a01b03918216949116926321f8a72192602480840193829003018186803b158015610f2057600080fd5b505afa158015610f34573d6000803e3d6000fd5b505050506040513d6020811015610f4a57600080fd5b50516001600160a01b0316141580610f7757506000818152600360205260409020546001600160a01b0316155b15610f8757600092505050610e79565b50600101610ea1565b50600192915050565b600080610fa4611767565b9050336001600160a01b03821614806110315750604080516316b2213f60e01b815233600482015290516000916001600160a01b038416916316b2213f91602480820192602092909190829003018186803b15801561100257600080fd5b505afa158015611016573d6000803e3d6000fd5b505050506040513d602081101561102c57600080fd5b505114155b61106c5760405162461bcd60e51b81526004018080602001828103825260458152602001806139a46045913960600191505060405180910390fd5b611074612890565b6040805163faf431bb60e01b81526001600160a01b038a8116600483015289811660248301529151929091169163faf431bb91604480820192602092909190829003018186803b1580156110c757600080fd5b505afa1580156110db573d6000803e3d6000fd5b505050506040513d60208110156110f157600080fd5b5051611144576040805162461bcd60e51b815260206004820152601d60248201527f4e6f7420617070726f76656420746f20616374206f6e20626568616c66000000604482015290519081900360640190fd5b6000611153888787878c6117b4565b90935090506107c48189611e3d565b6001546001600160a01b031633146111ab5760405162461bcd60e51b815260040180806020018281038252603581526020018061394e6035913960400191505060405180910390fd5b600054600154604080516001600160a01b03938416815292909116602083015280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b60056020526000908152604090205481565b60008061123b611767565b9050336001600160a01b03821614806112c85750604080516316b2213f60e01b815233600482015290516000916001600160a01b038416916316b2213f91602480820192602092909190829003018186803b15801561129957600080fd5b505afa1580156112ad573d6000803e3d6000fd5b505050506040513d60208110156112c357600080fd5b505114155b6113035760405162461bcd60e51b81526004018080602001828103825260458152602001806139a46045913960600191505060405180910390fd5b60006113128a8a8a8a8a6117b4565b90935090506113218186611e3d565b61132c8488856128c8565b5050979650505050505050565b6000610b7e612942565b6000546001600160a01b031681565b61135a6138e3565b60005b600454811015611398576004818154811061137457fe5b906000526020600020015482826018811061138b57fe5b602002015260010161135d565b5090565b6000610b7e6129bc565b600481815481106113b357fe5b600091825260209091200154905081565b60006113ce611f7f565b9050336001600160a01b0382161461142d576040805162461bcd60e51b815260206004820152601b60248201527f5265737472696374656420746f2045786368616e676552617465730000000000604482015290519081900360640190fd5b60008211611479576040805162461bcd60e51b8152602060048201526014602482015273052617465206d7573742062652061626f766520360641b604482015290519081900360640190fd5b5060009182526005602052604090912055565b6000611498838361062f565b156114a5575060016106cd565b60006114b18484612220565b5050501515949350505050565b6000806114c9611767565b9050336001600160a01b03821614806115565750604080516316b2213f60e01b815233600482015290516000916001600160a01b038416916316b2213f91602480820192602092909190829003018186803b15801561152757600080fd5b505afa15801561153b573d6000803e3d6000fd5b505050506040513d602081101561155157600080fd5b505114155b6115915760405162461bcd60e51b81526004018080602001828103825260458152602001806139a46045913960600191505060405180910390fd5b611599612890565b6040805163faf431bb60e01b81526001600160a01b038c811660048301528b811660248301529151929091169163faf431bb91604480820192602092909190829003018186803b1580156115ec57600080fd5b505afa158015611600573d6000803e3d6000fd5b505050506040513d602081101561161657600080fd5b5051611669576040805162461bcd60e51b815260206004820152601d60248201527f4e6f7420617070726f76656420746f20616374206f6e20626568616c66000000604482015290519081900360640190fd5b60006116788a8989898e6117b4565b90935090506116878186611e3d565b61132c8487856128c8565b601881565b60008060006116a7868686612a3a565b5092999198509650945050505050565b6000610b7e6c45786368616e6765537461746560981b6040518060400160405280601d81526020017f4d697373696e672045786368616e676553746174652061646472657373000000815250612b14565b600080611713612942565b9050821580611731575061172d838263ffffffff61283616565b4210155b15611740576000915050610e79565b61176042611754858463ffffffff61283616565b9063ffffffff612bbe16565b9392505050565b6000610b7e680a6f2dce8d0cae8d2f60bb1b6040518060400160405280601981526020017f4d697373696e672053796e746865746978206164647265737300000000000000815250612b14565b6000806117c2868686612c1b565b6000806117cf89896124f9565b90935091508790508115611800576117e98a8a8a86610cf6565b905080611800575060009350839250611e33915050565b6000806000611810848d8c612a3a565b939b509199509450925090506118268c83611fd0565b156118ac57611833611eec565b6001600160a01b031663abc0bb6e8d60416040518363ffffffff1660e01b81526004018083815260200182815260200192505050600060405180830381600087803b15801561188157600080fd5b505af1158015611895573d6000803e3d6000fd5b5060009a508a9950611e3398505050505050505050565b60008c81526005602052604090208290556118c78a82611fd0565b15611922576118d4611eec565b6001600160a01b031663abc0bb6e8b60416040518363ffffffff1660e01b81526004018083815260200182815260200192505050600060405180830381600087803b15801561188157600080fd5b60008a815260056020526040902081905561193b611f3c565b6001600160a01b031663326080398d6040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561197e57600080fd5b505afa158015611992573d6000803e3d6000fd5b505050506040513d60208110156119a857600080fd5b81019080805190602001909291905050506001600160a01b0316639dc29fac8e866040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050600060405180830381600087803b158015611a1857600080fd5b505af1158015611a2c573d6000803e3d6000fd5b50505050611a38611f3c565b6001600160a01b031663326080398b6040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b158015611a7b57600080fd5b505afa158015611a8f573d6000803e3d6000fd5b505050506040513d6020811015611aa557600080fd5b50516040805163219e412d60e21b81526001600160a01b038c81166004830152602482018c90529151919092169163867904b491604480830192600092919082900301818387803b158015611af957600080fd5b505af1158015611b0d573d6000803e3d6000fd5b505050506000871115611d6d57611b22611f7f565b6001600160a01b031663654a60ac8b89631cd554d160e21b6040518463ffffffff1660e01b815260040180848152602001838152602001828152602001935050505060206040518083038186803b158015611b7c57600080fd5b505afa158015611b90573d6000803e3d6000fd5b505050506040513d6020811015611ba657600080fd5b50519650611bb2611f3c565b6001600160a01b03166332608039631cd554d160e21b6040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b158015611bfc57600080fd5b505afa158015611c10573d6000803e3d6000fd5b505050506040513d6020811015611c2657600080fd5b50516001600160a01b031663867904b4611c3e612df4565b6001600160a01b031663eb1edd616040518163ffffffff1660e01b815260040160206040518083038186803b158015611c7657600080fd5b505afa158015611c8a573d6000803e3d6000fd5b505050506040513d6020811015611ca057600080fd5b5051604080516001600160e01b031960e085901b1681526001600160a01b039092166004830152602482018b905251604480830192600092919082900301818387803b158015611cef57600080fd5b505af1158015611d03573d6000803e3d6000fd5b50505050611d0f612df4565b6001600160a01b03166322bf55ef886040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b158015611d5457600080fd5b505af1158015611d68573d6000803e3d6000fd5b505050505b611d75611767565b6001600160a01b0316636c00f3108e8e878e8d8f6040518763ffffffff1660e01b815260040180876001600160a01b03166001600160a01b03168152602001868152602001858152602001848152602001838152602001826001600160a01b03166001600160a01b031681526020019650505050505050600060405180830381600087803b158015611e0657600080fd5b505af1158015611e1a573d6000803e3d6000fd5b50505050611e2c898d868d8c88612e3f565b5050505050505b9550959350505050565b600082118015611e5557506001600160a01b03811615155b8015611e645750611e646129bc565b15610ced57611e71613050565b6001600160a01b03166321cad77483836040518363ffffffff1660e01b815260040180838152602001826001600160a01b03166001600160a01b0316815260200192505050600060405180830381600087803b158015611ed057600080fd5b505af1158015611ee4573d6000803e3d6000fd5b505050505050565b6000610b7e6b53797374656d53746174757360a01b6040518060400160405280601c81526020017f4d697373696e672053797374656d537461747573206164647265737300000000815250612b14565b6000610b7e6524b9b9bab2b960d11b604051806040016040528060168152602001754d697373696e6720497373756572206164647265737360501b815250612b14565b6000610b7e6c45786368616e6765526174657360981b6040518060400160405280601d81526020017f4d697373696e672045786368616e676552617465732061646472657373000000815250612b14565b600081611fdf575060016106cd565b600083815260056020526040902054801561200657611ffe81846130a2565b9150506106cd565b6060612010611f7f565b6001600160a01b0316632d7371e18660046040518363ffffffff1660e01b8152600401808381526020018281526020019250505060006040518083038186803b15801561205c57600080fd5b505afa158015612070573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604090815281101561209957600080fd5b81019080805160405193929190846401000000008211156120b957600080fd5b9083019060208201858111156120ce57600080fd5b82518660208202830111640100000000821117156120eb57600080fd5b82525081516020918201928201910280838360005b83811015612118578181015183820152602001612100565b505050509050016040526020018051604051939291908464010000000082111561214157600080fd5b90830190602082018581111561215657600080fd5b825186602082028301116401000000008211171561217357600080fd5b82525081516020918201928201910280838360005b838110156121a0578181015183820152602001612188565b505050509050016040525050505090506000600190505b81518110156122145760008282815181106121ce57fe5b60200260200101511180156121fb57506121fb8282815181106121ed57fe5b6020026020010151866130a2565b1561220c57600193505050506106cd565b6001016121b7565b50600095945050505050565b6000806000606061222f6116b7565b6001600160a01b031663b44e975387876040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b031681526020018281526020019250505060206040518083038186803b15801561228c57600080fd5b505afa1580156122a0573d6000803e3d6000fd5b505050506040513d60208110156122b657600080fd5b50516040805182815260208084028201019091529092506060908380156122f757816020015b6122e4613902565b8152602001906001900390816122dc5790505b50905060005b838110156124e257600080612310613902565b61231b8b8b86613101565b90506000806123298361321c565b915091506000612337611f7f565b6001600160a01b031663266da16b85600001518660200151876040015187876040518663ffffffff1660e01b8152600401808681526020018581526020018481526020018381526020018281526020019550505050505060206040518083038186803b1580156123a657600080fd5b505afa1580156123ba573d6000803e3d6000fd5b505050506040513d60208110156123d057600080fd5b505160808501519091506000906123e890839061336f565b90506123f88560600151826130a2565b61246d57808560600151111561243657606085015161241d908263ffffffff612bbe16565b965061242f8d8863ffffffff61283616565b9c5061246d565b846060015181111561246d57606085015161245890829063ffffffff612bbe16565b955061246a8c8763ffffffff61283616565b9b505b6040518061010001604052808660000151815260200186602001518152602001866040015181526020018881526020018781526020018581526020018481526020018660a001518152508989815181106124c357fe5b60200260200101819052505050505050505080806001019150506122fd565b50905092959194509250565b60006106ca82613401565b6000806000612508858561062f565b156125445760405162461bcd60e51b8152600401808060200182810382526023815260200180613a5b6023913960400191505060405180910390fd5b600080600060606125558989612220565b93509350935093508284111561258757612575848463ffffffff612bbe16565b96506125828989896134d9565b6125ac565b838311156125ac5761259f838563ffffffff612bbe16565b95506125ac898988613629565b60005b81518110156126f157896001600160a01b03167f8e3ad1f68bec55de3b6fa12ae2674a2a683a17c918a4cbf5157ac5d9ddc6e9408383815181106125ef57fe5b60200260200101516000015184848151811061260757fe5b60200260200101516020015185858151811061261f57fe5b60200260200101516040015186868151811061263757fe5b60200260200101516060015187878151811061264f57fe5b60200260200101516080015188888151811061266757fe5b602002602001015160a0015189898151811061267f57fe5b602002602001015160c001518a8a8151811061269757fe5b602002602001015160e00151604051808981526020018881526020018781526020018681526020018581526020018481526020018381526020018281526020019850505050505050505060405180910390a26001016125af565b508194506126fd6116b7565b6001600160a01b031663d0d3d62a8a8a6040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050600060405180830381600087803b15801561275c57600080fd5b505af1158015612770573d6000803e3d6000fd5b50505050505050509250925092565b6000612789613779565b6001600160a01b03166323257c2b6d53797374656d53657474696e677360901b7f7072696365446576696174696f6e5468726573686f6c64466163746f720000006040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b15801561280557600080fd5b505afa158015612819573d6000803e3d6000fd5b505050506040513d602081101561282f57600080fd5b5051905090565b6000828201838110156106ca576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000610b7e7044656c6567617465417070726f76616c7360781b60405180606001604052806021815260200161398360219139612b14565b6128d0611767565b6001600160a01b031663ddd03a3f8484846040518463ffffffff1660e01b8152600401808481526020018381526020018281526020019350505050600060405180830381600087803b15801561292557600080fd5b505af1158015612939573d6000803e3d6000fd5b50505050505050565b600061294c613779565b6001600160a01b03166323257c2b6d53797374656d53657474696e677360901b7077616974696e67506572696f645365637360781b6040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b15801561280557600080fd5b60006129c6613779565b6001600160a01b031663d994502d6d53797374656d53657474696e677360901b741d1c98591a5b99d4995dd85c991cd15b98589b1959605a1b6040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b15801561280557600080fd5b600080600080600080612a4b611f7f565b6001600160a01b0316638295016a898b8a6040518463ffffffff1660e01b815260040180848152602001838152602001828152602001935050505060606040518083038186803b158015612a9e57600080fd5b505afa158015612ab2573d6000803e3d6000fd5b505050506040513d6060811015612ac857600080fd5b50805160208201516040909201519194509092509050612ae888886124ee565b9350612af4818561336f565b9550612b06818763ffffffff612bbe16565b945050939792965093509350565b6000828152600360205260408120546001600160a01b03168281612bb65760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612b7b578181015183820152602001612b63565b50505050905090810190601f168015612ba85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b509392505050565b600082821115612c15576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b80831415612c66576040805162461bcd60e51b8152602060048201526013602482015272086c2dc4ee840c4ca40e6c2daca40e6f2dce8d606b1b604482015290519081900360640190fd5b60008211612ca9576040805162461bcd60e51b815260206004820152600b60248201526a16995c9bc8185b5bdd5b9d60aa1b604482015290519081900360640190fd5b60408051600280825260608083018452926020830190803883390190505090508381600081518110612cd757fe5b6020026020010181815250508181600181518110612cf157fe5b602002602001018181525050612d05611f7f565b6001600160a01b0316630a7d36d1826040518263ffffffff1660e01b81526004018080602001828103825283818151815260200191508051906020019060200280838360005b83811015612d63578181015183820152602001612d4b565b505050509050019250505060206040518083038186803b158015612d8657600080fd5b505afa158015612d9a573d6000803e3d6000fd5b505050506040513d6020811015612db057600080fd5b505115612dee5760405162461bcd60e51b8152600401808060200182810382526022815260200180613a396022913960400191505060405180910390fd5b50505050565b6000610b7e66119959541bdbdb60ca1b6040518060400160405280601781526020017f4d697373696e6720466565506f6f6c2061646472657373000000000000000000815250612b14565b6000612e49611f7f565b90506000816001600160a01b0316637a018a1e886040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b158015612e9157600080fd5b505afa158015612ea5573d6000803e3d6000fd5b505050506040513d6020811015612ebb57600080fd5b505160408051633d00c50f60e11b81526004810188905290519192506000916001600160a01b03851691637a018a1e916024808301926020929190829003018186803b158015612f0a57600080fd5b505afa158015612f1e573d6000803e3d6000fd5b505050506040513d6020811015612f3457600080fd5b50519050612f406116b7565b60408051630f2a761760e21b81526001600160a01b038c81166004830152602482018c9052604482018b9052606482018a90526084820189905260a482018890524260c483015260e48201869052610104820185905291519290911691633ca9d85c916101248082019260009290919082900301818387803b158015612fc557600080fd5b505af1158015612fd9573d6000803e3d6000fd5b5050604080518b8152602081018b90528082018a9052606081018990526080810188905260a0810186905260c0810185905290516001600160a01b038d1693507f62e40d554c7abcdd31074960d8347a2225daeb04d93bc748f049ba2ce946239892509081900360e00190a2505050505050505050565b6000610b7e6d54726164696e675265776172647360901b6040518060400160405280601e81526020017f4d697373696e672054726164696e675265776172647320616464726573730000815250612b14565b60008215806130af575081155b156130bc575060016106cd565b6000838311156130dd576130d6838563ffffffff6137cc16565b90506130f0565b6130ed848463ffffffff6137cc16565b90505b6130f861277f565b11159392505050565b613109613902565b60008060008060008060008061311d6116b7565b6001600160a01b03166315987eb68d8d8d6040518463ffffffff1660e01b815260040180846001600160a01b03166001600160a01b0316815260200183815260200182815260200193505050506101006040518083038186803b15801561318357600080fd5b505afa158015613197573d6000803e3d6000fd5b505050506040513d6101008110156131ae57600080fd5b50805160208083015160408085015160608087015160808089015160a0808b015160c0808d015160e09d8e01518a5161010081018c529d8e529b8d019a909a52978b019690965293890192909252870152850152830152918101919091529c9b505050505050505050505050565b6000806000613229611f7f565b90506000613235612942565b9050816001600160a01b031663109e46a286600001518760c001518860a00151856040518563ffffffff1660e01b81526004018085815260200184815260200183815260200182815260200194505050505060206040518083038186803b15801561329f57600080fd5b505afa1580156132b3573d6000803e3d6000fd5b505050506040513d60208110156132c957600080fd5b505160408087015160e088015160a0890151835163084f235160e11b81526004810193909352602483019190915260448201526064810184905290519195506001600160a01b0384169163109e46a291608480820192602092909190829003018186803b15801561333957600080fd5b505afa15801561334d573d6000803e3d6000fd5b505050506040513d602081101561336357600080fd5b50519395939450505050565b60006106ca6133f4837384d626b2bb4d0f064067e4bf80fce7055d8f3e7b63907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b1580156133bc57600080fd5b505af41580156133d0573d6000803e3d6000fd5b505050506040513d60208110156133e657600080fd5b50519063ffffffff612bbe16565b849063ffffffff6137f616565b600061340b613779565b6001600160a01b03166323257c2b6d53797374656d53657474696e677360901b6e65786368616e67654665655261746560881b856040516020018083815260200182815260200192505050604051602081830303815290604052805190602001206040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b1580156134a757600080fd5b505afa1580156134bb573d6000803e3d6000fd5b505050506040513d60208110156134d157600080fd5b505192915050565b6134e1611f3c565b6001600160a01b03166332608039836040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561352457600080fd5b505afa158015613538573d6000803e3d6000fd5b505050506040513d602081101561354e57600080fd5b505160408051632770a7eb60e21b81526001600160a01b0386811660048301526024820185905291519190921691639dc29fac91604480830192600092919082900301818387803b1580156135a257600080fd5b505af11580156135b6573d6000803e3d6000fd5b505050506135c2611767565b6001600160a01b031663ace88afd8484846040518463ffffffff1660e01b815260040180846001600160a01b03166001600160a01b031681526020018381526020018281526020019350505050600060405180830381600087803b15801561292557600080fd5b613631611f3c565b6001600160a01b03166332608039836040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561367457600080fd5b505afa158015613688573d6000803e3d6000fd5b505050506040513d602081101561369e57600080fd5b50516040805163219e412d60e21b81526001600160a01b038681166004830152602482018590529151919092169163867904b491604480830192600092919082900301818387803b1580156136f257600080fd5b505af1158015613706573d6000803e3d6000fd5b50505050613712611767565b6001600160a01b0316636f01a9868484846040518463ffffffff1660e01b815260040180846001600160a01b03166001600160a01b031681526020018381526020018281526020019350505050600060405180830381600087803b15801561292557600080fd5b6000610b7e6e466c657869626c6553746f7261676560881b6040518060400160405280601f81526020017f4d697373696e6720466c657869626c6553746f72616765206164647265737300815250612b14565b60006106ca826137ea85670de0b6b3a764000063ffffffff61382016565b9063ffffffff61387916565b6000670de0b6b3a7640000613811848463ffffffff61382016565b8161381857fe5b049392505050565b60008261382f575060006106cd565b8282028284828161383c57fe5b04146106ca5760405162461bcd60e51b8152600401808060200182810382526021815260200180613a186021913960400191505060405180910390fd5b60008082116138cf576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b60008284816138da57fe5b04949350505050565b6040518061030001604052806018906020820280388339509192915050565b6040518061010001604052806000801916815260200160008152602001600080191681526020016000815260200160008152602001600081526020016000815260200160008152509056fe596f75206d757374206265206e6f6d696e61746564206265666f726520796f752063616e20616363657074206f776e6572736869704d697373696e672044656c6567617465417070726f76616c73206164647265737345786368616e6765723a204f6e6c792073796e746865746978206f7220612073796e746820636f6e74726163742063616e20706572666f726d207468697320616374696f6e4f6e6c792074686520636f6e7472616374206f776e6572206d617920706572666f726d207468697320616374696f6e536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775372632f64657374207261746520696e76616c6964206f72206e6f7420666f756e6443616e6e6f7420736574746c6520647572696e672077616974696e6720706572696f64a265627a7a7231582056900a6a47a7f4324b34d4c8dab72d5889a58e7aadbc6777c4e57ad56b610bcb64736f6c63430005100032000000000000000000000000de910777c787903f78c89e7a0bf7f4c435cbb1fe00000000000000000000000061166014e3f04e40c953fe4eab9d9e40863c83ae

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101cf5760003560e01c8063631e144411610104578063ab49848c116100a2578063d6f32e0611610071578063d6f32e0614610573578063dfffca761461059f578063e3235c91146105ef578063f450aa34146105f7576101cf565b8063ab49848c146104ea578063c193f0d81461052b578063c6c9d82814610533578063ce09694014610550576101cf565b80637dd1a57a116100de5780637dd1a57a1461046d57806386baa45c1461048a57806389257117146104da5780638da5cb5b146104e2576101cf565b8063631e1444146103fd5780636a1c47581461042357806379ba509714610465576101cf565b80631b16802c116101715780633fa70f451161014b5780633fa70f45146103845780634c268fc81461038c57806353a47bb7146103c457806357af302c146103cc576101cf565b80631b16802c1461032a578063372a395a146103565780633be99e6f1461035e576101cf565b80630b9e31c9116101ad5780630b9e31c9146102785780631627540c1461029757806319d5c665146102bd5780631a5c609514610307576101cf565b806304f3bcec146101d4578063059c29ec146101f85780630a1e187d14610236575b600080fd5b6101dc610620565b604080516001600160a01b039092168252519081900360200190f35b6102246004803603604081101561020e57600080fd5b506001600160a01b03813516906020013561062f565b60408051918252519081900360200190f35b610224600480360360a081101561024c57600080fd5b506001600160a01b038135811691602081013591604082013591606081013591608090910135166106d3565b6102956004803603602081101561028e57600080fd5b50356107cf565b005b610295600480360360208110156102ad57600080fd5b50356001600160a01b0316610a2e565b6102e9600480360360408110156102d357600080fd5b506001600160a01b038135169060200135610acb565b60408051938452602084019290925282820152519081900360600190f35b6102246004803603604081101561031d57600080fd5b5080359060200135610ae9565b6102e96004803603604081101561034057600080fd5b506001600160a01b038135169060200135610af5565b610224610b74565b6102956004803603602081101561037457600080fd5b50356001600160a01b0316610b83565b610224610cf1565b610224600480360360808110156103a257600080fd5b506001600160a01b038135169060208101359060408101359060600135610cf6565b6101dc610e16565b6103e9600480360360208110156103e257600080fd5b5035610e25565b604080519115158252519081900360200190f35b6103e96004803603602081101561041357600080fd5b50356001600160a01b0316610e7e565b610224600480360360a081101561043957600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060800135610f99565b610295611162565b6102246004803603602081101561048357600080fd5b503561121e565b610224600480360360e08110156104a057600080fd5b506001600160a01b038135811691602081013591604082013591606081013591608082013581169160a08101359091169060c00135611230565b610224611339565b6101dc611343565b6104f2611352565b604051808261030080838360005b83811015610518578181015183820152602001610500565b5050505090500191505060405180910390f35b6103e961139c565b6102246004803603602081101561054957600080fd5b50356113a6565b6102956004803603604081101561056657600080fd5b50803590602001356113c4565b6103e96004803603604081101561058957600080fd5b506001600160a01b03813516906020013561148c565b610224600480360360e08110156105b557600080fd5b506001600160a01b038135811691602081013582169160408201359160608101359160808201359160a08101359091169060c001356114be565b610224611692565b6102e96004803603606081101561060d57600080fd5b5080359060208101359060400135611697565b6002546001600160a01b031681565b60006106ca61063c6116b7565b6001600160a01b031663f1406dc885856040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b031681526020018281526020019250505060206040518083038186803b15801561069957600080fd5b505afa1580156106ad573d6000803e3d6000fd5b505050506040513d60208110156106c357600080fd5b5051611708565b90505b92915050565b6000806106de611767565b9050336001600160a01b038216148061076b5750604080516316b2213f60e01b815233600482015290516000916001600160a01b038416916316b2213f91602480820192602092909190829003018186803b15801561073c57600080fd5b505afa158015610750573d6000803e3d6000fd5b505050506040513d602081101561076657600080fd5b505114155b6107a65760405162461bcd60e51b81526004018080602001828103825260458152602001806139a46045913960600191505060405180910390fd5b60006107b588888888886117b4565b90935090506107c48185611e3d565b505095945050505050565b6107d7611eec565b6001600160a01b031663086dabd16040518163ffffffff1660e01b815260040160006040518083038186803b15801561080f57600080fd5b505afa158015610823573d6000803e3d6000fd5b5050505060006001600160a01b031661083a611f3c565b6001600160a01b03166332608039836040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561087d57600080fd5b505afa158015610891573d6000803e3d6000fd5b505050506040513d60208110156108a757600080fd5b50516001600160a01b031614156108f5576040805162461bcd60e51b815260206004820152600d60248201526c09cde40e6eac6d040e6f2dce8d609b1b604482015290519081900360640190fd5b61097581610901611f7f565b6001600160a01b031663ac82f608846040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561094457600080fd5b505afa158015610958573d6000803e3d6000fd5b505050506040513d602081101561096e57600080fd5b5051611fd0565b6109bd576040805162461bcd60e51b815260206004820152601460248201527314de5b9d1a081c1c9a58d9481a5cc81d985b1a5960621b604482015290519081900360640190fd5b6109c5611eec565b6001600160a01b031663abc0bb6e8260416040518363ffffffff1660e01b81526004018083815260200182815260200192505050600060405180830381600087803b158015610a1357600080fd5b505af1158015610a27573d6000803e3d6000fd5b5050505050565b6000546001600160a01b03163314610a775760405162461bcd60e51b815260040180806020018281038252602f8152602001806139e9602f913960400191505060405180910390fd5b600180546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce229181900360200190a150565b6000806000610ada8585612220565b50919790965090945092505050565b60006106ca83836124ee565b6000806000610b02611eec565b6001600160a01b03166342a28e21856040518263ffffffff1660e01b81526004018082815260200191505060006040518083038186803b158015610b4557600080fd5b505afa158015610b59573d6000803e3d6000fd5b50505050610b6785856124f9565b9250925092509250925092565b6000610b7e61277f565b905090565b6000546001600160a01b03163314610bcc5760405162461bcd60e51b815260040180806020018281038252602f8152602001806139e9602f913960400191505060405180910390fd5b600280546001600160a01b0319166001600160a01b03831617905560005b600454811015610ced57600060048281548110610c0357fe5b600091825260209182902001546002546040805163dacb2d0160e01b81526004810184905260248101829052601760448201527f5265736f6c766572206d697373696e6720746172676574000000000000000000606482015290519294506001600160a01b039091169263dacb2d0192608480840193829003018186803b158015610c8d57600080fd5b505afa158015610ca1573d6000803e3d6000fd5b505050506040513d6020811015610cb757600080fd5b505160009182526003602052604090912080546001600160a01b0319166001600160a01b03909216919091179055600101610bea565b5050565b604181565b816000610d01611f3c565b6001600160a01b03166332608039866040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b158015610d4457600080fd5b505afa158015610d58573d6000803e3d6000fd5b505050506040513d6020811015610d6e57600080fd5b5051604080516370a0823160e01b81526001600160a01b038981166004830152915191909216916370a08231916024808301926020929190829003018186803b158015610dba57600080fd5b505afa158015610dce573d6000803e3d6000fd5b505050506040513d6020811015610de457600080fd5b5051905080821115610df4578091505b8215610e0d57610e0a828463ffffffff61283616565b91505b50949350505050565b6001546001600160a01b031681565b6000610e7682610e33611f7f565b6001600160a01b031663ac82f608856040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561094457600080fd5b90505b919050565b6002546000906001600160a01b03838116911614610e9e57506000610e79565b60005b600454811015610f9057600060048281548110610eba57fe5b6000918252602080832090910154808352600382526040928390205460025484516321f8a72160e01b81526004810184905294519295506001600160a01b03918216949116926321f8a72192602480840193829003018186803b158015610f2057600080fd5b505afa158015610f34573d6000803e3d6000fd5b505050506040513d6020811015610f4a57600080fd5b50516001600160a01b0316141580610f7757506000818152600360205260409020546001600160a01b0316155b15610f8757600092505050610e79565b50600101610ea1565b50600192915050565b600080610fa4611767565b9050336001600160a01b03821614806110315750604080516316b2213f60e01b815233600482015290516000916001600160a01b038416916316b2213f91602480820192602092909190829003018186803b15801561100257600080fd5b505afa158015611016573d6000803e3d6000fd5b505050506040513d602081101561102c57600080fd5b505114155b61106c5760405162461bcd60e51b81526004018080602001828103825260458152602001806139a46045913960600191505060405180910390fd5b611074612890565b6040805163faf431bb60e01b81526001600160a01b038a8116600483015289811660248301529151929091169163faf431bb91604480820192602092909190829003018186803b1580156110c757600080fd5b505afa1580156110db573d6000803e3d6000fd5b505050506040513d60208110156110f157600080fd5b5051611144576040805162461bcd60e51b815260206004820152601d60248201527f4e6f7420617070726f76656420746f20616374206f6e20626568616c66000000604482015290519081900360640190fd5b6000611153888787878c6117b4565b90935090506107c48189611e3d565b6001546001600160a01b031633146111ab5760405162461bcd60e51b815260040180806020018281038252603581526020018061394e6035913960400191505060405180910390fd5b600054600154604080516001600160a01b03938416815292909116602083015280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b60056020526000908152604090205481565b60008061123b611767565b9050336001600160a01b03821614806112c85750604080516316b2213f60e01b815233600482015290516000916001600160a01b038416916316b2213f91602480820192602092909190829003018186803b15801561129957600080fd5b505afa1580156112ad573d6000803e3d6000fd5b505050506040513d60208110156112c357600080fd5b505114155b6113035760405162461bcd60e51b81526004018080602001828103825260458152602001806139a46045913960600191505060405180910390fd5b60006113128a8a8a8a8a6117b4565b90935090506113218186611e3d565b61132c8488856128c8565b5050979650505050505050565b6000610b7e612942565b6000546001600160a01b031681565b61135a6138e3565b60005b600454811015611398576004818154811061137457fe5b906000526020600020015482826018811061138b57fe5b602002015260010161135d565b5090565b6000610b7e6129bc565b600481815481106113b357fe5b600091825260209091200154905081565b60006113ce611f7f565b9050336001600160a01b0382161461142d576040805162461bcd60e51b815260206004820152601b60248201527f5265737472696374656420746f2045786368616e676552617465730000000000604482015290519081900360640190fd5b60008211611479576040805162461bcd60e51b8152602060048201526014602482015273052617465206d7573742062652061626f766520360641b604482015290519081900360640190fd5b5060009182526005602052604090912055565b6000611498838361062f565b156114a5575060016106cd565b60006114b18484612220565b5050501515949350505050565b6000806114c9611767565b9050336001600160a01b03821614806115565750604080516316b2213f60e01b815233600482015290516000916001600160a01b038416916316b2213f91602480820192602092909190829003018186803b15801561152757600080fd5b505afa15801561153b573d6000803e3d6000fd5b505050506040513d602081101561155157600080fd5b505114155b6115915760405162461bcd60e51b81526004018080602001828103825260458152602001806139a46045913960600191505060405180910390fd5b611599612890565b6040805163faf431bb60e01b81526001600160a01b038c811660048301528b811660248301529151929091169163faf431bb91604480820192602092909190829003018186803b1580156115ec57600080fd5b505afa158015611600573d6000803e3d6000fd5b505050506040513d602081101561161657600080fd5b5051611669576040805162461bcd60e51b815260206004820152601d60248201527f4e6f7420617070726f76656420746f20616374206f6e20626568616c66000000604482015290519081900360640190fd5b60006116788a8989898e6117b4565b90935090506116878186611e3d565b61132c8487856128c8565b601881565b60008060006116a7868686612a3a565b5092999198509650945050505050565b6000610b7e6c45786368616e6765537461746560981b6040518060400160405280601d81526020017f4d697373696e672045786368616e676553746174652061646472657373000000815250612b14565b600080611713612942565b9050821580611731575061172d838263ffffffff61283616565b4210155b15611740576000915050610e79565b61176042611754858463ffffffff61283616565b9063ffffffff612bbe16565b9392505050565b6000610b7e680a6f2dce8d0cae8d2f60bb1b6040518060400160405280601981526020017f4d697373696e672053796e746865746978206164647265737300000000000000815250612b14565b6000806117c2868686612c1b565b6000806117cf89896124f9565b90935091508790508115611800576117e98a8a8a86610cf6565b905080611800575060009350839250611e33915050565b6000806000611810848d8c612a3a565b939b509199509450925090506118268c83611fd0565b156118ac57611833611eec565b6001600160a01b031663abc0bb6e8d60416040518363ffffffff1660e01b81526004018083815260200182815260200192505050600060405180830381600087803b15801561188157600080fd5b505af1158015611895573d6000803e3d6000fd5b5060009a508a9950611e3398505050505050505050565b60008c81526005602052604090208290556118c78a82611fd0565b15611922576118d4611eec565b6001600160a01b031663abc0bb6e8b60416040518363ffffffff1660e01b81526004018083815260200182815260200192505050600060405180830381600087803b15801561188157600080fd5b60008a815260056020526040902081905561193b611f3c565b6001600160a01b031663326080398d6040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561197e57600080fd5b505afa158015611992573d6000803e3d6000fd5b505050506040513d60208110156119a857600080fd5b81019080805190602001909291905050506001600160a01b0316639dc29fac8e866040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050600060405180830381600087803b158015611a1857600080fd5b505af1158015611a2c573d6000803e3d6000fd5b50505050611a38611f3c565b6001600160a01b031663326080398b6040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b158015611a7b57600080fd5b505afa158015611a8f573d6000803e3d6000fd5b505050506040513d6020811015611aa557600080fd5b50516040805163219e412d60e21b81526001600160a01b038c81166004830152602482018c90529151919092169163867904b491604480830192600092919082900301818387803b158015611af957600080fd5b505af1158015611b0d573d6000803e3d6000fd5b505050506000871115611d6d57611b22611f7f565b6001600160a01b031663654a60ac8b89631cd554d160e21b6040518463ffffffff1660e01b815260040180848152602001838152602001828152602001935050505060206040518083038186803b158015611b7c57600080fd5b505afa158015611b90573d6000803e3d6000fd5b505050506040513d6020811015611ba657600080fd5b50519650611bb2611f3c565b6001600160a01b03166332608039631cd554d160e21b6040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b158015611bfc57600080fd5b505afa158015611c10573d6000803e3d6000fd5b505050506040513d6020811015611c2657600080fd5b50516001600160a01b031663867904b4611c3e612df4565b6001600160a01b031663eb1edd616040518163ffffffff1660e01b815260040160206040518083038186803b158015611c7657600080fd5b505afa158015611c8a573d6000803e3d6000fd5b505050506040513d6020811015611ca057600080fd5b5051604080516001600160e01b031960e085901b1681526001600160a01b039092166004830152602482018b905251604480830192600092919082900301818387803b158015611cef57600080fd5b505af1158015611d03573d6000803e3d6000fd5b50505050611d0f612df4565b6001600160a01b03166322bf55ef886040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b158015611d5457600080fd5b505af1158015611d68573d6000803e3d6000fd5b505050505b611d75611767565b6001600160a01b0316636c00f3108e8e878e8d8f6040518763ffffffff1660e01b815260040180876001600160a01b03166001600160a01b03168152602001868152602001858152602001848152602001838152602001826001600160a01b03166001600160a01b031681526020019650505050505050600060405180830381600087803b158015611e0657600080fd5b505af1158015611e1a573d6000803e3d6000fd5b50505050611e2c898d868d8c88612e3f565b5050505050505b9550959350505050565b600082118015611e5557506001600160a01b03811615155b8015611e645750611e646129bc565b15610ced57611e71613050565b6001600160a01b03166321cad77483836040518363ffffffff1660e01b815260040180838152602001826001600160a01b03166001600160a01b0316815260200192505050600060405180830381600087803b158015611ed057600080fd5b505af1158015611ee4573d6000803e3d6000fd5b505050505050565b6000610b7e6b53797374656d53746174757360a01b6040518060400160405280601c81526020017f4d697373696e672053797374656d537461747573206164647265737300000000815250612b14565b6000610b7e6524b9b9bab2b960d11b604051806040016040528060168152602001754d697373696e6720497373756572206164647265737360501b815250612b14565b6000610b7e6c45786368616e6765526174657360981b6040518060400160405280601d81526020017f4d697373696e672045786368616e676552617465732061646472657373000000815250612b14565b600081611fdf575060016106cd565b600083815260056020526040902054801561200657611ffe81846130a2565b9150506106cd565b6060612010611f7f565b6001600160a01b0316632d7371e18660046040518363ffffffff1660e01b8152600401808381526020018281526020019250505060006040518083038186803b15801561205c57600080fd5b505afa158015612070573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604090815281101561209957600080fd5b81019080805160405193929190846401000000008211156120b957600080fd5b9083019060208201858111156120ce57600080fd5b82518660208202830111640100000000821117156120eb57600080fd5b82525081516020918201928201910280838360005b83811015612118578181015183820152602001612100565b505050509050016040526020018051604051939291908464010000000082111561214157600080fd5b90830190602082018581111561215657600080fd5b825186602082028301116401000000008211171561217357600080fd5b82525081516020918201928201910280838360005b838110156121a0578181015183820152602001612188565b505050509050016040525050505090506000600190505b81518110156122145760008282815181106121ce57fe5b60200260200101511180156121fb57506121fb8282815181106121ed57fe5b6020026020010151866130a2565b1561220c57600193505050506106cd565b6001016121b7565b50600095945050505050565b6000806000606061222f6116b7565b6001600160a01b031663b44e975387876040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b031681526020018281526020019250505060206040518083038186803b15801561228c57600080fd5b505afa1580156122a0573d6000803e3d6000fd5b505050506040513d60208110156122b657600080fd5b50516040805182815260208084028201019091529092506060908380156122f757816020015b6122e4613902565b8152602001906001900390816122dc5790505b50905060005b838110156124e257600080612310613902565b61231b8b8b86613101565b90506000806123298361321c565b915091506000612337611f7f565b6001600160a01b031663266da16b85600001518660200151876040015187876040518663ffffffff1660e01b8152600401808681526020018581526020018481526020018381526020018281526020019550505050505060206040518083038186803b1580156123a657600080fd5b505afa1580156123ba573d6000803e3d6000fd5b505050506040513d60208110156123d057600080fd5b505160808501519091506000906123e890839061336f565b90506123f88560600151826130a2565b61246d57808560600151111561243657606085015161241d908263ffffffff612bbe16565b965061242f8d8863ffffffff61283616565b9c5061246d565b846060015181111561246d57606085015161245890829063ffffffff612bbe16565b955061246a8c8763ffffffff61283616565b9b505b6040518061010001604052808660000151815260200186602001518152602001866040015181526020018881526020018781526020018581526020018481526020018660a001518152508989815181106124c357fe5b60200260200101819052505050505050505080806001019150506122fd565b50905092959194509250565b60006106ca82613401565b6000806000612508858561062f565b156125445760405162461bcd60e51b8152600401808060200182810382526023815260200180613a5b6023913960400191505060405180910390fd5b600080600060606125558989612220565b93509350935093508284111561258757612575848463ffffffff612bbe16565b96506125828989896134d9565b6125ac565b838311156125ac5761259f838563ffffffff612bbe16565b95506125ac898988613629565b60005b81518110156126f157896001600160a01b03167f8e3ad1f68bec55de3b6fa12ae2674a2a683a17c918a4cbf5157ac5d9ddc6e9408383815181106125ef57fe5b60200260200101516000015184848151811061260757fe5b60200260200101516020015185858151811061261f57fe5b60200260200101516040015186868151811061263757fe5b60200260200101516060015187878151811061264f57fe5b60200260200101516080015188888151811061266757fe5b602002602001015160a0015189898151811061267f57fe5b602002602001015160c001518a8a8151811061269757fe5b602002602001015160e00151604051808981526020018881526020018781526020018681526020018581526020018481526020018381526020018281526020019850505050505050505060405180910390a26001016125af565b508194506126fd6116b7565b6001600160a01b031663d0d3d62a8a8a6040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050600060405180830381600087803b15801561275c57600080fd5b505af1158015612770573d6000803e3d6000fd5b50505050505050509250925092565b6000612789613779565b6001600160a01b03166323257c2b6d53797374656d53657474696e677360901b7f7072696365446576696174696f6e5468726573686f6c64466163746f720000006040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b15801561280557600080fd5b505afa158015612819573d6000803e3d6000fd5b505050506040513d602081101561282f57600080fd5b5051905090565b6000828201838110156106ca576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000610b7e7044656c6567617465417070726f76616c7360781b60405180606001604052806021815260200161398360219139612b14565b6128d0611767565b6001600160a01b031663ddd03a3f8484846040518463ffffffff1660e01b8152600401808481526020018381526020018281526020019350505050600060405180830381600087803b15801561292557600080fd5b505af1158015612939573d6000803e3d6000fd5b50505050505050565b600061294c613779565b6001600160a01b03166323257c2b6d53797374656d53657474696e677360901b7077616974696e67506572696f645365637360781b6040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b15801561280557600080fd5b60006129c6613779565b6001600160a01b031663d994502d6d53797374656d53657474696e677360901b741d1c98591a5b99d4995dd85c991cd15b98589b1959605a1b6040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b15801561280557600080fd5b600080600080600080612a4b611f7f565b6001600160a01b0316638295016a898b8a6040518463ffffffff1660e01b815260040180848152602001838152602001828152602001935050505060606040518083038186803b158015612a9e57600080fd5b505afa158015612ab2573d6000803e3d6000fd5b505050506040513d6060811015612ac857600080fd5b50805160208201516040909201519194509092509050612ae888886124ee565b9350612af4818561336f565b9550612b06818763ffffffff612bbe16565b945050939792965093509350565b6000828152600360205260408120546001600160a01b03168281612bb65760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612b7b578181015183820152602001612b63565b50505050905090810190601f168015612ba85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b509392505050565b600082821115612c15576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b80831415612c66576040805162461bcd60e51b8152602060048201526013602482015272086c2dc4ee840c4ca40e6c2daca40e6f2dce8d606b1b604482015290519081900360640190fd5b60008211612ca9576040805162461bcd60e51b815260206004820152600b60248201526a16995c9bc8185b5bdd5b9d60aa1b604482015290519081900360640190fd5b60408051600280825260608083018452926020830190803883390190505090508381600081518110612cd757fe5b6020026020010181815250508181600181518110612cf157fe5b602002602001018181525050612d05611f7f565b6001600160a01b0316630a7d36d1826040518263ffffffff1660e01b81526004018080602001828103825283818151815260200191508051906020019060200280838360005b83811015612d63578181015183820152602001612d4b565b505050509050019250505060206040518083038186803b158015612d8657600080fd5b505afa158015612d9a573d6000803e3d6000fd5b505050506040513d6020811015612db057600080fd5b505115612dee5760405162461bcd60e51b8152600401808060200182810382526022815260200180613a396022913960400191505060405180910390fd5b50505050565b6000610b7e66119959541bdbdb60ca1b6040518060400160405280601781526020017f4d697373696e6720466565506f6f6c2061646472657373000000000000000000815250612b14565b6000612e49611f7f565b90506000816001600160a01b0316637a018a1e886040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b158015612e9157600080fd5b505afa158015612ea5573d6000803e3d6000fd5b505050506040513d6020811015612ebb57600080fd5b505160408051633d00c50f60e11b81526004810188905290519192506000916001600160a01b03851691637a018a1e916024808301926020929190829003018186803b158015612f0a57600080fd5b505afa158015612f1e573d6000803e3d6000fd5b505050506040513d6020811015612f3457600080fd5b50519050612f406116b7565b60408051630f2a761760e21b81526001600160a01b038c81166004830152602482018c9052604482018b9052606482018a90526084820189905260a482018890524260c483015260e48201869052610104820185905291519290911691633ca9d85c916101248082019260009290919082900301818387803b158015612fc557600080fd5b505af1158015612fd9573d6000803e3d6000fd5b5050604080518b8152602081018b90528082018a9052606081018990526080810188905260a0810186905260c0810185905290516001600160a01b038d1693507f62e40d554c7abcdd31074960d8347a2225daeb04d93bc748f049ba2ce946239892509081900360e00190a2505050505050505050565b6000610b7e6d54726164696e675265776172647360901b6040518060400160405280601e81526020017f4d697373696e672054726164696e675265776172647320616464726573730000815250612b14565b60008215806130af575081155b156130bc575060016106cd565b6000838311156130dd576130d6838563ffffffff6137cc16565b90506130f0565b6130ed848463ffffffff6137cc16565b90505b6130f861277f565b11159392505050565b613109613902565b60008060008060008060008061311d6116b7565b6001600160a01b03166315987eb68d8d8d6040518463ffffffff1660e01b815260040180846001600160a01b03166001600160a01b0316815260200183815260200182815260200193505050506101006040518083038186803b15801561318357600080fd5b505afa158015613197573d6000803e3d6000fd5b505050506040513d6101008110156131ae57600080fd5b50805160208083015160408085015160608087015160808089015160a0808b015160c0808d015160e09d8e01518a5161010081018c529d8e529b8d019a909a52978b019690965293890192909252870152850152830152918101919091529c9b505050505050505050505050565b6000806000613229611f7f565b90506000613235612942565b9050816001600160a01b031663109e46a286600001518760c001518860a00151856040518563ffffffff1660e01b81526004018085815260200184815260200183815260200182815260200194505050505060206040518083038186803b15801561329f57600080fd5b505afa1580156132b3573d6000803e3d6000fd5b505050506040513d60208110156132c957600080fd5b505160408087015160e088015160a0890151835163084f235160e11b81526004810193909352602483019190915260448201526064810184905290519195506001600160a01b0384169163109e46a291608480820192602092909190829003018186803b15801561333957600080fd5b505afa15801561334d573d6000803e3d6000fd5b505050506040513d602081101561336357600080fd5b50519395939450505050565b60006106ca6133f4837384d626b2bb4d0f064067e4bf80fce7055d8f3e7b63907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b1580156133bc57600080fd5b505af41580156133d0573d6000803e3d6000fd5b505050506040513d60208110156133e657600080fd5b50519063ffffffff612bbe16565b849063ffffffff6137f616565b600061340b613779565b6001600160a01b03166323257c2b6d53797374656d53657474696e677360901b6e65786368616e67654665655261746560881b856040516020018083815260200182815260200192505050604051602081830303815290604052805190602001206040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b1580156134a757600080fd5b505afa1580156134bb573d6000803e3d6000fd5b505050506040513d60208110156134d157600080fd5b505192915050565b6134e1611f3c565b6001600160a01b03166332608039836040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561352457600080fd5b505afa158015613538573d6000803e3d6000fd5b505050506040513d602081101561354e57600080fd5b505160408051632770a7eb60e21b81526001600160a01b0386811660048301526024820185905291519190921691639dc29fac91604480830192600092919082900301818387803b1580156135a257600080fd5b505af11580156135b6573d6000803e3d6000fd5b505050506135c2611767565b6001600160a01b031663ace88afd8484846040518463ffffffff1660e01b815260040180846001600160a01b03166001600160a01b031681526020018381526020018281526020019350505050600060405180830381600087803b15801561292557600080fd5b613631611f3c565b6001600160a01b03166332608039836040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561367457600080fd5b505afa158015613688573d6000803e3d6000fd5b505050506040513d602081101561369e57600080fd5b50516040805163219e412d60e21b81526001600160a01b038681166004830152602482018590529151919092169163867904b491604480830192600092919082900301818387803b1580156136f257600080fd5b505af1158015613706573d6000803e3d6000fd5b50505050613712611767565b6001600160a01b0316636f01a9868484846040518463ffffffff1660e01b815260040180846001600160a01b03166001600160a01b031681526020018381526020018281526020019350505050600060405180830381600087803b15801561292557600080fd5b6000610b7e6e466c657869626c6553746f7261676560881b6040518060400160405280601f81526020017f4d697373696e6720466c657869626c6553746f72616765206164647265737300815250612b14565b60006106ca826137ea85670de0b6b3a764000063ffffffff61382016565b9063ffffffff61387916565b6000670de0b6b3a7640000613811848463ffffffff61382016565b8161381857fe5b049392505050565b60008261382f575060006106cd565b8282028284828161383c57fe5b04146106ca5760405162461bcd60e51b8152600401808060200182810382526021815260200180613a186021913960400191505060405180910390fd5b60008082116138cf576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b60008284816138da57fe5b04949350505050565b6040518061030001604052806018906020820280388339509192915050565b6040518061010001604052806000801916815260200160008152602001600080191681526020016000815260200160008152602001600081526020016000815260200160008152509056fe596f75206d757374206265206e6f6d696e61746564206265666f726520796f752063616e20616363657074206f776e6572736869704d697373696e672044656c6567617465417070726f76616c73206164647265737345786368616e6765723a204f6e6c792073796e746865746978206f7220612073796e746820636f6e74726163742063616e20706572666f726d207468697320616374696f6e4f6e6c792074686520636f6e7472616374206f776e6572206d617920706572666f726d207468697320616374696f6e536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775372632f64657374207261746520696e76616c6964206f72206e6f7420666f756e6443616e6e6f7420736574746c6520647572696e672077616974696e6720706572696f64a265627a7a7231582056900a6a47a7f4324b34d4c8dab72d5889a58e7aadbc6777c4e57ad56b610bcb64736f6c63430005100032

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

000000000000000000000000de910777c787903f78c89e7a0bf7f4c435cbb1fe00000000000000000000000061166014e3f04e40c953fe4eab9d9e40863c83ae

-----Decoded View---------------
Arg [0] : _owner (address): 0xDe910777C787903F78C89e7a0bf7F4C435cBB1Fe
Arg [1] : _resolver (address): 0x61166014E3f04E40C953fe4EAb9D9E40863C83AE

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000de910777c787903f78c89e7a0bf7f4c435cbb1fe
Arg [1] : 00000000000000000000000061166014e3f04e40c953fe4eab9d9e40863c83ae


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.