Contract 0x6d9edCbC275a3664f04E68d7fc1466858C683b90

Contract Overview

Balance:
0 Ether
Txn Hash
Method
Block
From
To
Value
0x1284c1f09fb4aca9e76be72b757edbef9a8b4b9687091d816b84bd5ddb8d095bSet Liquidate Re...315768302022-05-13 5:44:0852 days 18 hrs ago0x73570075092502472e4b61a7058df1a4a1db12f2 IN  0x6d9edcbc275a3664f04e68d7fc1466858c683b900 Ether0.0000696 1
0xcd89a20d05ea0f6167b34e80f298a2ed2bced2aaeb52a0c9dfa0400a0c39d7bdSet Flag Reward315768282022-05-13 5:44:0052 days 18 hrs ago0x73570075092502472e4b61a7058df1a4a1db12f2 IN  0x6d9edcbc275a3664f04e68d7fc1466858c683b900 Ether0.00006955 1
0xb770ead17ff5d981ebafdf575a9b4b66e9a6422d81eda0a4206195181c96186aSet Liquidation ...315768252022-05-13 5:43:4852 days 18 hrs ago0x73570075092502472e4b61a7058df1a4a1db12f2 IN  0x6d9edcbc275a3664f04e68d7fc1466858c683b900 Ether0.00006958 1
0x5a46db1d8faf1c3d85128924a0e9e8daace94169af112254ae8376e2611eb6ccSet Self Liquida...315768222022-05-13 5:43:3652 days 18 hrs ago0x73570075092502472e4b61a7058df1a4a1db12f2 IN  0x6d9edcbc275a3664f04e68d7fc1466858c683b900 Ether0.00007282 1
0x3b36014a8c9450511b94cc1ab719cc5540f6b8b7ce36b5d895da0dddae2bb2470x60806040315767682022-05-13 5:39:2452 days 18 hrs ago0x73570075092502472e4b61a7058df1a4a1db12f2 IN  Create: SystemSettings0 Ether0.00471843 1
[ Download CSV Export 
Latest 8 internal transactions
Parent Txn Hash Block From To Value
0x1284c1f09fb4aca9e76be72b757edbef9a8b4b9687091d816b84bd5ddb8d095b315768302022-05-13 5:44:0852 days 18 hrs ago 0x6d9edcbc275a3664f04e68d7fc1466858c683b90 0xb1751e5ede811288ce2fc4c65aaca17a955366be0 Ether
0xcd89a20d05ea0f6167b34e80f298a2ed2bced2aaeb52a0c9dfa0400a0c39d7bd315768282022-05-13 5:44:0052 days 18 hrs ago 0x6d9edcbc275a3664f04e68d7fc1466858c683b90 0xb1751e5ede811288ce2fc4c65aaca17a955366be0 Ether
0xb770ead17ff5d981ebafdf575a9b4b66e9a6422d81eda0a4206195181c96186a315768252022-05-13 5:43:4852 days 18 hrs ago 0x6d9edcbc275a3664f04e68d7fc1466858c683b90 0xb1751e5ede811288ce2fc4c65aaca17a955366be0 Ether
0x5a46db1d8faf1c3d85128924a0e9e8daace94169af112254ae8376e2611eb6cc315768222022-05-13 5:43:3652 days 18 hrs ago 0x6d9edcbc275a3664f04e68d7fc1466858c683b90 0xb1751e5ede811288ce2fc4c65aaca17a955366be0 Ether
0x5a46db1d8faf1c3d85128924a0e9e8daace94169af112254ae8376e2611eb6cc315768222022-05-13 5:43:3652 days 18 hrs ago 0x6d9edcbc275a3664f04e68d7fc1466858c683b90 0x47f08d263d759d150bc61be5d72337ebd45fb5590 Ether
0x8b279ca65bbeec1b275e1349186d8a8bf9d368f060576f718c203661afa5ae20315767932022-05-13 5:41:2052 days 18 hrs ago 0x6d9edcbc275a3664f04e68d7fc1466858c683b90 0x242a3df52c375bee81b1c668741d7c63af68fdd20 Ether
0x8b279ca65bbeec1b275e1349186d8a8bf9d368f060576f718c203661afa5ae20315767932022-05-13 5:41:2052 days 18 hrs ago 0x84f87e3636aa9cc1080c07e6c61adfdcc23c0db6 0x6d9edcbc275a3664f04e68d7fc1466858c683b900 Ether
0x3b36014a8c9450511b94cc1ab719cc5540f6b8b7ce36b5d895da0dddae2bb247315767682022-05-13 5:39:2452 days 18 hrs ago 0x6d9edcbc275a3664f04e68d7fc1466858c683b90 0x47f08d263d759d150bc61be5d72337ebd45fb5590 Ether
[ Download CSV Export 
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.

Contract Source Code Verified (Exact Match)

Contract Name:
SystemSettings

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 2022-05-13
*/

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

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



pragma solidity ^0.5.16;

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

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

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

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

    modifier onlyOwner {
        _onlyOwner();
        _;
    }

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

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


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

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

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


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

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

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

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

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

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


// https://docs.synthetix.io/contracts/source/interfaces/iissuer
interface IIssuer {
    // Views

    function allNetworksDebtInfo()
        external
        view
        returns (
            uint256 debt,
            uint256 sharesSupply,
            bool isStale
        );

    function anySynthOrSNXRateIsInvalid() external view returns (bool anyRateInvalid);

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

    function availableSynthCount() external view returns (uint);

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

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

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

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

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

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

    function issuanceRatio() external view returns (uint);

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

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

    function minimumStakeTime() external view returns (uint);

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

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

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

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

    function totalIssuedSynths(bytes32 currencyKey, bool excludeOtherCollateral) 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 burnForRedemption(
        address deprecatedSynthProxy,
        address account,
        uint balance
    ) external;

    function setCurrentPeriodId(uint128 periodId) external;

    function liquidateAccount(address account, bool isSelfLiquidation)
        external
        returns (uint totalRedeemed, uint amountToLiquidate);

    function issueSynthsWithoutDebt(
        bytes32 currencyKey,
        address to,
        uint amount
    ) external returns (bool rateInvalid);

    function burnSynthsWithoutDebt(
        bytes32 currencyKey,
        address to,
        uint amount
    ) external returns (bool rateInvalid);
}


// Inheritance


// Internal references


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

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

    /* ========== RESTRICTED 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++) {
            bytes32 name = names[i];
            address destination = destinations[i];
            repository[name] = destination;
            emit AddressImported(name, destination);
        }
    }

    /* ========= PUBLIC FUNCTIONS ========== */

    function rebuildCaches(MixinResolver[] calldata destinations) external {
        for (uint i = 0; i < destinations.length; i++) {
            destinations[i].rebuildCache();
        }
    }

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

    function areAddressesImported(bytes32[] calldata names, address[] calldata destinations) external view returns (bool) {
        for (uint i = 0; i < names.length; i++) {
            if (repository[names[i]] != destinations[i]) {
                return false;
            }
        }
        return true;
    }

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

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

    event AddressImported(bytes32 name, address destination);
}


// Internal references


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

    mapping(bytes32 => address) private addressCache;

    constructor(address _resolver) internal {
        resolver = AddressResolver(_resolver);
    }

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

    function combineArrays(bytes32[] memory first, bytes32[] memory second)
        internal
        pure
        returns (bytes32[] memory combination)
    {
        combination = new bytes32[](first.length + second.length);

        for (uint i = 0; i < first.length; i++) {
            combination[i] = first[i];
        }

        for (uint j = 0; j < second.length; j++) {
            combination[first.length + j] = second[j];
        }
    }

    /* ========== PUBLIC FUNCTIONS ========== */

    // Note: this function is public not external in order for it to be overridden and invoked via super in subclasses
    function resolverAddressesRequired() public view returns (bytes32[] memory addresses) {}

    function rebuildCache() public {
        bytes32[] memory requiredAddresses = resolverAddressesRequired();
        // The resolver must call this function whenver it updates its state
        for (uint i = 0; i < requiredAddresses.length; i++) {
            bytes32 name = requiredAddresses[i];
            // Note: can only be invoked once the resolver has all the targets needed added
            address destination =
                resolver.requireAndGetAddress(name, string(abi.encodePacked("Resolver missing target: ", name)));
            addressCache[name] = destination;
            emit CacheUpdated(name, destination);
        }
    }

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

    function isResolverCached() external view returns (bool) {
        bytes32[] memory requiredAddresses = resolverAddressesRequired();
        for (uint i = 0; i < requiredAddresses.length; i++) {
            bytes32 name = requiredAddresses[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;
    }

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

    function requireAndGetAddress(bytes32 name) internal view returns (address) {
        address _foundAddress = addressCache[name];
        require(_foundAddress != address(0), string(abi.encodePacked("Missing address: ", name)));
        return _foundAddress;
    }

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

    event CacheUpdated(bytes32 name, address destination);
}


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

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

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

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

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

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

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

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

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

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

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

    function deleteIntValue(bytes32 contractName, bytes32 record) external;

    function deleteAddressValue(bytes32 contractName, bytes32 record) external;

    function deleteBoolValue(bytes32 contractName, bytes32 record) external;

    function deleteBytes32Value(bytes32 contractName, bytes32 record) external;

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

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

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

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

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

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

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

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

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

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


// Internal references


// https://docs.synthetix.io/contracts/source/contracts/mixinsystemsettings
contract MixinSystemSettings is MixinResolver {
    // must match the one defined SystemSettingsLib, defined in both places due to sol v0.5 limitations
    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_ESCROW_DURATION = "liquidationEscrowDuration";
    bytes32 internal constant SETTING_LIQUIDATION_PENALTY = "liquidationPenalty";
    bytes32 internal constant SETTING_SELF_LIQUIDATION_PENALTY = "selfLiquidationPenalty";
    bytes32 internal constant SETTING_FLAG_REWARD = "flagReward";
    bytes32 internal constant SETTING_LIQUIDATE_REWARD = "liquidateReward";
    bytes32 internal constant SETTING_RATE_STALE_PERIOD = "rateStalePeriod";
    /* ========== Exchange Fees Related ========== */
    bytes32 internal constant SETTING_EXCHANGE_FEE_RATE = "exchangeFeeRate";
    bytes32 internal constant SETTING_EXCHANGE_DYNAMIC_FEE_THRESHOLD = "exchangeDynamicFeeThreshold";
    bytes32 internal constant SETTING_EXCHANGE_DYNAMIC_FEE_WEIGHT_DECAY = "exchangeDynamicFeeWeightDecay";
    bytes32 internal constant SETTING_EXCHANGE_DYNAMIC_FEE_ROUNDS = "exchangeDynamicFeeRounds";
    bytes32 internal constant SETTING_EXCHANGE_MAX_DYNAMIC_FEE = "exchangeMaxDynamicFee";
    /* ========== End Exchange Fees Related ========== */
    bytes32 internal constant SETTING_MINIMUM_STAKE_TIME = "minimumStakeTime";
    bytes32 internal constant SETTING_AGGREGATOR_WARNING_FLAGS = "aggregatorWarningFlags";
    bytes32 internal constant SETTING_TRADING_REWARDS_ENABLED = "tradingRewardsEnabled";
    bytes32 internal constant SETTING_DEBT_SNAPSHOT_STALE_TIME = "debtSnapshotStaleTime";
    bytes32 internal constant SETTING_CROSS_DOMAIN_DEPOSIT_GAS_LIMIT = "crossDomainDepositGasLimit";
    bytes32 internal constant SETTING_CROSS_DOMAIN_ESCROW_GAS_LIMIT = "crossDomainEscrowGasLimit";
    bytes32 internal constant SETTING_CROSS_DOMAIN_REWARD_GAS_LIMIT = "crossDomainRewardGasLimit";
    bytes32 internal constant SETTING_CROSS_DOMAIN_WITHDRAWAL_GAS_LIMIT = "crossDomainWithdrawalGasLimit";
    bytes32 internal constant SETTING_CROSS_DOMAIN_FEE_PERIOD_CLOSE_GAS_LIMIT = "crossDomainCloseGasLimit";
    bytes32 internal constant SETTING_CROSS_DOMAIN_RELAY_GAS_LIMIT = "crossDomainRelayGasLimit";
    bytes32 internal constant SETTING_ETHER_WRAPPER_MAX_ETH = "etherWrapperMaxETH";
    bytes32 internal constant SETTING_ETHER_WRAPPER_MINT_FEE_RATE = "etherWrapperMintFeeRate";
    bytes32 internal constant SETTING_ETHER_WRAPPER_BURN_FEE_RATE = "etherWrapperBurnFeeRate";
    bytes32 internal constant SETTING_WRAPPER_MAX_TOKEN_AMOUNT = "wrapperMaxTokens";
    bytes32 internal constant SETTING_WRAPPER_MINT_FEE_RATE = "wrapperMintFeeRate";
    bytes32 internal constant SETTING_WRAPPER_BURN_FEE_RATE = "wrapperBurnFeeRate";
    bytes32 internal constant SETTING_INTERACTION_DELAY = "interactionDelay";
    bytes32 internal constant SETTING_COLLAPSE_FEE_RATE = "collapseFeeRate";
    bytes32 internal constant SETTING_ATOMIC_MAX_VOLUME_PER_BLOCK = "atomicMaxVolumePerBlock";
    bytes32 internal constant SETTING_ATOMIC_TWAP_WINDOW = "atomicTwapWindow";
    bytes32 internal constant SETTING_ATOMIC_EQUIVALENT_FOR_DEX_PRICING = "atomicEquivalentForDexPricing";
    bytes32 internal constant SETTING_ATOMIC_EXCHANGE_FEE_RATE = "atomicExchangeFeeRate";
    bytes32 internal constant SETTING_ATOMIC_VOLATILITY_CONSIDERATION_WINDOW = "atomicVolConsiderationWindow";
    bytes32 internal constant SETTING_ATOMIC_VOLATILITY_UPDATE_THRESHOLD = "atomicVolUpdateThreshold";
    bytes32 internal constant SETTING_PURE_CHAINLINK_PRICE_FOR_ATOMIC_SWAPS_ENABLED = "pureChainlinkForAtomicsEnabled";
    bytes32 internal constant SETTING_CROSS_SYNTH_TRANSFER_ENABLED = "crossChainSynthTransferEnabled";

    bytes32 internal constant CONTRACT_FLEXIBLESTORAGE = "FlexibleStorage";

    enum CrossDomainMessageGasLimits {Deposit, Escrow, Reward, Withdrawal, CloseFeePeriod, Relay}

    struct DynamicFeeConfig {
        uint threshold;
        uint weightDecay;
        uint rounds;
        uint maxFee;
    }

    constructor(address _resolver) internal MixinResolver(_resolver) {}

    function resolverAddressesRequired() public view returns (bytes32[] memory addresses) {
        addresses = new bytes32[](1);
        addresses[0] = CONTRACT_FLEXIBLESTORAGE;
    }

    function flexibleStorage() internal view returns (IFlexibleStorage) {
        return IFlexibleStorage(requireAndGetAddress(CONTRACT_FLEXIBLESTORAGE));
    }

    function _getGasLimitSetting(CrossDomainMessageGasLimits gasLimitType) internal pure returns (bytes32) {
        if (gasLimitType == CrossDomainMessageGasLimits.Deposit) {
            return SETTING_CROSS_DOMAIN_DEPOSIT_GAS_LIMIT;
        } else if (gasLimitType == CrossDomainMessageGasLimits.Escrow) {
            return SETTING_CROSS_DOMAIN_ESCROW_GAS_LIMIT;
        } else if (gasLimitType == CrossDomainMessageGasLimits.Reward) {
            return SETTING_CROSS_DOMAIN_REWARD_GAS_LIMIT;
        } else if (gasLimitType == CrossDomainMessageGasLimits.Withdrawal) {
            return SETTING_CROSS_DOMAIN_WITHDRAWAL_GAS_LIMIT;
        } else if (gasLimitType == CrossDomainMessageGasLimits.Relay) {
            return SETTING_CROSS_DOMAIN_RELAY_GAS_LIMIT;
        } else if (gasLimitType == CrossDomainMessageGasLimits.CloseFeePeriod) {
            return SETTING_CROSS_DOMAIN_FEE_PERIOD_CLOSE_GAS_LIMIT;
        } else {
            revert("Unknown gas limit type");
        }
    }

    function getCrossDomainMessageGasLimit(CrossDomainMessageGasLimits gasLimitType) internal view returns (uint) {
        return flexibleStorage().getUIntValue(SETTING_CONTRACT_NAME, _getGasLimitSetting(gasLimitType));
    }

    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 getLiquidationEscrowDuration() internal view returns (uint) {
        return flexibleStorage().getUIntValue(SETTING_CONTRACT_NAME, SETTING_LIQUIDATION_ESCROW_DURATION);
    }

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

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

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

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

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

    /* ========== Exchange Related Fees ========== */
    function getExchangeFeeRate(bytes32 currencyKey) internal view returns (uint) {
        return
            flexibleStorage().getUIntValue(
                SETTING_CONTRACT_NAME,
                keccak256(abi.encodePacked(SETTING_EXCHANGE_FEE_RATE, currencyKey))
            );
    }

    /// @notice Get exchange dynamic fee related keys
    /// @return threshold, weight decay, rounds, and max fee
    function getExchangeDynamicFeeConfig() internal view returns (DynamicFeeConfig memory) {
        bytes32[] memory keys = new bytes32[](4);
        keys[0] = SETTING_EXCHANGE_DYNAMIC_FEE_THRESHOLD;
        keys[1] = SETTING_EXCHANGE_DYNAMIC_FEE_WEIGHT_DECAY;
        keys[2] = SETTING_EXCHANGE_DYNAMIC_FEE_ROUNDS;
        keys[3] = SETTING_EXCHANGE_MAX_DYNAMIC_FEE;
        uint[] memory values = flexibleStorage().getUIntValues(SETTING_CONTRACT_NAME, keys);
        return DynamicFeeConfig({threshold: values[0], weightDecay: values[1], rounds: values[2], maxFee: values[3]});
    }

    /* ========== End Exchange Related Fees ========== */

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

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

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

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

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

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

    function getWrapperMaxTokenAmount(address wrapper) internal view returns (uint) {
        return
            flexibleStorage().getUIntValue(
                SETTING_CONTRACT_NAME,
                keccak256(abi.encodePacked(SETTING_WRAPPER_MAX_TOKEN_AMOUNT, wrapper))
            );
    }

    function getWrapperMintFeeRate(address wrapper) internal view returns (int) {
        return
            flexibleStorage().getIntValue(
                SETTING_CONTRACT_NAME,
                keccak256(abi.encodePacked(SETTING_WRAPPER_MINT_FEE_RATE, wrapper))
            );
    }

    function getWrapperBurnFeeRate(address wrapper) internal view returns (int) {
        return
            flexibleStorage().getIntValue(
                SETTING_CONTRACT_NAME,
                keccak256(abi.encodePacked(SETTING_WRAPPER_BURN_FEE_RATE, wrapper))
            );
    }

    function getInteractionDelay(address collateral) internal view returns (uint) {
        return
            flexibleStorage().getUIntValue(
                SETTING_CONTRACT_NAME,
                keccak256(abi.encodePacked(SETTING_INTERACTION_DELAY, collateral))
            );
    }

    function getCollapseFeeRate(address collateral) internal view returns (uint) {
        return
            flexibleStorage().getUIntValue(
                SETTING_CONTRACT_NAME,
                keccak256(abi.encodePacked(SETTING_COLLAPSE_FEE_RATE, collateral))
            );
    }

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

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

    function getAtomicEquivalentForDexPricing(bytes32 currencyKey) internal view returns (address) {
        return
            flexibleStorage().getAddressValue(
                SETTING_CONTRACT_NAME,
                keccak256(abi.encodePacked(SETTING_ATOMIC_EQUIVALENT_FOR_DEX_PRICING, currencyKey))
            );
    }

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

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

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

    function getPureChainlinkPriceForAtomicSwapsEnabled(bytes32 currencyKey) internal view returns (bool) {
        return
            flexibleStorage().getBoolValue(
                SETTING_CONTRACT_NAME,
                keccak256(abi.encodePacked(SETTING_PURE_CHAINLINK_PRICE_FOR_ATOMIC_SWAPS_ENABLED, currencyKey))
            );
    }

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


// https://docs.synthetix.io/contracts/source/interfaces/isystemsettings
interface ISystemSettings {
    // Views
    function waitingPeriodSecs() external view returns (uint);

    function priceDeviationThresholdFactor() external view returns (uint);

    function issuanceRatio() external view returns (uint);

    function feePeriodDuration() external view returns (uint);

    function targetThreshold() external view returns (uint);

    function liquidationDelay() external view returns (uint);

    function liquidationRatio() external view returns (uint);

    function liquidationEscrowDuration() external view returns (uint);

    function liquidationPenalty() external view returns (uint);

    function selfLiquidationPenalty() external view returns (uint);

    function flagReward() external view returns (uint);

    function liquidateReward() external view returns (uint);

    function rateStalePeriod() external view returns (uint);

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

    function minimumStakeTime() external view returns (uint);

    function debtSnapshotStaleTime() external view returns (uint);

    function aggregatorWarningFlags() external view returns (address);

    function tradingRewardsEnabled() external view returns (bool);

    function wrapperMaxTokenAmount(address wrapper) external view returns (uint);

    function wrapperMintFeeRate(address wrapper) external view returns (int);

    function wrapperBurnFeeRate(address wrapper) external view returns (int);

    function etherWrapperMaxETH() external view returns (uint);

    function etherWrapperBurnFeeRate() external view returns (uint);

    function etherWrapperMintFeeRate() external view returns (uint);

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

    function atomicMaxVolumePerBlock() external view returns (uint);

    function atomicTwapWindow() external view returns (uint);

    function atomicEquivalentForDexPricing(bytes32 currencyKey) external view returns (address);

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

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

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

    function pureChainlinkPriceForAtomicSwapsEnabled(bytes32 currencyKey) external view returns (bool);
}


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

        return c;
    }

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

        return c;
    }

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

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

        return c;
    }

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

        return c;
    }

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


// Libraries


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

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

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

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

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

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

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

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

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

        return quotientTimesTen / 10;
    }

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

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

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

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

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

        return resultTimesTen / 10;
    }

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

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

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

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

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

        return quotientTimesTen / 10;
    }

    // Computes `a - b`, setting the value to 0 if b > a.
    function floorsub(uint a, uint b) internal pure returns (uint) {
        return b >= a ? 0 : a - b;
    }

    /* ---------- Utilities ---------- */
    /*
     * Absolute value of the input, returned as a signed number.
     */
    function signedAbs(int x) internal pure returns (int) {
        return x < 0 ? -x : x;
    }

    /*
     * Absolute value of the input, returned as an unsigned number.
     */
    function abs(int x) internal pure returns (uint) {
        return uint(signedAbs(x));
    }
}


// Internal references


// Libraries


/// This library is to reduce SystemSettings contract size only and is not really
/// a proper library - so it shares knowledge of implementation details
/// Some of the setters were refactored into this library, and some setters remain in the
/// contract itself (SystemSettings)
library SystemSettingsLib {
    using SafeMath for uint;
    using SafeDecimalMath for uint;

    bytes32 public constant SETTINGS_CONTRACT_NAME = "SystemSettings";

    // No more synths may be issued than the value of SNX backing them.
    uint public constant MAX_ISSUANCE_RATIO = 1e18;

    // The fee period must be between 1 day and 60 days.
    uint public constant MIN_FEE_PERIOD_DURATION = 1 days;
    uint public constant MAX_FEE_PERIOD_DURATION = 60 days;

    uint public constant MAX_TARGET_THRESHOLD = 50;

    uint public constant MAX_LIQUIDATION_RATIO = 1e18; // 100% issuance ratio
    uint public constant RATIO_FROM_TARGET_BUFFER = 2e18; // 200% - mininimum buffer between issuance ratio and liquidation ratio

    uint public constant MAX_LIQUIDATION_PENALTY = 3e18 / 10; // Max 30% liquidation penalty / bonus

    uint public constant MAX_LIQUIDATION_DELAY = 3 days;
    uint public constant MIN_LIQUIDATION_DELAY = 300; // 5 min

    // Exchange fee may not exceed 10%.
    uint public constant MAX_EXCHANGE_FEE_RATE = 1e18 / 10;

    // Minimum Stake time may not exceed 1 weeks.
    uint public constant MAX_MINIMUM_STAKE_TIME = 1 weeks;

    uint public constant MAX_CROSS_DOMAIN_GAS_LIMIT = 12e6;
    uint public constant MIN_CROSS_DOMAIN_GAS_LIMIT = 3e6;

    int public constant MAX_WRAPPER_MINT_FEE_RATE = 1e18;

    int public constant MAX_WRAPPER_BURN_FEE_RATE = 1e18;

    // Atomic block volume limit is encoded as uint192.
    uint public constant MAX_ATOMIC_VOLUME_PER_BLOCK = uint192(-1);

    // TWAP window must be between 1 min and 1 day.
    uint public constant MIN_ATOMIC_TWAP_WINDOW = 60;
    uint public constant MAX_ATOMIC_TWAP_WINDOW = 86400;

    // Volatility consideration window must be between 1 min and 1 day.
    uint public constant MIN_ATOMIC_VOLATILITY_CONSIDERATION_WINDOW = 60;
    uint public constant MAX_ATOMIC_VOLATILITY_CONSIDERATION_WINDOW = 86400;

    // workaround for library not supporting public constants in sol v0.5
    function contractName() external view returns (bytes32) {
        return SETTINGS_CONTRACT_NAME;
    }

    function setCrossDomainMessageGasLimit(
        IFlexibleStorage flexibleStorage,
        bytes32 gasLimitSettings,
        uint crossDomainMessageGasLimit
    ) external {
        require(
            crossDomainMessageGasLimit >= MIN_CROSS_DOMAIN_GAS_LIMIT &&
                crossDomainMessageGasLimit <= MAX_CROSS_DOMAIN_GAS_LIMIT,
            "Out of range xDomain gasLimit"
        );
        flexibleStorage.setUIntValue(SETTINGS_CONTRACT_NAME, gasLimitSettings, crossDomainMessageGasLimit);
    }

    function setIssuanceRatio(
        IFlexibleStorage flexibleStorage,
        bytes32 settingName,
        uint ratio
    ) external {
        require(ratio <= MAX_ISSUANCE_RATIO, "New issuance ratio cannot exceed MAX_ISSUANCE_RATIO");
        flexibleStorage.setUIntValue(SETTINGS_CONTRACT_NAME, settingName, ratio);
    }

    function setTradingRewardsEnabled(
        IFlexibleStorage flexibleStorage,
        bytes32 settingName,
        bool _tradingRewardsEnabled
    ) external {
        flexibleStorage.setBoolValue(SETTINGS_CONTRACT_NAME, settingName, _tradingRewardsEnabled);
    }

    function setWaitingPeriodSecs(
        IFlexibleStorage flexibleStorage,
        bytes32 settingName,
        uint _waitingPeriodSecs
    ) external {
        flexibleStorage.setUIntValue(SETTINGS_CONTRACT_NAME, settingName, _waitingPeriodSecs);
    }

    function setPriceDeviationThresholdFactor(
        IFlexibleStorage flexibleStorage,
        bytes32 settingName,
        uint _priceDeviationThresholdFactor
    ) external {
        flexibleStorage.setUIntValue(SETTINGS_CONTRACT_NAME, settingName, _priceDeviationThresholdFactor);
    }

    function setFeePeriodDuration(
        IFlexibleStorage flexibleStorage,
        bytes32 settingName,
        uint _feePeriodDuration
    ) external {
        require(_feePeriodDuration >= MIN_FEE_PERIOD_DURATION, "value < MIN_FEE_PERIOD_DURATION");
        require(_feePeriodDuration <= MAX_FEE_PERIOD_DURATION, "value > MAX_FEE_PERIOD_DURATION");

        flexibleStorage.setUIntValue(SETTINGS_CONTRACT_NAME, settingName, _feePeriodDuration);
    }

    function setTargetThreshold(
        IFlexibleStorage flexibleStorage,
        bytes32 settingName,
        uint percent
    ) external returns (uint threshold) {
        require(percent <= MAX_TARGET_THRESHOLD, "Threshold too high");
        threshold = percent.mul(SafeDecimalMath.unit()).div(100);

        flexibleStorage.setUIntValue(SETTINGS_CONTRACT_NAME, settingName, threshold);
    }

    function setLiquidationDelay(
        IFlexibleStorage flexibleStorage,
        bytes32 settingName,
        uint time
    ) external {
        require(time <= MAX_LIQUIDATION_DELAY, "Must be less than MAX_LIQUIDATION_DELAY");
        require(time >= MIN_LIQUIDATION_DELAY, "Must be greater than MIN_LIQUIDATION_DELAY");

        flexibleStorage.setUIntValue(SETTINGS_CONTRACT_NAME, settingName, time);
    }

    function setLiquidationRatio(
        IFlexibleStorage flexibleStorage,
        bytes32 settingName,
        uint _liquidationRatio,
        uint getLiquidationPenalty,
        uint getIssuanceRatio
    ) external {
        require(
            _liquidationRatio <= MAX_LIQUIDATION_RATIO.divideDecimal(SafeDecimalMath.unit().add(getLiquidationPenalty)),
            "liquidationRatio > MAX_LIQUIDATION_RATIO / (1 + penalty)"
        );

        // MIN_LIQUIDATION_RATIO is a product of target issuance ratio * RATIO_FROM_TARGET_BUFFER
        // Ensures that liquidation ratio is set so that there is a buffer between the issuance ratio and liquidation ratio.
        uint MIN_LIQUIDATION_RATIO = getIssuanceRatio.multiplyDecimal(RATIO_FROM_TARGET_BUFFER);
        require(_liquidationRatio >= MIN_LIQUIDATION_RATIO, "liquidationRatio < MIN_LIQUIDATION_RATIO");

        flexibleStorage.setUIntValue(SETTINGS_CONTRACT_NAME, settingName, _liquidationRatio);
    }

    function setLiquidationEscrowDuration(
        IFlexibleStorage flexibleStorage,
        bytes32 settingName,
        uint duration
    ) external {
        flexibleStorage.setUIntValue(SETTINGS_CONTRACT_NAME, settingName, duration);
    }

    function setLiquidationPenalty(
        IFlexibleStorage flexibleStorage,
        bytes32 settingName,
        uint penalty
    ) external {
        require(penalty <= MAX_LIQUIDATION_PENALTY, "penalty > MAX_LIQUIDATION_PENALTY");

        flexibleStorage.setUIntValue(SETTINGS_CONTRACT_NAME, settingName, penalty);
    }

    function setSelfLiquidationPenalty(
        IFlexibleStorage flexibleStorage,
        bytes32 settingName,
        uint penalty
    ) external {
        require(penalty <= MAX_LIQUIDATION_PENALTY, "penalty > MAX_LIQUIDATION_PENALTY");

        flexibleStorage.setUIntValue(SETTINGS_CONTRACT_NAME, settingName, penalty);
    }

    function setFlagReward(
        IFlexibleStorage flexibleStorage,
        bytes32 settingName,
        uint reward
    ) external {
        flexibleStorage.setUIntValue(SETTINGS_CONTRACT_NAME, settingName, reward);
    }

    function setLiquidateReward(
        IFlexibleStorage flexibleStorage,
        bytes32 settingName,
        uint reward
    ) external {
        flexibleStorage.setUIntValue(SETTINGS_CONTRACT_NAME, settingName, reward);
    }

    function setRateStalePeriod(
        IFlexibleStorage flexibleStorage,
        bytes32 settingName,
        uint period
    ) external {
        flexibleStorage.setUIntValue(SETTINGS_CONTRACT_NAME, settingName, period);
    }

    function setExchangeFeeRateForSynths(
        IFlexibleStorage flexibleStorage,
        bytes32 settingExchangeFeeRate,
        bytes32[] calldata synthKeys,
        uint256[] calldata exchangeFeeRates
    ) external {
        require(synthKeys.length == exchangeFeeRates.length, "Array lengths dont match");
        for (uint i = 0; i < synthKeys.length; i++) {
            require(exchangeFeeRates[i] <= MAX_EXCHANGE_FEE_RATE, "MAX_EXCHANGE_FEE_RATE exceeded");
            flexibleStorage.setUIntValue(
                SETTINGS_CONTRACT_NAME,
                keccak256(abi.encodePacked(settingExchangeFeeRate, synthKeys[i])),
                exchangeFeeRates[i]
            );
        }
    }

    function setMinimumStakeTime(
        IFlexibleStorage flexibleStorage,
        bytes32 settingName,
        uint _seconds
    ) external {
        require(_seconds <= MAX_MINIMUM_STAKE_TIME, "stake time exceed maximum 1 week");
        flexibleStorage.setUIntValue(SETTINGS_CONTRACT_NAME, settingName, _seconds);
    }

    function setDebtSnapshotStaleTime(
        IFlexibleStorage flexibleStorage,
        bytes32 settingName,
        uint _seconds
    ) external {
        flexibleStorage.setUIntValue(SETTINGS_CONTRACT_NAME, settingName, _seconds);
    }

    function setAggregatorWarningFlags(
        IFlexibleStorage flexibleStorage,
        bytes32 settingName,
        address _flags
    ) external {
        require(_flags != address(0), "Valid address must be given");
        flexibleStorage.setAddressValue(SETTINGS_CONTRACT_NAME, settingName, _flags);
    }

    function setEtherWrapperMaxETH(
        IFlexibleStorage flexibleStorage,
        bytes32 settingName,
        uint _maxETH
    ) external {
        flexibleStorage.setUIntValue(SETTINGS_CONTRACT_NAME, settingName, _maxETH);
    }

    function setEtherWrapperMintFeeRate(
        IFlexibleStorage flexibleStorage,
        bytes32 settingName,
        uint _rate
    ) external {
        require(_rate <= uint(MAX_WRAPPER_MINT_FEE_RATE), "rate > MAX_WRAPPER_MINT_FEE_RATE");
        flexibleStorage.setUIntValue(SETTINGS_CONTRACT_NAME, settingName, _rate);
    }

    function setEtherWrapperBurnFeeRate(
        IFlexibleStorage flexibleStorage,
        bytes32 settingName,
        uint _rate
    ) external {
        require(_rate <= uint(MAX_WRAPPER_BURN_FEE_RATE), "rate > MAX_WRAPPER_BURN_FEE_RATE");
        flexibleStorage.setUIntValue(SETTINGS_CONTRACT_NAME, settingName, _rate);
    }

    function setWrapperMaxTokenAmount(
        IFlexibleStorage flexibleStorage,
        bytes32 settingName,
        address _wrapper,
        uint _maxTokenAmount
    ) external {
        flexibleStorage.setUIntValue(
            SETTINGS_CONTRACT_NAME,
            keccak256(abi.encodePacked(settingName, _wrapper)),
            _maxTokenAmount
        );
    }

    function setWrapperMintFeeRate(
        IFlexibleStorage flexibleStorage,
        bytes32 settingName,
        address _wrapper,
        int _rate,
        int getWrapperBurnFeeRate
    ) external {
        require(_rate <= MAX_WRAPPER_MINT_FEE_RATE, "rate > MAX_WRAPPER_MINT_FEE_RATE");
        require(_rate >= -MAX_WRAPPER_MINT_FEE_RATE, "rate < -MAX_WRAPPER_MINT_FEE_RATE");

        // if mint rate is negative, burn fee rate should be positive and at least equal in magnitude
        // otherwise risk of flash loan attack
        if (_rate < 0) {
            require(-_rate <= getWrapperBurnFeeRate, "-rate > wrapperBurnFeeRate");
        }

        flexibleStorage.setIntValue(SETTINGS_CONTRACT_NAME, keccak256(abi.encodePacked(settingName, _wrapper)), _rate);
    }

    function setWrapperBurnFeeRate(
        IFlexibleStorage flexibleStorage,
        bytes32 settingName,
        address _wrapper,
        int _rate,
        int getWrapperMintFeeRate
    ) external {
        require(_rate <= MAX_WRAPPER_BURN_FEE_RATE, "rate > MAX_WRAPPER_BURN_FEE_RATE");
        require(_rate >= -MAX_WRAPPER_BURN_FEE_RATE, "rate < -MAX_WRAPPER_BURN_FEE_RATE");

        // if burn rate is negative, burn fee rate should be negative and at least equal in magnitude
        // otherwise risk of flash loan attack
        if (_rate < 0) {
            require(-_rate <= getWrapperMintFeeRate, "-rate > wrapperMintFeeRate");
        }

        flexibleStorage.setIntValue(SETTINGS_CONTRACT_NAME, keccak256(abi.encodePacked(settingName, _wrapper)), _rate);
    }

    function setInteractionDelay(
        IFlexibleStorage flexibleStorage,
        bytes32 settingName,
        address _collateral,
        uint _interactionDelay
    ) external {
        require(_interactionDelay <= SafeDecimalMath.unit() * 3600, "Max 1 hour");
        flexibleStorage.setUIntValue(
            SETTINGS_CONTRACT_NAME,
            keccak256(abi.encodePacked(settingName, _collateral)),
            _interactionDelay
        );
    }

    function setCollapseFeeRate(
        IFlexibleStorage flexibleStorage,
        bytes32 settingName,
        address _collateral,
        uint _collapseFeeRate
    ) external {
        flexibleStorage.setUIntValue(
            SETTINGS_CONTRACT_NAME,
            keccak256(abi.encodePacked(settingName, _collateral)),
            _collapseFeeRate
        );
    }

    function setAtomicMaxVolumePerBlock(
        IFlexibleStorage flexibleStorage,
        bytes32 settingName,
        uint _maxVolume
    ) external {
        require(_maxVolume <= MAX_ATOMIC_VOLUME_PER_BLOCK, "Atomic max volume exceed maximum uint192");
        flexibleStorage.setUIntValue(SETTINGS_CONTRACT_NAME, settingName, _maxVolume);
    }

    function setAtomicTwapWindow(
        IFlexibleStorage flexibleStorage,
        bytes32 settingName,
        uint _window
    ) external {
        require(_window >= MIN_ATOMIC_TWAP_WINDOW, "Atomic twap window under minimum 1 min");
        require(_window <= MAX_ATOMIC_TWAP_WINDOW, "Atomic twap window exceed maximum 1 day");
        flexibleStorage.setUIntValue(SETTINGS_CONTRACT_NAME, settingName, _window);
    }

    function setAtomicEquivalentForDexPricing(
        IFlexibleStorage flexibleStorage,
        bytes32 settingName,
        bytes32 _currencyKey,
        address _equivalent
    ) external {
        require(_equivalent != address(0), "Atomic equivalent is 0 address");
        flexibleStorage.setAddressValue(
            SETTINGS_CONTRACT_NAME,
            keccak256(abi.encodePacked(settingName, _currencyKey)),
            _equivalent
        );
    }

    function setAtomicExchangeFeeRate(
        IFlexibleStorage flexibleStorage,
        bytes32 settingName,
        bytes32 _currencyKey,
        uint _exchangeFeeRate
    ) external {
        require(_exchangeFeeRate <= MAX_EXCHANGE_FEE_RATE, "MAX_EXCHANGE_FEE_RATE exceeded");
        flexibleStorage.setUIntValue(
            SETTINGS_CONTRACT_NAME,
            keccak256(abi.encodePacked(settingName, _currencyKey)),
            _exchangeFeeRate
        );
    }

    function setAtomicVolatilityConsiderationWindow(
        IFlexibleStorage flexibleStorage,
        bytes32 settingName,
        bytes32 _currencyKey,
        uint _window
    ) external {
        if (_window != 0) {
            require(
                _window >= MIN_ATOMIC_VOLATILITY_CONSIDERATION_WINDOW,
                "Atomic volatility consideration window under minimum 1 min"
            );
            require(
                _window <= MAX_ATOMIC_VOLATILITY_CONSIDERATION_WINDOW,
                "Atomic volatility consideration window exceed maximum 1 day"
            );
        }
        flexibleStorage.setUIntValue(
            SETTINGS_CONTRACT_NAME,
            keccak256(abi.encodePacked(settingName, _currencyKey)),
            _window
        );
    }

    function setAtomicVolatilityUpdateThreshold(
        IFlexibleStorage flexibleStorage,
        bytes32 settingName,
        bytes32 _currencyKey,
        uint _threshold
    ) external {
        flexibleStorage.setUIntValue(
            SETTINGS_CONTRACT_NAME,
            keccak256(abi.encodePacked(settingName, _currencyKey)),
            _threshold
        );
    }

    function setPureChainlinkPriceForAtomicSwapsEnabled(
        IFlexibleStorage flexibleStorage,
        bytes32 settingName,
        bytes32 _currencyKey,
        bool _enabled
    ) external {
        flexibleStorage.setBoolValue(
            SETTINGS_CONTRACT_NAME,
            keccak256(abi.encodePacked(settingName, _currencyKey)),
            _enabled
        );
    }

    function setCrossChainSynthTransferEnabled(
        IFlexibleStorage flexibleStorage,
        bytes32 settingName,
        bytes32 _currencyKey,
        uint _value
    ) external {
        flexibleStorage.setUIntValue(SETTINGS_CONTRACT_NAME, keccak256(abi.encodePacked(settingName, _currencyKey)), _value);
    }

    function setExchangeMaxDynamicFee(
        IFlexibleStorage flexibleStorage,
        bytes32 settingName,
        uint maxFee
    ) external {
        require(maxFee != 0, "Max dynamic fee cannot be 0");
        require(maxFee <= MAX_EXCHANGE_FEE_RATE, "MAX_EXCHANGE_FEE_RATE exceeded");

        flexibleStorage.setUIntValue(SETTINGS_CONTRACT_NAME, settingName, maxFee);
    }
}


// Inheritance


// https://docs.synthetix.io/contracts/source/contracts/systemsettings
contract SystemSettings is Owned, MixinSystemSettings, ISystemSettings {
    // SystemSettingsLib is a way to split out the setters to reduce contract size
    using SystemSettingsLib for IFlexibleStorage;

    constructor(address _owner, address _resolver) public Owned(_owner) MixinSystemSettings(_resolver) {
        // SETTING_CONTRACT_NAME is defined for the getters in MixinSystemSettings and
        // SystemSettingsLib.contractName() is a view into SystemSettingsLib of the contract name
        // that's used by the setters. They have to be equal.
        require(SETTING_CONTRACT_NAME == SystemSettingsLib.contractName(), "read and write keys not equal");
    }

    // ========== VIEWS ==========

    // backwards compatibility to having CONTRACT_NAME public constant
    // solhint-disable-next-line func-name-mixedcase
    function CONTRACT_NAME() external view returns (bytes32) {
        return SystemSettingsLib.contractName();
    }

    // SIP-37 Fee Reclamation
    // The number of seconds after an exchange is executed that must be waited
    // before settlement.
    function waitingPeriodSecs() external view returns (uint) {
        return getWaitingPeriodSecs();
    }

    // SIP-65 Decentralized Circuit Breaker
    // The factor amount expressed in decimal format
    // E.g. 3e18 = factor 3, meaning movement up to 3x and above or down to 1/3x and below
    function priceDeviationThresholdFactor() external view returns (uint) {
        return getPriceDeviationThresholdFactor();
    }

    // The raio of collateral
    // Expressed in 18 decimals. So 800% cratio is 100/800 = 0.125 (0.125e18)
    function issuanceRatio() external view returns (uint) {
        return getIssuanceRatio();
    }

    // How long a fee period lasts at a minimum. It is required for
    // anyone to roll over the periods, so they are not guaranteed
    // to roll over at exactly this duration, but the contract enforces
    // that they cannot roll over any quicker than this duration.
    function feePeriodDuration() external view returns (uint) {
        return getFeePeriodDuration();
    }

    // Users are unable to claim fees if their collateralisation ratio drifts out of target threshold
    function targetThreshold() external view returns (uint) {
        return getTargetThreshold();
    }

    // SIP-15 Liquidations
    // liquidation time delay after address flagged (seconds)
    function liquidationDelay() external view returns (uint) {
        return getLiquidationDelay();
    }

    // SIP-15 Liquidations
    // issuance ratio when account can be flagged for liquidation (with 18 decimals), e.g 0.5 issuance ratio
    // when flag means 1/0.5 = 200% cratio
    function liquidationRatio() external view returns (uint) {
        return getLiquidationRatio();
    }

    // SIP-15 Liquidations
    // penalty taken away from target of liquidation (with 18 decimals). E.g. 10% is 0.1e18
    function liquidationPenalty() external view returns (uint) {
        return getLiquidationPenalty();
    }

    /* ========== SIP-148: Upgrade Liquidation Mechanism ========== */

    /// @notice Get the escrow duration for liquidation rewards
    /// @return The escrow duration for liquidation rewards
    function liquidationEscrowDuration() external view returns (uint) {
        return getLiquidationEscrowDuration();
    }

    /// @notice Get the penalty for self liquidation
    /// @return The self liquidation penalty
    function selfLiquidationPenalty() external view returns (uint) {
        return getSelfLiquidationPenalty();
    }

    /// @notice Get the reward for flagging an account for liquidation
    /// @return The reward for flagging an account
    function flagReward() external view returns (uint) {
        return getFlagReward();
    }

    /// @notice Get the reward for liquidating an account
    /// @return The reward for performing a forced liquidation
    function liquidateReward() external view returns (uint) {
        return getLiquidateReward();
    }

    /* ========== End SIP-148 ========== */

    // How long will the ExchangeRates contract assume the rate of any asset is correct
    function rateStalePeriod() external view returns (uint) {
        return getRateStalePeriod();
    }

    /* ========== Exchange Related Fees ========== */
    function exchangeFeeRate(bytes32 currencyKey) external view returns (uint) {
        return getExchangeFeeRate(currencyKey);
    }

    // SIP-184 Dynamic Fee
    /// @notice Get the dynamic fee threshold
    /// @return The dynamic fee threshold
    function exchangeDynamicFeeThreshold() external view returns (uint) {
        return getExchangeDynamicFeeConfig().threshold;
    }

    /// @notice Get the dynamic fee weight decay per round
    /// @return The dynamic fee weight decay per round
    function exchangeDynamicFeeWeightDecay() external view returns (uint) {
        return getExchangeDynamicFeeConfig().weightDecay;
    }

    /// @notice Get the dynamic fee total rounds for calculation
    /// @return The dynamic fee total rounds for calculation
    function exchangeDynamicFeeRounds() external view returns (uint) {
        return getExchangeDynamicFeeConfig().rounds;
    }

    /// @notice Get the max dynamic fee
    /// @return The max dynamic fee
    function exchangeMaxDynamicFee() external view returns (uint) {
        return getExchangeDynamicFeeConfig().maxFee;
    }

    /* ========== End Exchange Related Fees ========== */

    function minimumStakeTime() external view returns (uint) {
        return getMinimumStakeTime();
    }

    function debtSnapshotStaleTime() external view returns (uint) {
        return getDebtSnapshotStaleTime();
    }

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

    // SIP-63 Trading incentives
    // determines if Exchanger records fee entries in TradingRewards
    function tradingRewardsEnabled() external view returns (bool) {
        return getTradingRewardsEnabled();
    }

    function crossDomainMessageGasLimit(CrossDomainMessageGasLimits gasLimitType) external view returns (uint) {
        return getCrossDomainMessageGasLimit(gasLimitType);
    }

    // SIP 112: ETH Wrappr
    // The maximum amount of ETH held by the EtherWrapper.
    function etherWrapperMaxETH() external view returns (uint) {
        return getEtherWrapperMaxETH();
    }

    // SIP 112: ETH Wrappr
    // The fee for depositing ETH into the EtherWrapper.
    function etherWrapperMintFeeRate() external view returns (uint) {
        return getEtherWrapperMintFeeRate();
    }

    // SIP 112: ETH Wrappr
    // The fee for burning sETH and releasing ETH from the EtherWrapper.
    function etherWrapperBurnFeeRate() external view returns (uint) {
        return getEtherWrapperBurnFeeRate();
    }

    // SIP 182: Wrapper Factory
    // The maximum amount of token held by the Wrapper.
    function wrapperMaxTokenAmount(address wrapper) external view returns (uint) {
        return getWrapperMaxTokenAmount(wrapper);
    }

    // SIP 182: Wrapper Factory
    // The fee for depositing token into the Wrapper.
    function wrapperMintFeeRate(address wrapper) external view returns (int) {
        return getWrapperMintFeeRate(wrapper);
    }

    // SIP 182: Wrapper Factory
    // The fee for burning synth and releasing token from the Wrapper.
    function wrapperBurnFeeRate(address wrapper) external view returns (int) {
        return getWrapperBurnFeeRate(wrapper);
    }

    function interactionDelay(address collateral) external view returns (uint) {
        return getInteractionDelay(collateral);
    }

    function collapseFeeRate(address collateral) external view returns (uint) {
        return getCollapseFeeRate(collateral);
    }

    // SIP-120 Atomic exchanges
    // max allowed volume per block for atomic exchanges
    function atomicMaxVolumePerBlock() external view returns (uint) {
        return getAtomicMaxVolumePerBlock();
    }

    // SIP-120 Atomic exchanges
    // time window (in seconds) for TWAP prices when considered for atomic exchanges
    function atomicTwapWindow() external view returns (uint) {
        return getAtomicTwapWindow();
    }

    // SIP-120 Atomic exchanges
    // equivalent asset to use for a synth when considering external prices for atomic exchanges
    function atomicEquivalentForDexPricing(bytes32 currencyKey) external view returns (address) {
        return getAtomicEquivalentForDexPricing(currencyKey);
    }

    // SIP-120 Atomic exchanges
    // fee rate override for atomic exchanges into a synth
    function atomicExchangeFeeRate(bytes32 currencyKey) external view returns (uint) {
        return getAtomicExchangeFeeRate(currencyKey);
    }

    // SIP-120 Atomic exchanges
    // consideration window for determining synth volatility
    function atomicVolatilityConsiderationWindow(bytes32 currencyKey) external view returns (uint) {
        return getAtomicVolatilityConsiderationWindow(currencyKey);
    }

    // SIP-120 Atomic exchanges
    // update threshold for determining synth volatility
    function atomicVolatilityUpdateThreshold(bytes32 currencyKey) external view returns (uint) {
        return getAtomicVolatilityUpdateThreshold(currencyKey);
    }

    // SIP-198: Atomic Exchange At Pure Chainlink Price
    // Whether to use the pure Chainlink price for a given currency key
    function pureChainlinkPriceForAtomicSwapsEnabled(bytes32 currencyKey) external view returns (bool) {
        return getPureChainlinkPriceForAtomicSwapsEnabled(currencyKey);
    }

    // SIP-229 Atomic exchanges
    // enable/disable sending of synths cross chain
    function crossChainSynthTransferEnabled(bytes32 currencyKey) external view returns (uint) {
        return getCrossChainSynthTransferEnabled(currencyKey);
    }

    // ========== RESTRICTED ==========

    function setCrossDomainMessageGasLimit(CrossDomainMessageGasLimits _gasLimitType, uint _crossDomainMessageGasLimit)
        external
        onlyOwner
    {
        flexibleStorage().setCrossDomainMessageGasLimit(_getGasLimitSetting(_gasLimitType), _crossDomainMessageGasLimit);
        emit CrossDomainMessageGasLimitChanged(_gasLimitType, _crossDomainMessageGasLimit);
    }

    function setIssuanceRatio(uint ratio) external onlyOwner {
        flexibleStorage().setIssuanceRatio(SETTING_ISSUANCE_RATIO, ratio);
        emit IssuanceRatioUpdated(ratio);
    }

    function setTradingRewardsEnabled(bool _tradingRewardsEnabled) external onlyOwner {
        flexibleStorage().setTradingRewardsEnabled(SETTING_TRADING_REWARDS_ENABLED, _tradingRewardsEnabled);
        emit TradingRewardsEnabled(_tradingRewardsEnabled);
    }

    function setWaitingPeriodSecs(uint _waitingPeriodSecs) external onlyOwner {
        flexibleStorage().setWaitingPeriodSecs(SETTING_WAITING_PERIOD_SECS, _waitingPeriodSecs);
        emit WaitingPeriodSecsUpdated(_waitingPeriodSecs);
    }

    function setPriceDeviationThresholdFactor(uint _priceDeviationThresholdFactor) external onlyOwner {
        flexibleStorage().setPriceDeviationThresholdFactor(
            SETTING_PRICE_DEVIATION_THRESHOLD_FACTOR,
            _priceDeviationThresholdFactor
        );
        emit PriceDeviationThresholdUpdated(_priceDeviationThresholdFactor);
    }

    function setFeePeriodDuration(uint _feePeriodDuration) external onlyOwner {
        flexibleStorage().setFeePeriodDuration(SETTING_FEE_PERIOD_DURATION, _feePeriodDuration);
        emit FeePeriodDurationUpdated(_feePeriodDuration);
    }

    function setTargetThreshold(uint percent) external onlyOwner {
        uint threshold = flexibleStorage().setTargetThreshold(SETTING_TARGET_THRESHOLD, percent);
        emit TargetThresholdUpdated(threshold);
    }

    function setLiquidationDelay(uint time) external onlyOwner {
        flexibleStorage().setLiquidationDelay(SETTING_LIQUIDATION_DELAY, time);
        emit LiquidationDelayUpdated(time);
    }

    // The collateral / issuance ratio ( debt / collateral ) is higher when there is less collateral backing their debt
    // Upper bound liquidationRatio is 1 + penalty (100% + 10% = 110%) to allow collateral value to cover debt and liquidation penalty
    function setLiquidationRatio(uint _liquidationRatio) external onlyOwner {
        flexibleStorage().setLiquidationRatio(
            SETTING_LIQUIDATION_RATIO,
            _liquidationRatio,
            getLiquidationPenalty(),
            getIssuanceRatio()
        );
        emit LiquidationRatioUpdated(_liquidationRatio);
    }

    function setLiquidationEscrowDuration(uint duration) external onlyOwner {
        flexibleStorage().setUIntValue(SETTING_CONTRACT_NAME, SETTING_LIQUIDATION_ESCROW_DURATION, duration);
        emit LiquidationEscrowDurationUpdated(duration);
    }

    function setLiquidationPenalty(uint penalty) external onlyOwner {
        flexibleStorage().setLiquidationPenalty(SETTING_LIQUIDATION_PENALTY, penalty);
        emit LiquidationPenaltyUpdated(penalty);
    }

    function setSelfLiquidationPenalty(uint penalty) external onlyOwner {
        flexibleStorage().setSelfLiquidationPenalty(SETTING_SELF_LIQUIDATION_PENALTY, penalty);
        emit SelfLiquidationPenaltyUpdated(penalty);
    }

    function setFlagReward(uint reward) external onlyOwner {
        flexibleStorage().setUIntValue(SETTING_CONTRACT_NAME, SETTING_FLAG_REWARD, reward);
        emit FlagRewardUpdated(reward);
    }

    function setLiquidateReward(uint reward) external onlyOwner {
        flexibleStorage().setUIntValue(SETTING_CONTRACT_NAME, SETTING_LIQUIDATE_REWARD, reward);
        emit LiquidateRewardUpdated(reward);
    }

    function setRateStalePeriod(uint period) external onlyOwner {
        flexibleStorage().setRateStalePeriod(SETTING_RATE_STALE_PERIOD, period);
        emit RateStalePeriodUpdated(period);
    }

    /* ========== Exchange Fees Related ========== */
    function setExchangeFeeRateForSynths(bytes32[] calldata synthKeys, uint256[] calldata exchangeFeeRates)
        external
        onlyOwner
    {
        flexibleStorage().setExchangeFeeRateForSynths(SETTING_EXCHANGE_FEE_RATE, synthKeys, exchangeFeeRates);
        for (uint i = 0; i < synthKeys.length; i++) {
            emit ExchangeFeeUpdated(synthKeys[i], exchangeFeeRates[i]);
        }
    }

    /// @notice Set exchange dynamic fee threshold constant in decimal ratio
    /// @param threshold The exchange dynamic fee threshold
    /// @return uint threshold constant
    function setExchangeDynamicFeeThreshold(uint threshold) external onlyOwner {
        require(threshold != 0, "Threshold cannot be 0");

        flexibleStorage().setUIntValue(SETTING_CONTRACT_NAME, SETTING_EXCHANGE_DYNAMIC_FEE_THRESHOLD, threshold);

        emit ExchangeDynamicFeeThresholdUpdated(threshold);
    }

    /// @notice Set exchange dynamic fee weight decay constant
    /// @param weightDecay The exchange dynamic fee weight decay
    /// @return uint weight decay constant
    function setExchangeDynamicFeeWeightDecay(uint weightDecay) external onlyOwner {
        require(weightDecay != 0, "Weight decay cannot be 0");

        flexibleStorage().setUIntValue(SETTING_CONTRACT_NAME, SETTING_EXCHANGE_DYNAMIC_FEE_WEIGHT_DECAY, weightDecay);

        emit ExchangeDynamicFeeWeightDecayUpdated(weightDecay);
    }

    /// @notice Set exchange dynamic fee last N rounds with minimum 2 rounds
    /// @param rounds The exchange dynamic fee last N rounds
    /// @return uint dynamic fee last N rounds
    function setExchangeDynamicFeeRounds(uint rounds) external onlyOwner {
        flexibleStorage().setUIntValue(SETTING_CONTRACT_NAME, SETTING_EXCHANGE_DYNAMIC_FEE_ROUNDS, rounds);

        emit ExchangeDynamicFeeRoundsUpdated(rounds);
    }

    /// @notice Set max exchange dynamic fee
    /// @param maxFee The max exchange dynamic fee
    /// @return uint dynamic fee last N rounds
    function setExchangeMaxDynamicFee(uint maxFee) external onlyOwner {
        flexibleStorage().setExchangeMaxDynamicFee(SETTING_EXCHANGE_MAX_DYNAMIC_FEE, maxFee);
        emit ExchangeMaxDynamicFeeUpdated(maxFee);
    }

    function setMinimumStakeTime(uint _seconds) external onlyOwner {
        flexibleStorage().setMinimumStakeTime(SETTING_MINIMUM_STAKE_TIME, _seconds);
        emit MinimumStakeTimeUpdated(_seconds);
    }

    function setDebtSnapshotStaleTime(uint _seconds) external onlyOwner {
        flexibleStorage().setDebtSnapshotStaleTime(SETTING_DEBT_SNAPSHOT_STALE_TIME, _seconds);
        emit DebtSnapshotStaleTimeUpdated(_seconds);
    }

    function setAggregatorWarningFlags(address _flags) external onlyOwner {
        flexibleStorage().setAggregatorWarningFlags(SETTING_AGGREGATOR_WARNING_FLAGS, _flags);
        emit AggregatorWarningFlagsUpdated(_flags);
    }

    function setEtherWrapperMaxETH(uint _maxETH) external onlyOwner {
        flexibleStorage().setEtherWrapperMaxETH(SETTING_ETHER_WRAPPER_MAX_ETH, _maxETH);
        emit EtherWrapperMaxETHUpdated(_maxETH);
    }

    function setEtherWrapperMintFeeRate(uint _rate) external onlyOwner {
        flexibleStorage().setEtherWrapperMintFeeRate(SETTING_ETHER_WRAPPER_MINT_FEE_RATE, _rate);
        emit EtherWrapperMintFeeRateUpdated(_rate);
    }

    function setEtherWrapperBurnFeeRate(uint _rate) external onlyOwner {
        flexibleStorage().setEtherWrapperBurnFeeRate(SETTING_ETHER_WRAPPER_BURN_FEE_RATE, _rate);
        emit EtherWrapperBurnFeeRateUpdated(_rate);
    }

    function setWrapperMaxTokenAmount(address _wrapper, uint _maxTokenAmount) external onlyOwner {
        flexibleStorage().setWrapperMaxTokenAmount(SETTING_WRAPPER_MAX_TOKEN_AMOUNT, _wrapper, _maxTokenAmount);
        emit WrapperMaxTokenAmountUpdated(_wrapper, _maxTokenAmount);
    }

    function setWrapperMintFeeRate(address _wrapper, int _rate) external onlyOwner {
        flexibleStorage().setWrapperMintFeeRate(
            SETTING_WRAPPER_MINT_FEE_RATE,
            _wrapper,
            _rate,
            getWrapperBurnFeeRate(_wrapper)
        );
        emit WrapperMintFeeRateUpdated(_wrapper, _rate);
    }

    function setWrapperBurnFeeRate(address _wrapper, int _rate) external onlyOwner {
        flexibleStorage().setWrapperBurnFeeRate(
            SETTING_WRAPPER_BURN_FEE_RATE,
            _wrapper,
            _rate,
            getWrapperMintFeeRate(_wrapper)
        );
        emit WrapperBurnFeeRateUpdated(_wrapper, _rate);
    }

    function setInteractionDelay(address _collateral, uint _interactionDelay) external onlyOwner {
        flexibleStorage().setInteractionDelay(SETTING_INTERACTION_DELAY, _collateral, _interactionDelay);
        emit InteractionDelayUpdated(_interactionDelay);
    }

    function setCollapseFeeRate(address _collateral, uint _collapseFeeRate) external onlyOwner {
        flexibleStorage().setCollapseFeeRate(SETTING_COLLAPSE_FEE_RATE, _collateral, _collapseFeeRate);
        emit CollapseFeeRateUpdated(_collapseFeeRate);
    }

    function setAtomicMaxVolumePerBlock(uint _maxVolume) external onlyOwner {
        flexibleStorage().setAtomicMaxVolumePerBlock(SETTING_ATOMIC_MAX_VOLUME_PER_BLOCK, _maxVolume);
        emit AtomicMaxVolumePerBlockUpdated(_maxVolume);
    }

    function setAtomicTwapWindow(uint _window) external onlyOwner {
        flexibleStorage().setAtomicTwapWindow(SETTING_ATOMIC_TWAP_WINDOW, _window);
        emit AtomicTwapWindowUpdated(_window);
    }

    function setAtomicEquivalentForDexPricing(bytes32 _currencyKey, address _equivalent) external onlyOwner {
        flexibleStorage().setAtomicEquivalentForDexPricing(
            SETTING_ATOMIC_EQUIVALENT_FOR_DEX_PRICING,
            _currencyKey,
            _equivalent
        );
        emit AtomicEquivalentForDexPricingUpdated(_currencyKey, _equivalent);
    }

    function setAtomicExchangeFeeRate(bytes32 _currencyKey, uint256 _exchangeFeeRate) external onlyOwner {
        flexibleStorage().setAtomicExchangeFeeRate(SETTING_ATOMIC_EXCHANGE_FEE_RATE, _currencyKey, _exchangeFeeRate);
        emit AtomicExchangeFeeUpdated(_currencyKey, _exchangeFeeRate);
    }

    function setAtomicVolatilityConsiderationWindow(bytes32 _currencyKey, uint _window) external onlyOwner {
        flexibleStorage().setAtomicVolatilityConsiderationWindow(
            SETTING_ATOMIC_VOLATILITY_CONSIDERATION_WINDOW,
            _currencyKey,
            _window
        );
        emit AtomicVolatilityConsiderationWindowUpdated(_currencyKey, _window);
    }

    function setAtomicVolatilityUpdateThreshold(bytes32 _currencyKey, uint _threshold) external onlyOwner {
        flexibleStorage().setAtomicVolatilityUpdateThreshold(
            SETTING_ATOMIC_VOLATILITY_UPDATE_THRESHOLD,
            _currencyKey,
            _threshold
        );
        emit AtomicVolatilityUpdateThresholdUpdated(_currencyKey, _threshold);
    }

    function setPureChainlinkPriceForAtomicSwapsEnabled(bytes32 _currencyKey, bool _enabled) external onlyOwner {
        flexibleStorage().setPureChainlinkPriceForAtomicSwapsEnabled(
            SETTING_PURE_CHAINLINK_PRICE_FOR_ATOMIC_SWAPS_ENABLED,
            _currencyKey,
            _enabled
        );
        emit PureChainlinkPriceForAtomicSwapsEnabledUpdated(_currencyKey, _enabled);
    }

    function setCrossChainSynthTransferEnabled(bytes32 _currencyKey, uint _value) external onlyOwner {
        flexibleStorage().setCrossChainSynthTransferEnabled(SETTING_CROSS_SYNTH_TRANSFER_ENABLED, _currencyKey, _value);
        emit CrossChainSynthTransferEnabledUpdated(_currencyKey, _value);
    }

    // ========== EVENTS ==========
    event CrossDomainMessageGasLimitChanged(CrossDomainMessageGasLimits gasLimitType, uint newLimit);
    event IssuanceRatioUpdated(uint newRatio);
    event TradingRewardsEnabled(bool enabled);
    event WaitingPeriodSecsUpdated(uint waitingPeriodSecs);
    event PriceDeviationThresholdUpdated(uint threshold);
    event FeePeriodDurationUpdated(uint newFeePeriodDuration);
    event TargetThresholdUpdated(uint newTargetThreshold);
    event LiquidationDelayUpdated(uint newDelay);
    event LiquidationRatioUpdated(uint newRatio);
    event LiquidationEscrowDurationUpdated(uint newDuration);
    event LiquidationPenaltyUpdated(uint newPenalty);
    event SelfLiquidationPenaltyUpdated(uint newPenalty);
    event FlagRewardUpdated(uint newReward);
    event LiquidateRewardUpdated(uint newReward);
    event RateStalePeriodUpdated(uint rateStalePeriod);
    /* ========== Exchange Fees Related ========== */
    event ExchangeFeeUpdated(bytes32 synthKey, uint newExchangeFeeRate);
    event ExchangeDynamicFeeThresholdUpdated(uint dynamicFeeThreshold);
    event ExchangeDynamicFeeWeightDecayUpdated(uint dynamicFeeWeightDecay);
    event ExchangeDynamicFeeRoundsUpdated(uint dynamicFeeRounds);
    event ExchangeMaxDynamicFeeUpdated(uint maxDynamicFee);
    /* ========== End Exchange Fees Related ========== */
    event MinimumStakeTimeUpdated(uint minimumStakeTime);
    event DebtSnapshotStaleTimeUpdated(uint debtSnapshotStaleTime);
    event AggregatorWarningFlagsUpdated(address flags);
    event EtherWrapperMaxETHUpdated(uint maxETH);
    event EtherWrapperMintFeeRateUpdated(uint rate);
    event EtherWrapperBurnFeeRateUpdated(uint rate);
    event WrapperMaxTokenAmountUpdated(address wrapper, uint maxTokenAmount);
    event WrapperMintFeeRateUpdated(address wrapper, int rate);
    event WrapperBurnFeeRateUpdated(address wrapper, int rate);
    event InteractionDelayUpdated(uint interactionDelay);
    event CollapseFeeRateUpdated(uint collapseFeeRate);
    event AtomicMaxVolumePerBlockUpdated(uint newMaxVolume);
    event AtomicTwapWindowUpdated(uint newWindow);
    event AtomicEquivalentForDexPricingUpdated(bytes32 synthKey, address equivalent);
    event AtomicExchangeFeeUpdated(bytes32 synthKey, uint newExchangeFeeRate);
    event AtomicVolatilityConsiderationWindowUpdated(bytes32 synthKey, uint newVolatilityConsiderationWindow);
    event AtomicVolatilityUpdateThresholdUpdated(bytes32 synthKey, uint newVolatilityUpdateThreshold);
    event PureChainlinkPriceForAtomicSwapsEnabledUpdated(bytes32 synthKey, bool enabled);
    event CrossChainSynthTransferEnabledUpdated(bytes32 synthKey, uint value);
}

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":false,"internalType":"address","name":"flags","type":"address"}],"name":"AggregatorWarningFlagsUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"synthKey","type":"bytes32"},{"indexed":false,"internalType":"address","name":"equivalent","type":"address"}],"name":"AtomicEquivalentForDexPricingUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"synthKey","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"newExchangeFeeRate","type":"uint256"}],"name":"AtomicExchangeFeeUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newMaxVolume","type":"uint256"}],"name":"AtomicMaxVolumePerBlockUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newWindow","type":"uint256"}],"name":"AtomicTwapWindowUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"synthKey","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"newVolatilityConsiderationWindow","type":"uint256"}],"name":"AtomicVolatilityConsiderationWindowUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"synthKey","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"newVolatilityUpdateThreshold","type":"uint256"}],"name":"AtomicVolatilityUpdateThresholdUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"name","type":"bytes32"},{"indexed":false,"internalType":"address","name":"destination","type":"address"}],"name":"CacheUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"collapseFeeRate","type":"uint256"}],"name":"CollapseFeeRateUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"synthKey","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"CrossChainSynthTransferEnabledUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"enum MixinSystemSettings.CrossDomainMessageGasLimits","name":"gasLimitType","type":"uint8"},{"indexed":false,"internalType":"uint256","name":"newLimit","type":"uint256"}],"name":"CrossDomainMessageGasLimitChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"debtSnapshotStaleTime","type":"uint256"}],"name":"DebtSnapshotStaleTimeUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"rate","type":"uint256"}],"name":"EtherWrapperBurnFeeRateUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"maxETH","type":"uint256"}],"name":"EtherWrapperMaxETHUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"rate","type":"uint256"}],"name":"EtherWrapperMintFeeRateUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"dynamicFeeRounds","type":"uint256"}],"name":"ExchangeDynamicFeeRoundsUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"dynamicFeeThreshold","type":"uint256"}],"name":"ExchangeDynamicFeeThresholdUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"dynamicFeeWeightDecay","type":"uint256"}],"name":"ExchangeDynamicFeeWeightDecayUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"synthKey","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"newExchangeFeeRate","type":"uint256"}],"name":"ExchangeFeeUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"maxDynamicFee","type":"uint256"}],"name":"ExchangeMaxDynamicFeeUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newFeePeriodDuration","type":"uint256"}],"name":"FeePeriodDurationUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newReward","type":"uint256"}],"name":"FlagRewardUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"interactionDelay","type":"uint256"}],"name":"InteractionDelayUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newRatio","type":"uint256"}],"name":"IssuanceRatioUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newReward","type":"uint256"}],"name":"LiquidateRewardUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newDelay","type":"uint256"}],"name":"LiquidationDelayUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newDuration","type":"uint256"}],"name":"LiquidationEscrowDurationUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newPenalty","type":"uint256"}],"name":"LiquidationPenaltyUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newRatio","type":"uint256"}],"name":"LiquidationRatioUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"minimumStakeTime","type":"uint256"}],"name":"MinimumStakeTimeUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldOwner","type":"address"},{"indexed":false,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerNominated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"threshold","type":"uint256"}],"name":"PriceDeviationThresholdUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"synthKey","type":"bytes32"},{"indexed":false,"internalType":"bool","name":"enabled","type":"bool"}],"name":"PureChainlinkPriceForAtomicSwapsEnabledUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"rateStalePeriod","type":"uint256"}],"name":"RateStalePeriodUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newPenalty","type":"uint256"}],"name":"SelfLiquidationPenaltyUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newTargetThreshold","type":"uint256"}],"name":"TargetThresholdUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"enabled","type":"bool"}],"name":"TradingRewardsEnabled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"waitingPeriodSecs","type":"uint256"}],"name":"WaitingPeriodSecsUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"wrapper","type":"address"},{"indexed":false,"internalType":"int256","name":"rate","type":"int256"}],"name":"WrapperBurnFeeRateUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"wrapper","type":"address"},{"indexed":false,"internalType":"uint256","name":"maxTokenAmount","type":"uint256"}],"name":"WrapperMaxTokenAmountUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"wrapper","type":"address"},{"indexed":false,"internalType":"int256","name":"rate","type":"int256"}],"name":"WrapperMintFeeRateUpdated","type":"event"},{"constant":true,"inputs":[],"name":"CONTRACT_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"acceptOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"aggregatorWarningFlags","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"currencyKey","type":"bytes32"}],"name":"atomicEquivalentForDexPricing","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"currencyKey","type":"bytes32"}],"name":"atomicExchangeFeeRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"atomicMaxVolumePerBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"atomicTwapWindow","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"currencyKey","type":"bytes32"}],"name":"atomicVolatilityConsiderationWindow","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"currencyKey","type":"bytes32"}],"name":"atomicVolatilityUpdateThreshold","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"collateral","type":"address"}],"name":"collapseFeeRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"currencyKey","type":"bytes32"}],"name":"crossChainSynthTransferEnabled","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"enum MixinSystemSettings.CrossDomainMessageGasLimits","name":"gasLimitType","type":"uint8"}],"name":"crossDomainMessageGasLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"debtSnapshotStaleTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"etherWrapperBurnFeeRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"etherWrapperMaxETH","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"etherWrapperMintFeeRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"exchangeDynamicFeeRounds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"exchangeDynamicFeeThreshold","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"exchangeDynamicFeeWeightDecay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"currencyKey","type":"bytes32"}],"name":"exchangeFeeRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"exchangeMaxDynamicFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"feePeriodDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"flagReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"collateral","type":"address"}],"name":"interactionDelay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isResolverCached","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"issuanceRatio","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"liquidateReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"liquidationDelay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"liquidationEscrowDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"liquidationPenalty","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"liquidationRatio","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"minimumStakeTime","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":[{"internalType":"bytes32","name":"currencyKey","type":"bytes32"}],"name":"pureChainlinkPriceForAtomicSwapsEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"rateStalePeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"rebuildCache","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"resolver","outputs":[{"internalType":"contract AddressResolver","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"resolverAddressesRequired","outputs":[{"internalType":"bytes32[]","name":"addresses","type":"bytes32[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"selfLiquidationPenalty","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_flags","type":"address"}],"name":"setAggregatorWarningFlags","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"_currencyKey","type":"bytes32"},{"internalType":"address","name":"_equivalent","type":"address"}],"name":"setAtomicEquivalentForDexPricing","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"_currencyKey","type":"bytes32"},{"internalType":"uint256","name":"_exchangeFeeRate","type":"uint256"}],"name":"setAtomicExchangeFeeRate","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"_maxVolume","type":"uint256"}],"name":"setAtomicMaxVolumePerBlock","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"_window","type":"uint256"}],"name":"setAtomicTwapWindow","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"_currencyKey","type":"bytes32"},{"internalType":"uint256","name":"_window","type":"uint256"}],"name":"setAtomicVolatilityConsiderationWindow","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"_currencyKey","type":"bytes32"},{"internalType":"uint256","name":"_threshold","type":"uint256"}],"name":"setAtomicVolatilityUpdateThreshold","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_collateral","type":"address"},{"internalType":"uint256","name":"_collapseFeeRate","type":"uint256"}],"name":"setCollapseFeeRate","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"_currencyKey","type":"bytes32"},{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"setCrossChainSynthTransferEnabled","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"enum MixinSystemSettings.CrossDomainMessageGasLimits","name":"_gasLimitType","type":"uint8"},{"internalType":"uint256","name":"_crossDomainMessageGasLimit","type":"uint256"}],"name":"setCrossDomainMessageGasLimit","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"_seconds","type":"uint256"}],"name":"setDebtSnapshotStaleTime","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"_rate","type":"uint256"}],"name":"setEtherWrapperBurnFeeRate","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"_maxETH","type":"uint256"}],"name":"setEtherWrapperMaxETH","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"_rate","type":"uint256"}],"name":"setEtherWrapperMintFeeRate","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"rounds","type":"uint256"}],"name":"setExchangeDynamicFeeRounds","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"threshold","type":"uint256"}],"name":"setExchangeDynamicFeeThreshold","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"weightDecay","type":"uint256"}],"name":"setExchangeDynamicFeeWeightDecay","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32[]","name":"synthKeys","type":"bytes32[]"},{"internalType":"uint256[]","name":"exchangeFeeRates","type":"uint256[]"}],"name":"setExchangeFeeRateForSynths","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"maxFee","type":"uint256"}],"name":"setExchangeMaxDynamicFee","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"_feePeriodDuration","type":"uint256"}],"name":"setFeePeriodDuration","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"reward","type":"uint256"}],"name":"setFlagReward","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_collateral","type":"address"},{"internalType":"uint256","name":"_interactionDelay","type":"uint256"}],"name":"setInteractionDelay","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"ratio","type":"uint256"}],"name":"setIssuanceRatio","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"reward","type":"uint256"}],"name":"setLiquidateReward","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"time","type":"uint256"}],"name":"setLiquidationDelay","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"duration","type":"uint256"}],"name":"setLiquidationEscrowDuration","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"penalty","type":"uint256"}],"name":"setLiquidationPenalty","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"_liquidationRatio","type":"uint256"}],"name":"setLiquidationRatio","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"_seconds","type":"uint256"}],"name":"setMinimumStakeTime","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"_priceDeviationThresholdFactor","type":"uint256"}],"name":"setPriceDeviationThresholdFactor","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"_currencyKey","type":"bytes32"},{"internalType":"bool","name":"_enabled","type":"bool"}],"name":"setPureChainlinkPriceForAtomicSwapsEnabled","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"period","type":"uint256"}],"name":"setRateStalePeriod","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"penalty","type":"uint256"}],"name":"setSelfLiquidationPenalty","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"percent","type":"uint256"}],"name":"setTargetThreshold","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bool","name":"_tradingRewardsEnabled","type":"bool"}],"name":"setTradingRewardsEnabled","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"_waitingPeriodSecs","type":"uint256"}],"name":"setWaitingPeriodSecs","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_wrapper","type":"address"},{"internalType":"int256","name":"_rate","type":"int256"}],"name":"setWrapperBurnFeeRate","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_wrapper","type":"address"},{"internalType":"uint256","name":"_maxTokenAmount","type":"uint256"}],"name":"setWrapperMaxTokenAmount","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_wrapper","type":"address"},{"internalType":"int256","name":"_rate","type":"int256"}],"name":"setWrapperMintFeeRate","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"targetThreshold","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","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"},{"constant":true,"inputs":[{"internalType":"address","name":"wrapper","type":"address"}],"name":"wrapperBurnFeeRate","outputs":[{"internalType":"int256","name":"","type":"int256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"wrapper","type":"address"}],"name":"wrapperMaxTokenAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"wrapper","type":"address"}],"name":"wrapperMintFeeRate","outputs":[{"internalType":"int256","name":"","type":"int256"}],"payable":false,"stateMutability":"view","type":"function"}]

60806040523480156200001157600080fd5b506040516200556938038062005569833981810160405260408110156200003757600080fd5b5080516020909101518080836001600160a01b0381166200009f576040805162461bcd60e51b815260206004820152601960248201527f4f776e657220616464726573732063616e6e6f74206265203000000000000000604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b038316908117825560408051928352602083019190915280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a15080600260006101000a8154816001600160a01b0302191690836001600160a01b0316021790555050507347f08d263d759d150bc61be5d72337ebd45fb5596375d0c0dc6040518163ffffffff1660e01b815260040160206040518083038186803b1580156200016657600080fd5b505af41580156200017b573d6000803e3d6000fd5b505050506040513d60208110156200019257600080fd5b50516d53797374656d53657474696e677360901b14620001f9576040805162461bcd60e51b815260206004820152601d60248201527f7265616420616e64207772697465206b657973206e6f7420657175616c000000604482015290519081900360640190fd5b505061535e806200020b6000396000f3fe608060405234801561001057600080fd5b50600436106104cd5760003560e01c80636a2b915111610283578063a77715561161015c578063d954bc02116100ce578063e7894da111610092578063e7894da114610d44578063e942204614610d61578063ee93119814610d7e578063f081da8514610d9b578063f216310714610dbe578063f867e76714610ddb576104cd565b8063d954bc0214610cc5578063dad0ab0f14610cf1578063dc8f4a1b14610cf9578063e0e6393d14610d1f578063e3bb67d414610d27576104cd565b8063c193f0d811610120578063c193f0d814610c23578063c52f35fe14610c2b578063c7b481bd14610c57578063c855a8e114610c83578063cc754a4c14610c8b578063d8ee820814610ca8576104cd565b8063a777155614610bc2578063af5355d814610bdf578063b16e450f14610be7578063b410a03414610c13578063bcf7eeac14610c1b576104cd565b806389257117116101f5578063946ce8cd116101b9578063946ce8cd14610b2f578063967706e914610b4c57806397a4aca014610b695780639d4e186d14610b86578063a0cf745114610bb2578063a4bca13114610bba576104cd565b80638925711714610a9a5780638979ee0f14610aa2578063899ffef414610ac75780638da5cb5b14610b1f578063922fef0814610b27576104cd565b806379cb657a1161024757806379cb657a146109fe5780637bf8230514610a1b5780637d708a4614610a415780637f3b293c14610a5e5780638074b37214610a665780638326470c14610a6e576104cd565b80636a2b9151146109a35780637066871f146109ab57806374185360146109d157806375aca321146109d957806379ba5097146109f6576104cd565b80632806a743116103b55780634641ab66116103275780635d14928f116102eb5780635d14928f146109015780635d467d6a1461091e5780635e0117d614610944578063614d08f8146109615780636190dd7a14610969578063635a387214610986576104cd565b80634641ab66146108ad5780634c36b837146108cc578063510242bc146108d4578063523fd889146108dc57806353a47bb7146108f9576104cd565b806331e4e0301161037957806331e4e03014610823578063345a39431461082b57806334eac49714610848578063372a395a1461086b578063393d334f146108735780634328a92514610890576104cd565b80632806a743146106e557806328a1170d1461070257806329a022ba146107c45780632af64bd3146107ea5780632cce0e5414610806576104cd565b80631627540c1161044e57806321d9eba61161041257806321d9eba61461067657806322425fa41461069357806323b550081461069b57806323f5589a146106b8578063242df9e1146106c057806325539dd2146106c8576104cd565b80631627540c146105fd5780631710940c146106235780631775765f1461062b5780631e6e219014610633578063214bf9e514610650576104cd565b806309e514a41161049557806309e514a4146105815780630ee4951b146105a75780630f27b788146105af57806310557020146105b757806313d825b2146105da576104cd565b8063038e47fe146104d25780630411d53c1461050457806304c49f2c1461052357806304f3bcec14610540578063054be0b714610564575b600080fd5b6104f2600480360360208110156104e857600080fd5b503560ff16610de3565b60408051918252519081900360200190f35b6105216004803603602081101561051a57600080fd5b5035610df6565b005b6105216004803603602081101561053957600080fd5b5035610ec5565b610548610fa0565b604080516001600160a01b039092168252519081900360200190f35b6105216004803603602081101561057a57600080fd5b5035610faf565b6104f26004803603602081101561059757600080fd5b50356001600160a01b0316611086565b6104f2611091565b6104f26110a1565b610521600480360360408110156105cd57600080fd5b50803590602001356110ab565b610521600480360360408110156105f057600080fd5b50803590602001356111a1565b6105216004803603602081101561061357600080fd5b50356001600160a01b031661128f565b6104f26112eb565b6104f26112f5565b6105216004803603602081101561064957600080fd5b50356112ff565b6104f26004803603602081101561066657600080fd5b50356001600160a01b03166113e6565b6105216004803603602081101561068c57600080fd5b50356113f1565b6104f261151d565b610521600480360360208110156106b157600080fd5b5035611527565b6104f2611607565b6104f2611611565b6104f2600480360360208110156106de57600080fd5b503561161b565b610521600480360360208110156106fb57600080fd5b5035611626565b6105216004803603604081101561071857600080fd5b81019060208101813564010000000081111561073357600080fd5b82018360208201111561074557600080fd5b8035906020019184602083028401116401000000008311171561076757600080fd5b91939092909160208101903564010000000081111561078557600080fd5b82018360208201111561079757600080fd5b803590602001918460208302840111640100000000831117156107b957600080fd5b509092509050611702565b6104f2600480360360208110156107da57600080fd5b50356001600160a01b0316611890565b6107f261189b565b604080519115158252519081900360200190f35b6105216004803603602081101561081c57600080fd5b50356119a5565b6104f2611a97565b6107f26004803603602081101561084157600080fd5b5035611aa1565b6105216004803603604081101561085e57600080fd5b5080359060200135611aac565b6104f2611ba2565b6105216004803603602081101561088957600080fd5b5035611bac565b610521600480360360208110156108a657600080fd5b5035611c8b565b610521600480360360208110156108c357600080fd5b50351515611dbf565b610548611ea1565b6104f2611eab565b610521600480360360208110156108f257600080fd5b5035611ebb565b610548611f8f565b6105216004803603602081101561091757600080fd5b5035611f9e565b6104f26004803603602081101561093457600080fd5b50356001600160a01b031661207f565b6105216004803603602081101561095a57600080fd5b503561208a565b6104f2612164565b6105216004803603602081101561097f57600080fd5b50356121db565b6105216004803603602081101561099c57600080fd5b50356122ba565b6104f2612395565b6104f2600480360360208110156109c157600080fd5b50356001600160a01b031661239f565b6105216123aa565b610521600480360360208110156109ef57600080fd5b5035612572565b610521612653565b61052160048036036020811015610a1457600080fd5b503561270f565b61052160048036036020811015610a3157600080fd5b50356001600160a01b03166127e8565b61052160048036036020811015610a5757600080fd5b50356128d1565b6104f26129ab565b6104f26129be565b61052160048036036040811015610a8457600080fd5b506001600160a01b0381351690602001356129c8565b6104f2612aa9565b61052160048036036040811015610ab857600080fd5b50803590602001351515612ab3565b610acf612bab565b60408051602080825283518183015283519192839290830191858101910280838360005b83811015610b0b578181015183820152602001610af3565b505050509050019250505060405180910390f35b610548612bfc565b6104f2612c0b565b61052160048036036020811015610b4557600080fd5b5035612c15565b6104f260048036036020811015610b6257600080fd5b5035612d20565b6104f260048036036020811015610b7f57600080fd5b5035612d2b565b61052160048036036040811015610b9c57600080fd5b506001600160a01b038135169060200135612d36565b6104f2612e60565b6104f2612e6a565b6104f260048036036020811015610bd857600080fd5b5035612e74565b6104f2612e7f565b61052160048036036040811015610bfd57600080fd5b506001600160a01b038135169060200135612e89565b6104f2612f7b565b6104f2612f85565b6107f2612f8f565b61052160048036036040811015610c4157600080fd5b50803590602001356001600160a01b0316612f99565b61052160048036036040811015610c6d57600080fd5b506001600160a01b038135169060200135613097565b6104f2613179565b61052160048036036020811015610ca157600080fd5b5035613183565b61052160048036036020811015610cbe57600080fd5b503561325f565b61052160048036036040811015610cdb57600080fd5b506001600160a01b03813516906020013561333c565b6104f2613466565b61052160048036036040811015610d0f57600080fd5b5060ff8135169060200135613479565b6104f2613575565b61052160048036036020811015610d3d57600080fd5b503561357f565b61052160048036036020811015610d5a57600080fd5b503561365d565b61052160048036036020811015610d7757600080fd5b503561373e565b6104f260048036036020811015610d9457600080fd5b5035613818565b61052160048036036040811015610db157600080fd5b5080359060200135613823565b61054860048036036020811015610dd457600080fd5b5035613914565b6104f261391f565b6000610dee82613932565b90505b919050565b610dfe6139cf565b610e06613a1a565b6001600160a01b0316631d5b277f60008051602061530a83398151915269199b1859d4995dd85c9960b21b846040518463ffffffff1660e01b8152600401808481526020018381526020018281526020019350505050600060405180830381600087803b158015610e7657600080fd5b505af1158015610e8a573d6000803e3d6000fd5b50506040805184815290517fa31178ade19fb6a78fe78b68ebf820b88707e3bdbedbf77db4e80977800f39449350908190036020019150a150565b610ecd6139cf565b610ed5613a1a565b604080516363daca0960e01b81526001600160a01b03929092166004830152703332b2a832b934b7b2223ab930ba34b7b760791b602483015260448201839052517347f08d263d759d150bc61be5d72337ebd45fb559916363daca09916064808301926000929190829003018186803b158015610f5157600080fd5b505af4158015610f65573d6000803e3d6000fd5b50506040805184815290517f791bd58dd9719b5eb5ccdd6ec4d5c459b0ab8efcf59b723cf477693c0889eacd9350908190036020019150a150565b6002546001600160a01b031681565b610fb76139cf565b610fbf613a1a565b60408051636d4851f160e01b81526001600160a01b039290921660048301526c69737375616e6365526174696f60981b602483015260448201839052517347f08d263d759d150bc61be5d72337ebd45fb55991636d4851f1916064808301926000929190829003018186803b15801561103757600080fd5b505af415801561104b573d6000803e3d6000fd5b50506040805184815290517f63b22e09cc3a33e847c063e35f887bd4ea96bc8c0f93f1f8c311e4fa6d8854529350908190036020019150a150565b6000610dee82613a37565b600061109b613af0565b90505b90565b600061109b613b79565b6110b36139cf565b6110bb613a1a565b60408051635d3045ab60e01b81526001600160a01b039290921660048301527f61746f6d6963566f6c436f6e73696465726174696f6e57696e646f770000000060248301526044820184905260648201839052517347f08d263d759d150bc61be5d72337ebd45fb55991635d3045ab916084808301926000929190829003018186803b15801561114a57600080fd5b505af415801561115e573d6000803e3d6000fd5b5050604080518581526020810185905281517f98698e41d9ebb66410ec490ae1224f1b8d1766696d7217fa96e067de3ef5332a9450908190039091019150a15050565b6111a96139cf565b6111b1613a1a565b60408051638134ddb760e01b81526001600160a01b039290921660048301527461746f6d696345786368616e67654665655261746560581b60248301526044820184905260648201839052517347f08d263d759d150bc61be5d72337ebd45fb55991638134ddb7916084808301926000929190829003018186803b15801561123857600080fd5b505af415801561124c573d6000803e3d6000fd5b5050604080518581526020810185905281517f84023d924a8ccb4a028f052967ed7e1e642279c24150e018962f0779021fce4c9450908190039091019150a15050565b6112976139cf565b600180546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce229181900360200190a150565b600061109b613bf6565b600061109b613c72565b6113076139cf565b61130f613a1a565b60408051630e7bf1c560e01b81526001600160a01b039290921660048301527f7072696365446576696174696f6e5468726573686f6c64466163746f72000000602483015260448201839052517347f08d263d759d150bc61be5d72337ebd45fb55991630e7bf1c5916064808301926000929190829003018186803b15801561139757600080fd5b505af41580156113ab573d6000803e3d6000fd5b50506040805184815290517f6e65c7d32a9129ebc4e4e6d755e2a9668753c046f4b128ac8aeb4f3e5446a1e59350908190036020019150a150565b6000610dee82613ce8565b6113f96139cf565b80611443576040805162461bcd60e51b815260206004820152601560248201527405468726573686f6c642063616e6e6f74206265203605c1b604482015290519081900360640190fd5b61144b613a1a565b6001600160a01b0316631d5b277f60008051602061530a8339815191527f65786368616e676544796e616d69634665655468726573686f6c640000000000846040518463ffffffff1660e01b8152600401808481526020018381526020018281526020019350505050600060405180830381600087803b1580156114ce57600080fd5b505af11580156114e2573d6000803e3d6000fd5b50506040805184815290517f0a1c77eb56927959639f898ae5258d25789fe6c36d7958d2c3daf3f1471d42d99350908190036020019150a150565b600061109b613da1565b61152f6139cf565b611537613a1a565b604080516367f9fdd960e11b81526001600160a01b039290921660048301527573656c664c69717569646174696f6e50656e616c747960501b602483015260448201839052517347f08d263d759d150bc61be5d72337ebd45fb5599163cff3fbb2916064808301926000929190829003018186803b1580156115b857600080fd5b505af41580156115cc573d6000803e3d6000fd5b50506040805184815290517fcc1eff40ab461aae35275af10e50d93e6e37087e019f27e936816b62540168fe9350908190036020019150a150565b600061109b613e18565b600061109b613e90565b6000610dee82613f06565b61162e6139cf565b611636613a1a565b60408051631faca50560e21b81526001600160a01b03929092166004830152716c69717569646174696f6e50656e616c747960701b602483015260448201839052517347f08d263d759d150bc61be5d72337ebd45fb55991637eb29414916064808301926000929190829003018186803b1580156116b357600080fd5b505af41580156116c7573d6000803e3d6000fd5b50506040805184815290517fbfb22c07314f4682bba789860ceb851eb8cea2d867920332b2a42cf56be5b2e99350908190036020019150a150565b61170a6139cf565b611712613a1a565b6001600160a01b03167347f08d263d759d150bc61be5d72337ebd45fb559631a5bb1f790916e65786368616e67654665655261746560881b878787876040518763ffffffff1660e01b815260040180876001600160a01b03166001600160a01b0316815260200186815260200180602001806020018381038352878782818152602001925060200280828437600083820152601f01601f19169091018481038352858152602090810191508690860280828437600081840152601f19601f8201169050808301925050509850505050505050505060006040518083038186803b1580156117fe57600080fd5b505af4158015611812573d6000803e3d6000fd5b506000925050505b83811015611889577fbbdab54f0da6d720d21f53e4d6f5bbe83e5a2f74c1354175140ea74f8e90c77e85858381811061184f57fe5b9050602002013584848481811061186257fe5b604080519485526020918202939093013590840152508051918290030190a160010161181a565b5050505050565b6000610dee82613faf565b600060606118a7612bab565b905060005b815181101561199c5760008282815181106118c357fe5b6020908102919091018101516000818152600383526040908190205460025482516321f8a72160e01b81526004810185905292519395506001600160a01b03918216949116926321f8a721926024808201939291829003018186803b15801561192b57600080fd5b505afa15801561193f573d6000803e3d6000fd5b505050506040513d602081101561195557600080fd5b50516001600160a01b031614158061198257506000818152600360205260409020546001600160a01b0316155b15611993576000935050505061109e565b506001016118ac565b50600191505090565b6119ad6139cf565b60006119b7613a1a565b6040805162856d3960e51b81526001600160a01b039290921660048301526e1d185c99d95d151a1c995cda1bdb19608a1b602483015260448201849052517347f08d263d759d150bc61be5d72337ebd45fb559916310ada720916064808301926020929190829003018186803b158015611a3057600080fd5b505af4158015611a44573d6000803e3d6000fd5b505050506040513d6020811015611a5a57600080fd5b50516040805182815290519192507fb2b3a840c101d8e7f0cf8d80d3868976968714347038fe89b36c5031f94dab12919081900360200190a15050565b600061109b61406a565b6000610dee826140df565b611ab46139cf565b611abc613a1a565b60408051636c5a980960e01b81526001600160a01b039290921660048301527f63726f7373436861696e53796e74685472616e73666572456e61626c6564000060248301526044820184905260648201839052517347f08d263d759d150bc61be5d72337ebd45fb55991636c5a9809916084808301926000929190829003018186803b158015611b4b57600080fd5b505af4158015611b5f573d6000803e3d6000fd5b5050604080518581526020810185905281517f2f10f42e3d725e85dada13510e81fc571c49386ab4cd9152b12e2db2b0c04b729450908190039091019150a15050565b600061109b614190565b611bb46139cf565b611bbc613a1a565b604080516339aafdf360e21b81526001600160a01b039290921660048301527465786368616e67654d617844796e616d696346656560581b602483015260448201839052517347f08d263d759d150bc61be5d72337ebd45fb5599163e6abf7cc916064808301926000929190829003018186803b158015611c3c57600080fd5b505af4158015611c50573d6000803e3d6000fd5b50506040805184815290517fd7764866d2b524c8fa50c82668b78d32bf7b46a87e37b891de9dd40853de464f9350908190036020019150a150565b611c936139cf565b80611ce5576040805162461bcd60e51b815260206004820152601860248201527f5765696768742064656361792063616e6e6f7420626520300000000000000000604482015290519081900360640190fd5b611ced613a1a565b6001600160a01b0316631d5b277f60008051602061530a8339815191527f65786368616e676544796e616d69634665655765696768744465636179000000846040518463ffffffff1660e01b8152600401808481526020018381526020018281526020019350505050600060405180830381600087803b158015611d7057600080fd5b505af1158015611d84573d6000803e3d6000fd5b50506040805184815290517fd80e77b0d087a975f2a783eb806eb9a1e93dab1bf148651d3e70c6e85d740eba9350908190036020019150a150565b611dc76139cf565b611dcf613a1a565b60408051633e0ecceb60e11b81526001600160a01b03929092166004830152741d1c98591a5b99d4995dd85c991cd15b98589b1959605a1b60248301528215156044830152517347f08d263d759d150bc61be5d72337ebd45fb55991637c1d99d6916064808301926000929190829003018186803b158015611e5057600080fd5b505af4158015611e64573d6000803e3d6000fd5b505060408051841515815290517fe11c1893b6f97decd3ac13637137734a4b75d159e899e5a8abb48470ab0bc4fd9350908190036020019150a150565b600061109b614213565b6000611eb561428f565b51905090565b611ec36139cf565b611ecb613a1a565b6001600160a01b0316631d5b277f60008051602061530a8339815191526e1b1a5c5d5a59185d1954995dd85c99608a1b846040518463ffffffff1660e01b8152600401808481526020018381526020018281526020019350505050600060405180830381600087803b158015611f4057600080fd5b505af1158015611f54573d6000803e3d6000fd5b50506040805184815290517f6586b69a20f0202ee8802e307c1ca76ce96354ff6b1123d5d7fd3e9b0057e0359350908190036020019150a150565b6001546001600160a01b031681565b611fa66139cf565b611fae613a1a565b6040805163064c16cf60e21b81526001600160a01b039290921660048301527661746f6d69634d6178566f6c756d65506572426c6f636b60481b602483015260448201839052517347f08d263d759d150bc61be5d72337ebd45fb559916319305b3c916064808301926000929190829003018186803b15801561203057600080fd5b505af4158015612044573d6000803e3d6000fd5b50506040805184815290517ff96e059cb3386bb65fd1d80017c7ce524f813b012d7dc97a1252f9cd4f4c99f39350908190036020019150a150565b6000610dee82614579565b6120926139cf565b61209a613a1a565b60408051632cfaf72960e21b81526001600160a01b039290921660048301526f6c69717569646174696f6e44656c617960801b602483015260448201839052517347f08d263d759d150bc61be5d72337ebd45fb5599163b3ebdca4916064808301926000929190829003018186803b15801561211557600080fd5b505af4158015612129573d6000803e3d6000fd5b50506040805184815290517f9917e32433edcb65f8982c1b2c26c3469468308456f93cf34b98c1b0459c53989350908190036020019150a150565b60007347f08d263d759d150bc61be5d72337ebd45fb5596375d0c0dc6040518163ffffffff1660e01b815260040160206040518083038186803b1580156121aa57600080fd5b505af41580156121be573d6000803e3d6000fd5b505050506040513d60208110156121d457600080fd5b5051905090565b6121e36139cf565b6121eb613a1a565b6040805163d4aebcef60e01b81526001600160a01b039290921660048301527464656274536e617073686f745374616c6554696d6560581b602483015260448201839052517347f08d263d759d150bc61be5d72337ebd45fb5599163d4aebcef916064808301926000929190829003018186803b15801561226b57600080fd5b505af415801561227f573d6000803e3d6000fd5b50506040805184815290517f9795be9f1478ed09e9e47e67318b8aa7a0c0213170403191099bf7dd435fb4d79350908190036020019150a150565b6122c26139cf565b6122ca613a1a565b604080516341a7936f60e11b81526001600160a01b039290921660048301527077616974696e67506572696f645365637360781b602483015260448201839052517347f08d263d759d150bc61be5d72337ebd45fb5599163834f26de916064808301926000929190829003018186803b15801561234657600080fd5b505af415801561235a573d6000803e3d6000fd5b50506040805184815290517fc32c92cac11e29883e0fb2d9e38230cc510e3bda48abc270b780de60bb8465f89350908190036020019150a150565b600061109b614631565b6000610dee826146a7565b60606123b4612bab565b905060005b815181101561256e5760008282815181106123d057fe5b602090810291909101810151600254604080517f5265736f6c766572206d697373696e67207461726765743a2000000000000000818601526039808201859052825180830390910181526059820180845263dacb2d0160e01b9052605d8201858152607d83019384528151609d84015281519597506000966001600160a01b039095169563dacb2d01958995939492939260bd0191908501908083838c5b8381101561248657818101518382015260200161246e565b50505050905090810190601f1680156124b35780820380516001836020036101000a031916815260200191505b50935050505060206040518083038186803b1580156124d157600080fd5b505afa1580156124e5573d6000803e3d6000fd5b505050506040513d60208110156124fb57600080fd5b505160008381526003602090815260409182902080546001600160a01b0319166001600160a01b03851690811790915582518681529182015281519293507f88a93678a3692f6789d9546fc621bf7234b101ddb7d4fe479455112831b8aa68929081900390910190a150506001016123b9565b5050565b61257a6139cf565b612582613a1a565b6040805163fe250a5560e01b81526001600160a01b03929092166004830152766574686572577261707065724d696e744665655261746560481b602483015260448201839052517347f08d263d759d150bc61be5d72337ebd45fb5599163fe250a55916064808301926000929190829003018186803b15801561260457600080fd5b505af4158015612618573d6000803e3d6000fd5b50506040805184815290517f19ef86e0422ac5c02afdc7b9f91f468ccc5e9b785bf7c158e01357e8503a819b9350908190036020019150a150565b6001546001600160a01b0316331461269c5760405162461bcd60e51b81526004018080602001828103825260358152602001806152a66035913960400191505060405180910390fd5b600054600154604080516001600160a01b03938416815292909116602083015280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b6127176139cf565b61271f613a1a565b6040805163fd194a3560e01b81526001600160a01b039290921660048301526e1c985d1954dd185b1954195c9a5bd9608a1b602483015260448201839052517347f08d263d759d150bc61be5d72337ebd45fb5599163fd194a35916064808301926000929190829003018186803b15801561279957600080fd5b505af41580156127ad573d6000803e3d6000fd5b50506040805184815290517f16529d8c407b08938da67de7fa4319199baffce4f5d1971f812cc770b0237e669350908190036020019150a150565b6127f06139cf565b6127f8613a1a565b604080516330d6e65760e21b81526001600160a01b0392831660048201527561676772656761746f725761726e696e67466c61677360501b60248201529183166044830152517347f08d263d759d150bc61be5d72337ebd45fb5599163c35b995c916064808301926000929190829003018186803b15801561287957600080fd5b505af415801561288d573d6000803e3d6000fd5b5050604080516001600160a01b038516815290517f0f4cbdee769ea02d5757b91905563555cc648fe42fc3ef201e28d97d2bbde9659350908190036020019150a150565b6128d96139cf565b6128e1613a1a565b6040805163067bb56d60e31b81526001600160a01b039290921660048301526f61746f6d69635477617057696e646f7760801b602483015260448201839052517347f08d263d759d150bc61be5d72337ebd45fb559916333ddab68916064808301926000929190829003018186803b15801561295c57600080fd5b505af4158015612970573d6000803e3d6000fd5b50506040805184815290517f61ee2076e20b46130ce31de66f08321493e96f79de0837fb0296b7feca92285b9350908190036020019150a150565b60006129b561428f565b60400151905090565b600061109b614762565b6129d06139cf565b6129d8613a1a565b60408051631b5238f760e31b81526001600160a01b0392831660048201526e636f6c6c617073654665655261746560881b6024820152918416604483015260648201839052517347f08d263d759d150bc61be5d72337ebd45fb5599163da91c7b8916084808301926000929190829003018186803b158015612a5957600080fd5b505af4158015612a6d573d6000803e3d6000fd5b50506040805184815290517f7e9498fa8cb2442ec5a6f05b47f4adaafaf286d03a3fa580cc0f3592b60b32359350908190036020019150a15050565b600061109b6147d2565b612abb6139cf565b612ac3613a1a565b60408051637c14e56b60e01b81526001600160a01b039290921660048301527f70757265436861696e6c696e6b466f7241746f6d696373456e61626c656400006024830152604482018490528215156064830152517347f08d263d759d150bc61be5d72337ebd45fb55991637c14e56b916084808301926000929190829003018186803b158015612b5357600080fd5b505af4158015612b67573d6000803e3d6000fd5b505060408051858152841515602082015281517fc39c526ec779c4ad9e0426c2a964a82134f99c4490e764153e19574c58b2ab539450908190039091019150a15050565b604080516001808252818301909252606091602080830190803883390190505090506e466c657869626c6553746f7261676560881b81600081518110612bed57fe5b60200260200101818152505090565b6000546001600160a01b031681565b600061109b614849565b612c1d6139cf565b612c25613a1a565b6001600160a01b03167347f08d263d759d150bc61be5d72337ebd45fb5596311d78c0c90916f6c69717569646174696f6e526174696f60801b84612c67613e18565b612c6f6148c6565b6040518663ffffffff1660e01b815260040180866001600160a01b03166001600160a01b031681526020018581526020018481526020018381526020018281526020019550505050505060006040518083038186803b158015612cd157600080fd5b505af4158015612ce5573d6000803e3d6000fd5b50506040805184815290517f5568be83e5cf7405adf8fb39305e2cdf49c43336606d23c3e0d3fe54e205150a9350908190036020019150a150565b6000610dee82614939565b6000610dee826149dc565b612d3e6139cf565b612d46613a1a565b6001600160a01b03167347f08d263d759d150bc61be5d72337ebd45fb55963c404a0de909171777261707065724275726e4665655261746560701b8585612d8c88613faf565b6040518663ffffffff1660e01b815260040180866001600160a01b03166001600160a01b03168152602001858152602001846001600160a01b03166001600160a01b031681526020018381526020018281526020019550505050505060006040518083038186803b158015612e0057600080fd5b505af4158015612e14573d6000803e3d6000fd5b5050604080516001600160a01b03861681526020810185905281517f65647551bef307c3b3c3cc08ff4dd60cf02eb1e9e9d20604c5603b90a453e4979450908190039091019150a15050565b600061109b614a88565b600061109b614afe565b6000610dee82614b7b565b600061109b614c2c565b612e916139cf565b612e99613a1a565b60408051631f86e9a960e21b81526001600160a01b0392831660048201526f777261707065724d6178546f6b656e7360801b6024820152918416604483015260648201839052517347f08d263d759d150bc61be5d72337ebd45fb55991637e1ba6a4916084808301926000929190829003018186803b158015612f1b57600080fd5b505af4158015612f2f573d6000803e3d6000fd5b5050604080516001600160a01b03861681526020810185905281517fc466f93337e5645290e02cdbed66a95340e81d809b710d8f6de2280de3e27b2f9450908190039091019150a15050565b600061109b6148c6565b600061109b614ca7565b600061109b614d1f565b612fa16139cf565b612fa9613a1a565b60408051635f7ad87160e01b81526001600160a01b0392831660048201527f61746f6d69634571756976616c656e74466f7244657850726963696e670000006024820152604481018590529183166064830152517347f08d263d759d150bc61be5d72337ebd45fb55991635f7ad871916084808301926000929190829003018186803b15801561303857600080fd5b505af415801561304c573d6000803e3d6000fd5b5050604080518581526001600160a01b038516602082015281517fc7cff0a6f47777500050f9a29aac5206e15b25b782d1834a176f3b3b134d4f3a9450908190039091019150a15050565b61309f6139cf565b6130a7613a1a565b60408051637dfecb2360e11b81526001600160a01b0392831660048201526f696e746572616374696f6e44656c617960801b6024820152918416604483015260648201839052517347f08d263d759d150bc61be5d72337ebd45fb5599163fbfd9646916084808301926000929190829003018186803b15801561312957600080fd5b505af415801561313d573d6000803e3d6000fd5b50506040805184815290517f4d71c92b0a9dc236066597b95637bb04d58cd135e9165aee13eb68e3199c23619350908190036020019150a15050565b600061109b614d9a565b61318b6139cf565b613193613a1a565b60408051630a6c461160e41b81526001600160a01b03929092166004830152710cae8d0cae4aee4c2e0e0cae49ac2f08aa8960731b602483015260448201839052517347f08d263d759d150bc61be5d72337ebd45fb5599163a6c46110916064808301926000929190829003018186803b15801561321057600080fd5b505af4158015613224573d6000803e3d6000fd5b50506040805184815290517f8086de8bfec0a6cd9a9213caef7ee137a59e4d8da145de163dc3f244dacddc689350908190036020019150a150565b6132676139cf565b61326f613a1a565b6001600160a01b0316631d5b277f60008051602061530a8339815191527765786368616e676544796e616d6963466565526f756e647360401b846040518463ffffffff1660e01b8152600401808481526020018381526020018281526020019350505050600060405180830381600087803b1580156132ed57600080fd5b505af1158015613301573d6000803e3d6000fd5b50506040805184815290517f098d0190950f074545dd4e10dda16c804bd054facc9ed1ec4181e076ab09bd479350908190036020019150a150565b6133446139cf565b61334c613a1a565b6001600160a01b03167347f08d263d759d150bc61be5d72337ebd45fb5596353c0bf1c909171777261707065724d696e744665655261746560701b8585613392886146a7565b6040518663ffffffff1660e01b815260040180866001600160a01b03166001600160a01b03168152602001858152602001846001600160a01b03166001600160a01b031681526020018381526020018281526020019550505050505060006040518083038186803b15801561340657600080fd5b505af415801561341a573d6000803e3d6000fd5b5050604080516001600160a01b03861681526020810185905281517ffe7e17467e216f68f8d4a3aea0ab082631afc874fb216e93c38e52a2ddb7ec659450908190039091019150a15050565b600061347061428f565b60200151905090565b6134816139cf565b613489613a1a565b6001600160a01b03167347f08d263d759d150bc61be5d72337ebd45fb55963f02d9a5b90916134b785614e19565b846040518463ffffffff1660e01b815260040180846001600160a01b03166001600160a01b03168152602001838152602001828152602001935050505060006040518083038186803b15801561350c57600080fd5b505af4158015613520573d6000803e3d6000fd5b505050507fbf62a396f632016f0e0cffedb18ee9be41a161c79cee3b64736b0c97a924554a82826040518083600581111561355757fe5b60ff1681526020018281526020019250505060405180910390a15050565b600061109b614fc2565b6135876139cf565b61358f613a1a565b6001600160a01b0316631d5b277f60008051602061530a833981519152783634b8bab4b230ba34b7b722b9b1b937bba23ab930ba34b7b760391b846040518463ffffffff1660e01b8152600401808481526020018381526020018281526020019350505050600060405180830381600087803b15801561360e57600080fd5b505af1158015613622573d6000803e3d6000fd5b50506040805184815290517f9f268a84b9cb3eb37f078345457b36a34236602cd78eac0d9166e9e62579fef19350908190036020019150a150565b6136656139cf565b61366d613a1a565b6040805163496d5d7960e11b81526001600160a01b03929092166004830152766574686572577261707065724275726e4665655261746560481b602483015260448201839052517347f08d263d759d150bc61be5d72337ebd45fb559916392dabaf2916064808301926000929190829003018186803b1580156136ef57600080fd5b505af4158015613703573d6000803e3d6000fd5b50506040805184815290517f1c97c2e8b44aa487062d3e92ce52ac814b35191f4799fd2d5a3f36c67f1d9d4a9350908190036020019150a150565b6137466139cf565b61374e613a1a565b6040805163d9158b0360e01b81526001600160a01b039290921660048301526f6d696e696d756d5374616b6554696d6560801b602483015260448201839052517347f08d263d759d150bc61be5d72337ebd45fb5599163d9158b03916064808301926000929190829003018186803b1580156137c957600080fd5b505af41580156137dd573d6000803e3d6000fd5b50506040805184815290517f2b0fa66d155c9598699cb6569577f27b95729bbf580268eed39db6bc4e8144779350908190036020019150a150565b6000610dee82615037565b61382b6139cf565b613833613a1a565b6040805163446ca4fd60e01b81526001600160a01b0392909216600483015277185d1bdb5a58d59bdb155c19185d19551a1c995cda1bdb1960421b60248301526044820184905260648201839052517347f08d263d759d150bc61be5d72337ebd45fb5599163446ca4fd916084808301926000929190829003018186803b1580156138bd57600080fd5b505af41580156138d1573d6000803e3d6000fd5b5050604080518581526020810185905281517f460476cc6f40e86f19053ba74c9baf4c2cef96452bb2722a454d66db953a7b3d9450908190039091019150a15050565b6000610dee826150e8565b600061392961428f565b60600151905090565b600061393c613a1a565b6001600160a01b03166323257c2b60008051602061530a83398151915261396285614e19565b6040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b15801561399d57600080fd5b505afa1580156139b1573d6000803e3d6000fd5b505050506040513d60208110156139c757600080fd5b505192915050565b6000546001600160a01b03163314613a185760405162461bcd60e51b815260040180806020018281038252602f8152602001806152db602f913960400191505060405180910390fd5b565b600061109b6e466c657869626c6553746f7261676560881b615199565b6000613a41613a1a565b6001600160a01b03166323257c2b60008051602061530a8339815191526f696e746572616374696f6e44656c617960801b8560405160200180838152602001826001600160a01b03166001600160a01b031660601b815260140192505050604051602081830303815290604052805190602001206040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b15801561399d57600080fd5b6000613afa613a1a565b6001600160a01b03166323257c2b60008051602061530a8339815191526e1c985d1954dd185b1954195c9a5bd9608a1b6040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613b6557600080fd5b505afa1580156121be573d6000803e3d6000fd5b6000613b83613a1a565b6001600160a01b03166323257c2b60008051602061530a833981519152766574686572577261707065724d696e744665655261746560481b6040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613b6557600080fd5b6000613c00613a1a565b6001600160a01b03166323257c2b60008051602061530a8339815191527573656c664c69717569646174696f6e50656e616c747960501b6040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613b6557600080fd5b6000613c7c613a1a565b6001600160a01b03166323257c2b60008051602061530a8339815191526f6c69717569646174696f6e526174696f60801b6040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613b6557600080fd5b6000613cf2613a1a565b6001600160a01b03166323257c2b60008051602061530a8339815191526f777261707065724d6178546f6b656e7360801b8560405160200180838152602001826001600160a01b03166001600160a01b031660601b815260140192505050604051602081830303815290604052805190602001206040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b15801561399d57600080fd5b6000613dab613a1a565b6001600160a01b03166323257c2b60008051602061530a833981519152703332b2a832b934b7b2223ab930ba34b7b760791b6040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613b6557600080fd5b6000613e22613a1a565b6001600160a01b03166323257c2b60008051602061530a833981519152716c69717569646174696f6e50656e616c747960701b6040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613b6557600080fd5b6000613e9a613a1a565b6001600160a01b03166323257c2b60008051602061530a8339815191526f6d696e696d756d5374616b6554696d6560801b6040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613b6557600080fd5b6000613f10613a1a565b6001600160a01b03166323257c2b60008051602061530a8339815191527461746f6d696345786368616e67654665655261746560581b856040516020018083815260200182815260200192505050604051602081830303815290604052805190602001206040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b15801561399d57600080fd5b6000613fb9613a1a565b6001600160a01b031663c4f610ed60008051602061530a83398151915271777261707065724d696e744665655261746560701b8560405160200180838152602001826001600160a01b03166001600160a01b031660601b815260140192505050604051602081830303815290604052805190602001206040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b15801561399d57600080fd5b6000614074613a1a565b6001600160a01b03166323257c2b60008051602061530a8339815191526e1b1a5c5d5a59185d1954995dd85c99608a1b6040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613b6557600080fd5b60006140e9613a1a565b6001600160a01b031663d994502d60008051602061530a8339815191527f70757265436861696e6c696e6b466f7241746f6d696373456e61626c65640000856040516020018083815260200182815260200192505050604051602081830303815290604052805190602001206040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b15801561399d57600080fd5b600061419a613a1a565b6001600160a01b03166323257c2b60008051602061530a8339815191527f7072696365446576696174696f6e5468726573686f6c64466163746f720000006040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613b6557600080fd5b600061421d613a1a565b6001600160a01b0316639ee5955a60008051602061530a8339815191527561676772656761746f725761726e696e67466c61677360501b6040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613b6557600080fd5b61429761527d565b60408051600480825260a08201909252606091602082016080803883390190505090507f65786368616e676544796e616d69634665655468726573686f6c640000000000816000815181106142e857fe5b6020026020010181815250507f65786368616e676544796e616d696346656557656967687444656361790000008160018151811061432257fe5b6020026020010181815250507765786368616e676544796e616d6963466565526f756e647360401b8160028151811061435757fe5b6020026020010181815250507465786368616e67654d617844796e616d696346656560581b8160038151811061438957fe5b602002602001018181525050606061439f613a1a565b6001600160a01b031663b67fa7ed60008051602061530a833981519152846040518363ffffffff1660e01b81526004018083815260200180602001828103825283818151815260200191508051906020019060200280838360005b838110156144125781810151838201526020016143fa565b50505050905001935050505060006040518083038186803b15801561443657600080fd5b505afa15801561444a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052602081101561447357600080fd5b810190808051604051939291908464010000000082111561449357600080fd5b9083019060208201858111156144a857600080fd5b82518660208202830111640100000000821117156144c557600080fd5b82525081516020918201928201910280838360005b838110156144f25781810151838201526020016144da565b50505050905001604052505050905060405180608001604052808260008151811061451957fe5b602002602001015181526020018260018151811061453357fe5b602002602001015181526020018260028151811061454d57fe5b602002602001015181526020018260038151811061456757fe5b60200260200101518152509250505090565b6000614583613a1a565b6001600160a01b03166323257c2b60008051602061530a8339815191526e636f6c6c617073654665655261746560881b8560405160200180838152602001826001600160a01b03166001600160a01b031660601b815260140192505050604051602081830303815290604052805190602001206040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b15801561399d57600080fd5b600061463b613a1a565b6001600160a01b03166323257c2b60008051602061530a8339815191526f61746f6d69635477617057696e646f7760801b6040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613b6557600080fd5b60006146b1613a1a565b6001600160a01b031663c4f610ed60008051602061530a83398151915271777261707065724275726e4665655261746560701b8560405160200180838152602001826001600160a01b03166001600160a01b031660601b815260140192505050604051602081830303815290604052805190602001206040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b15801561399d57600080fd5b600061476c613a1a565b6001600160a01b03166323257c2b60008051602061530a83398151915269199b1859d4995dd85c9960b21b6040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613b6557600080fd5b60006147dc613a1a565b6001600160a01b03166323257c2b60008051602061530a8339815191527077616974696e67506572696f645365637360781b6040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613b6557600080fd5b6000614853613a1a565b6001600160a01b03166323257c2b60008051602061530a833981519152766574686572577261707065724275726e4665655261746560481b6040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613b6557600080fd5b60006148d0613a1a565b6001600160a01b03166323257c2b60008051602061530a8339815191526c69737375616e6365526174696f60981b6040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613b6557600080fd5b6000614943613a1a565b6001600160a01b03166323257c2b60008051602061530a8339815191526e65786368616e67654665655261746560881b856040516020018083815260200182815260200192505050604051602081830303815290604052805190602001206040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b15801561399d57600080fd5b60006149e6613a1a565b6001600160a01b03166323257c2b60008051602061530a83398151915277185d1bdb5a58d59bdb155c19185d19551a1c995cda1bdb1960421b856040516020018083815260200182815260200192505050604051602081830303815290604052805190602001206040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b15801561399d57600080fd5b6000614a92613a1a565b6001600160a01b03166323257c2b60008051602061530a8339815191526f6c69717569646174696f6e44656c617960801b6040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613b6557600080fd5b6000614b08613a1a565b6001600160a01b03166323257c2b60008051602061530a8339815191527661746f6d69634d6178566f6c756d65506572426c6f636b60481b6040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613b6557600080fd5b6000614b85613a1a565b6001600160a01b03166323257c2b60008051602061530a8339815191527f61746f6d6963566f6c436f6e73696465726174696f6e57696e646f7700000000856040516020018083815260200182815260200192505050604051602081830303815290604052805190602001206040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b15801561399d57600080fd5b6000614c36613a1a565b6001600160a01b03166323257c2b60008051602061530a8339815191527464656274536e617073686f745374616c6554696d6560581b6040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613b6557600080fd5b6000614cb1613a1a565b6001600160a01b03166323257c2b60008051602061530a833981519152710cae8d0cae4aee4c2e0e0cae49ac2f08aa8960731b6040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613b6557600080fd5b6000614d29613a1a565b6001600160a01b031663d994502d60008051602061530a833981519152741d1c98591a5b99d4995dd85c991cd15b98589b1959605a1b6040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613b6557600080fd5b6000614da4613a1a565b6001600160a01b03166323257c2b60008051602061530a833981519152783634b8bab4b230ba34b7b722b9b1b937bba23ab930ba34b7b760391b6040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613b6557600080fd5b600080826005811115614e2857fe5b1415614e5557507f63726f7373446f6d61696e4465706f7369744761734c696d6974000000000000610df1565b6001826005811115614e6357fe5b1415614e9057507f63726f7373446f6d61696e457363726f774761734c696d697400000000000000610df1565b6002826005811115614e9e57fe5b1415614ecb57507f63726f7373446f6d61696e5265776172644761734c696d697400000000000000610df1565b6003826005811115614ed957fe5b1415614f0657507f63726f7373446f6d61696e5769746864726177616c4761734c696d6974000000610df1565b6005826005811115614f1457fe5b1415614f4157507f63726f7373446f6d61696e52656c61794761734c696d69740000000000000000610df1565b6004826005811115614f4f57fe5b1415614f7c57507f63726f7373446f6d61696e436c6f73654761734c696d69740000000000000000610df1565b6040805162461bcd60e51b8152602060048201526016602482015275556e6b6e6f776e20676173206c696d6974207479706560501b604482015290519081900360640190fd5b6000614fcc613a1a565b6001600160a01b03166323257c2b60008051602061530a8339815191526e1d185c99d95d151a1c995cda1bdb19608a1b6040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613b6557600080fd5b6000615041613a1a565b6001600160a01b03166323257c2b60008051602061530a8339815191527f63726f7373436861696e53796e74685472616e73666572456e61626c65640000856040516020018083815260200182815260200192505050604051602081830303815290604052805190602001206040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b15801561399d57600080fd5b60006150f2613a1a565b6001600160a01b0316639ee5955a60008051602061530a8339815191527f61746f6d69634571756976616c656e74466f7244657850726963696e67000000856040516020018083815260200182815260200192505050604051602081830303815290604052805190602001206040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b15801561399d57600080fd5b600081815260036020908152604080832054815170026b4b9b9b4b7339030b2323932b9b99d1607d1b9381019390935260318084018690528251808503909101815260519093019091526001600160a01b031690816152765760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561523b578181015183820152602001615223565b50505050905090810190601f1680156152685780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5092915050565b604051806080016040528060008152602001600081526020016000815260200160008152509056fe596f75206d757374206265206e6f6d696e61746564206265666f726520796f752063616e20616363657074206f776e6572736869704f6e6c792074686520636f6e7472616374206f776e6572206d617920706572666f726d207468697320616374696f6e53797374656d53657474696e6773000000000000000000000000000000000000a265627a7a723158206bc52ac1e2e5ce492882737d0b38c25431fadbd6870e24f47df2e1ada820419c64736f6c6343000510003200000000000000000000000073570075092502472e4b61a7058df1a4a1db12f2000000000000000000000000242a3df52c375bee81b1c668741d7c63af68fdd2

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

00000000000000000000000073570075092502472e4b61a7058df1a4a1db12f2000000000000000000000000242a3df52c375bee81b1c668741d7c63af68fdd2

-----Decoded View---------------
Arg [0] : _owner (address): 0x73570075092502472e4b61a7058df1a4a1db12f2
Arg [1] : _resolver (address): 0x242a3df52c375bee81b1c668741d7c63af68fdd2

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 00000000000000000000000073570075092502472e4b61a7058df1a4a1db12f2
Arg [1] : 000000000000000000000000242a3df52c375bee81b1c668741d7c63af68fdd2


Block Transaction Difficulty Gas Used Reward
Block Uncle Number Difficulty Gas Used Reward
Loading

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