Contract Overview
Balance:
0 Ether
More Info
My Name Tag:
Not Available
Txn Hash |
Method
|
Block
|
From
|
To
|
Value | ||||
---|---|---|---|---|---|---|---|---|---|
0x7768658cb68b9221ef81ba1865fcaab0f05ccdb38b1fdbe61845e9b84e838b39 | 0x60806040 | 7881007 | 92 days 4 hrs ago | 0x48914229dedd5a9922f44441ffccfc2cb7856ee9 | IN | Create: SystemSettings | 0 Ether | 0.00619911 |
[ Download CSV Export ]
Latest 5 internal transactions
Parent Txn Hash | Block | From | To | Value | |||
---|---|---|---|---|---|---|---|
0x13fb49e6c59c10b5f3a2dc668e2bed80e41ec1449346221b23ab8675fdf75619 | 7881220 | 92 days 3 hrs ago | 0x063e110e614474aa1ffb36936abed4b1d173e5fc | 0x58719e8ef4d201541e44505a2acb3424481d6681 | 0 Ether | ||
0x13fb49e6c59c10b5f3a2dc668e2bed80e41ec1449346221b23ab8675fdf75619 | 7881220 | 92 days 3 hrs ago | 0x0c80ff30d1e09135ec60cfe52b2c2eae1b2f42ab | 0x063e110e614474aa1ffb36936abed4b1d173e5fc | 0 Ether | ||
0x13fb49e6c59c10b5f3a2dc668e2bed80e41ec1449346221b23ab8675fdf75619 | 7881220 | 92 days 3 hrs ago | 0x063e110e614474aa1ffb36936abed4b1d173e5fc | 0x52c339d07e82d49073f6b85ab033599e0eb644f9 | 0 Ether | ||
0x13fb49e6c59c10b5f3a2dc668e2bed80e41ec1449346221b23ab8675fdf75619 | 7881220 | 92 days 3 hrs ago | 0xacd8750679299ed3da5fc9c4343892f4c91e2f43 | 0x063e110e614474aa1ffb36936abed4b1d173e5fc | 0 Ether | ||
0x7768658cb68b9221ef81ba1865fcaab0f05ccdb38b1fdbe61845e9b84e838b39 | 7881007 | 92 days 4 hrs ago | 0x063e110e614474aa1ffb36936abed4b1d173e5fc | 0x52c339d07e82d49073f6b85ab033599e0eb644f9 | 0 Ether |
[ Download CSV Export ]
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 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-11-03 */ /* ____ __ __ __ _ / __/__ __ ___ / /_ / / ___ / /_ (_)__ __ _\ \ / // // _ \/ __// _ \/ -_)/ __// / \ \ / /___/ \_, //_//_/\__//_//_/\__/ \__//_/ /_\_\ /___/ * 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); function liquidationAmounts(address account, bool isSelfLiquidation) external view returns ( uint totalRedeemed, uint debtToRemove, uint escrowToLiquidate, uint initialDebtBalance ); // Restricted: used internally to Synthetix function addSynths(ISynth[] calldata synthsToAdd) external; 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 debtRemoved, uint escrowToLiquidate ); 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_SNX_LIQUIDATION_PENALTY = "snxLiquidationPenalty"; 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 getSnxLiquidationPenalty() internal view returns (uint) { return flexibleStorage().getUIntValue(SETTING_CONTRACT_NAME, SETTING_SNX_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)) ); } function getExchangeMaxDynamicFee() internal view returns (uint) { return flexibleStorage().getUIntValue(SETTING_CONTRACT_NAME, SETTING_EXCHANGE_MAX_DYNAMIC_FEE); } function getExchangeDynamicFeeRounds() internal view returns (uint) { return flexibleStorage().getUIntValue(SETTING_CONTRACT_NAME, SETTING_EXCHANGE_DYNAMIC_FEE_ROUNDS); } function getExchangeDynamicFeeThreshold() internal view returns (uint) { return flexibleStorage().getUIntValue(SETTING_CONTRACT_NAME, SETTING_EXCHANGE_DYNAMIC_FEE_THRESHOLD); } function getExchangeDynamicFeeWeightDecay() internal view returns (uint) { return flexibleStorage().getUIntValue(SETTING_CONTRACT_NAME, SETTING_EXCHANGE_DYNAMIC_FEE_WEIGHT_DECAY); } } // 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 snxLiquidationPenalty() 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 = 9e18 / 10; // Max 90% 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 getSnxLiquidationPenalty, uint getIssuanceRatio ) external { require( _liquidationRatio <= MAX_LIQUIDATION_RATIO.divideDecimal(SafeDecimalMath.unit().add(getSnxLiquidationPenalty)), "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 setSnxLiquidationPenalty( IFlexibleStorage flexibleStorage, bytes32 settingName, uint penalty ) external { // MAX_LIQUIDATION_PENALTY is enforced on both Collateral and SNX liquidations 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 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 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-97 Liquidations // penalty taken away from target of Collateral liquidation (with 18 decimals). E.g. 10% is 0.1e18 function liquidationPenalty() external view returns (uint) { return getLiquidationPenalty(); } // SIP-251 Differentiate Liquidation Penalties // penalty taken away from target of SNX liquidation (with 18 decimals). E.g. 30% is 0.3e18 function snxLiquidationPenalty() external view returns (uint) { return getSnxLiquidationPenalty(); } /* ========== 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, getSnxLiquidationPenalty(), getIssuanceRatio() ); emit LiquidationRatioUpdated(_liquidationRatio); } function setLiquidationEscrowDuration(uint duration) external onlyOwner { flexibleStorage().setUIntValue(SETTING_CONTRACT_NAME, SETTING_LIQUIDATION_ESCROW_DURATION, duration); emit LiquidationEscrowDurationUpdated(duration); } function setSnxLiquidationPenalty(uint penalty) external onlyOwner { flexibleStorage().setSnxLiquidationPenalty(SETTING_SNX_LIQUIDATION_PENALTY, penalty); emit SnxLiquidationPenaltyUpdated(penalty); } 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 SnxLiquidationPenaltyUpdated(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); }
[{"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":"newPenalty","type":"uint256"}],"name":"SnxLiquidationPenaltyUpdated","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":"penalty","type":"uint256"}],"name":"setSnxLiquidationPenalty","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":"snxLiquidationPenalty","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","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"}]
Contract Creation Code
60806040523480156200001157600080fd5b506040516200570838038062005708833981810160405260408110156200003757600080fd5b5080516020909101518080836001600160a01b0381166200009f576040805162461bcd60e51b815260206004820152601960248201527f4f776e657220616464726573732063616e6e6f74206265203000000000000000604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b038316908117825560408051928352602083019190915280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a15080600260006101000a8154816001600160a01b0302191690836001600160a01b0316021790555050507352c339d07e82d49073f6b85ab033599e0eb644f96375d0c0dc6040518163ffffffff1660e01b815260040160206040518083038186803b1580156200016657600080fd5b505af41580156200017b573d6000803e3d6000fd5b505050506040513d60208110156200019257600080fd5b50516d53797374656d53657474696e677360901b14620001f9576040805162461bcd60e51b815260206004820152601d60248201527f7265616420616e64207772697465206b657973206e6f7420657175616c000000604482015290519081900360640190fd5b50506154fd806200020b6000396000f3fe608060405234801561001057600080fd5b50600436106104e35760003560e01c80636a2b91511161028e578063a777155611610167578063d954bc02116100d9578063e84e2c3c11610092578063e84e2c3c14610d94578063e942204614610d9c578063ee93119814610db9578063f081da8514610dd6578063f216310714610df9578063f867e76714610e16576104e3565b8063d954bc0214610cf8578063dad0ab0f14610d24578063dc8f4a1b14610d2c578063e0e6393d14610d52578063e3bb67d414610d5a578063e7894da114610d77576104e3565b8063c193f0d81161012b578063c193f0d814610c56578063c52f35fe14610c5e578063c7b481bd14610c8a578063c855a8e114610cb6578063cc754a4c14610cbe578063d8ee820814610cdb576104e3565b8063a777155614610bf5578063af5355d814610c12578063b16e450f14610c1a578063b410a03414610c46578063bcf7eeac14610c4e576104e3565b80638925711711610200578063946ce8cd116101c4578063946ce8cd14610b62578063967706e914610b7f57806397a4aca014610b9c5780639d4e186d14610bb9578063a0cf745114610be5578063a4bca13114610bed576104e3565b80638925711714610acd5780638979ee0f14610ad5578063899ffef414610afa5780638da5cb5b14610b52578063922fef0814610b5a576104e3565b806379cb657a1161025257806379cb657a14610a315780637bf8230514610a4e5780637d708a4614610a745780637f3b293c14610a915780638074b37214610a995780638326470c14610aa1576104e3565b80636a2b9151146109d65780637066871f146109de5780637418536014610a0457806375aca32114610a0c57806379ba509714610a29576104e3565b806328a1170d116103c05780634c36b837116103325780635d14928f116102f65780635d14928f146109345780635d467d6a146109515780635e0117d614610977578063614d08f8146109945780636190dd7a1461099c578063635a3872146109b9576104e3565b80634c36b837146108e2578063510242bc146108ea578063523fd889146108f257806353a47bb71461090f578063556eaeb114610917576104e3565b8063345a394311610384578063345a39431461084157806334eac4971461085e578063372a395a14610881578063393d334f146108895780634328a925146108a65780634641ab66146108c3576104e3565b806328a1170d1461071857806329a022ba146107da5780632af64bd3146108005780632cce0e541461081c57806331e4e03014610839576104e3565b80631710940c1161045957806322425fa41161041d57806322425fa4146106a957806323b55008146106b157806323f5589a146106ce578063242df9e1146106d657806325539dd2146106de5780632806a743146106fb576104e3565b80631710940c146106395780631775765f146106415780631e6e219014610649578063214bf9e51461066657806321d9eba61461068c576104e3565b806309e514a4116104ab57806309e514a4146105975780630ee4951b146105bd5780630f27b788146105c557806310557020146105cd57806313d825b2146105f05780631627540c14610613576104e3565b8063038e47fe146104e85780630411d53c1461051a57806304c49f2c1461053957806304f3bcec14610556578063054be0b71461057a575b600080fd5b610508600480360360208110156104fe57600080fd5b503560ff16610e1e565b60408051918252519081900360200190f35b6105376004803603602081101561053057600080fd5b5035610e31565b005b6105376004803603602081101561054f57600080fd5b5035610f00565b61055e610fdb565b604080516001600160a01b039092168252519081900360200190f35b6105376004803603602081101561059057600080fd5b5035610fea565b610508600480360360208110156105ad57600080fd5b50356001600160a01b03166110c1565b6105086110cc565b6105086110dc565b610537600480360360408110156105e357600080fd5b50803590602001356110e6565b6105376004803603604081101561060657600080fd5b50803590602001356111dc565b6105376004803603602081101561062957600080fd5b50356001600160a01b03166112ca565b610508611326565b610508611330565b6105376004803603602081101561065f57600080fd5b503561133a565b6105086004803603602081101561067c57600080fd5b50356001600160a01b0316611421565b610537600480360360208110156106a257600080fd5b503561142c565b610508611558565b610537600480360360208110156106c757600080fd5b5035611562565b610508611642565b61050861164c565b610508600480360360208110156106f457600080fd5b5035611656565b6105376004803603602081101561071157600080fd5b5035611661565b6105376004803603604081101561072e57600080fd5b81019060208101813564010000000081111561074957600080fd5b82018360208201111561075b57600080fd5b8035906020019184602083028401116401000000008311171561077d57600080fd5b91939092909160208101903564010000000081111561079b57600080fd5b8201836020820111156107ad57600080fd5b803590602001918460208302840111640100000000831117156107cf57600080fd5b50909250905061173d565b610508600480360360208110156107f057600080fd5b50356001600160a01b03166118cb565b6108086118d6565b604080519115158252519081900360200190f35b6105376004803603602081101561083257600080fd5b50356119e0565b610508611ad2565b6108086004803603602081101561085757600080fd5b5035611adc565b6105376004803603604081101561087457600080fd5b5080359060200135611ae7565b610508611bdd565b6105376004803603602081101561089f57600080fd5b5035611be7565b610537600480360360208110156108bc57600080fd5b5035611cc6565b610537600480360360208110156108d957600080fd5b50351515611dfa565b61055e611edc565b610508611ee6565b6105376004803603602081101561090857600080fd5b5035611ef6565b61055e611fca565b6105376004803603602081101561092d57600080fd5b5035611fd9565b6105376004803603602081101561094a57600080fd5b50356120b8565b6105086004803603602081101561096757600080fd5b50356001600160a01b0316612199565b6105376004803603602081101561098d57600080fd5b50356121a4565b61050861227e565b610537600480360360208110156109b257600080fd5b50356122f5565b610537600480360360208110156109cf57600080fd5b50356123d4565b6105086124af565b610508600480360360208110156109f457600080fd5b50356001600160a01b03166124b9565b6105376124c4565b61053760048036036020811015610a2257600080fd5b503561268c565b61053761276d565b61053760048036036020811015610a4757600080fd5b5035612829565b61053760048036036020811015610a6457600080fd5b50356001600160a01b0316612902565b61053760048036036020811015610a8a57600080fd5b50356129eb565b610508612ac5565b610508612ad8565b61053760048036036040811015610ab757600080fd5b506001600160a01b038135169060200135612ae2565b610508612bc3565b61053760048036036040811015610aeb57600080fd5b50803590602001351515612bcd565b610b02612cc5565b60408051602080825283518183015283519192839290830191858101910280838360005b83811015610b3e578181015183820152602001610b26565b505050509050019250505060405180910390f35b61055e612d16565b610508612d25565b61053760048036036020811015610b7857600080fd5b5035612d2f565b61050860048036036020811015610b9557600080fd5b5035612e3a565b61050860048036036020811015610bb257600080fd5b5035612e45565b61053760048036036040811015610bcf57600080fd5b506001600160a01b038135169060200135612e50565b610508612f7a565b610508612f84565b61050860048036036020811015610c0b57600080fd5b5035612f8e565b610508612f99565b61053760048036036040811015610c3057600080fd5b506001600160a01b038135169060200135612fa3565b610508613095565b61050861309f565b6108086130a9565b61053760048036036040811015610c7457600080fd5b50803590602001356001600160a01b03166130b3565b61053760048036036040811015610ca057600080fd5b506001600160a01b0381351690602001356131b1565b610508613293565b61053760048036036020811015610cd457600080fd5b503561329d565b61053760048036036020811015610cf157600080fd5b5035613379565b61053760048036036040811015610d0e57600080fd5b506001600160a01b038135169060200135613456565b610508613580565b61053760048036036040811015610d4257600080fd5b5060ff8135169060200135613593565b61050861368f565b61053760048036036020811015610d7057600080fd5b5035613699565b61053760048036036020811015610d8d57600080fd5b5035613777565b610508613858565b61053760048036036020811015610db257600080fd5b5035613862565b61050860048036036020811015610dcf57600080fd5b503561393c565b61053760048036036040811015610dec57600080fd5b5080359060200135613947565b61055e60048036036020811015610e0f57600080fd5b5035613a38565b610508613a43565b6000610e2982613a56565b90505b919050565b610e39613af3565b610e41613b3e565b6001600160a01b0316631d5b277f6000805160206154a983398151915269199b1859d4995dd85c9960b21b846040518463ffffffff1660e01b8152600401808481526020018381526020018281526020019350505050600060405180830381600087803b158015610eb157600080fd5b505af1158015610ec5573d6000803e3d6000fd5b50506040805184815290517fa31178ade19fb6a78fe78b68ebf820b88707e3bdbedbf77db4e80977800f39449350908190036020019150a150565b610f08613af3565b610f10613b3e565b604080516363daca0960e01b81526001600160a01b03929092166004830152703332b2a832b934b7b2223ab930ba34b7b760791b602483015260448201839052517352c339d07e82d49073f6b85ab033599e0eb644f9916363daca09916064808301926000929190829003018186803b158015610f8c57600080fd5b505af4158015610fa0573d6000803e3d6000fd5b50506040805184815290517f791bd58dd9719b5eb5ccdd6ec4d5c459b0ab8efcf59b723cf477693c0889eacd9350908190036020019150a150565b6002546001600160a01b031681565b610ff2613af3565b610ffa613b3e565b60408051636d4851f160e01b81526001600160a01b039290921660048301526c69737375616e6365526174696f60981b602483015260448201839052517352c339d07e82d49073f6b85ab033599e0eb644f991636d4851f1916064808301926000929190829003018186803b15801561107257600080fd5b505af4158015611086573d6000803e3d6000fd5b50506040805184815290517f63b22e09cc3a33e847c063e35f887bd4ea96bc8c0f93f1f8c311e4fa6d8854529350908190036020019150a150565b6000610e2982613b5b565b60006110d6613c14565b90505b90565b60006110d6613c9d565b6110ee613af3565b6110f6613b3e565b60408051635d3045ab60e01b81526001600160a01b039290921660048301527f61746f6d6963566f6c436f6e73696465726174696f6e57696e646f770000000060248301526044820184905260648201839052517352c339d07e82d49073f6b85ab033599e0eb644f991635d3045ab916084808301926000929190829003018186803b15801561118557600080fd5b505af4158015611199573d6000803e3d6000fd5b5050604080518581526020810185905281517f98698e41d9ebb66410ec490ae1224f1b8d1766696d7217fa96e067de3ef5332a9450908190039091019150a15050565b6111e4613af3565b6111ec613b3e565b60408051638134ddb760e01b81526001600160a01b039290921660048301527461746f6d696345786368616e67654665655261746560581b60248301526044820184905260648201839052517352c339d07e82d49073f6b85ab033599e0eb644f991638134ddb7916084808301926000929190829003018186803b15801561127357600080fd5b505af4158015611287573d6000803e3d6000fd5b5050604080518581526020810185905281517f84023d924a8ccb4a028f052967ed7e1e642279c24150e018962f0779021fce4c9450908190039091019150a15050565b6112d2613af3565b600180546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce229181900360200190a150565b60006110d6613d1a565b60006110d6613d96565b611342613af3565b61134a613b3e565b60408051630e7bf1c560e01b81526001600160a01b039290921660048301527f7072696365446576696174696f6e5468726573686f6c64466163746f72000000602483015260448201839052517352c339d07e82d49073f6b85ab033599e0eb644f991630e7bf1c5916064808301926000929190829003018186803b1580156113d257600080fd5b505af41580156113e6573d6000803e3d6000fd5b50506040805184815290517f6e65c7d32a9129ebc4e4e6d755e2a9668753c046f4b128ac8aeb4f3e5446a1e59350908190036020019150a150565b6000610e2982613e0c565b611434613af3565b8061147e576040805162461bcd60e51b815260206004820152601560248201527405468726573686f6c642063616e6e6f74206265203605c1b604482015290519081900360640190fd5b611486613b3e565b6001600160a01b0316631d5b277f6000805160206154a98339815191527f65786368616e676544796e616d69634665655468726573686f6c640000000000846040518463ffffffff1660e01b8152600401808481526020018381526020018281526020019350505050600060405180830381600087803b15801561150957600080fd5b505af115801561151d573d6000803e3d6000fd5b50506040805184815290517f0a1c77eb56927959639f898ae5258d25789fe6c36d7958d2c3daf3f1471d42d99350908190036020019150a150565b60006110d6613ec5565b61156a613af3565b611572613b3e565b604080516367f9fdd960e11b81526001600160a01b039290921660048301527573656c664c69717569646174696f6e50656e616c747960501b602483015260448201839052517352c339d07e82d49073f6b85ab033599e0eb644f99163cff3fbb2916064808301926000929190829003018186803b1580156115f357600080fd5b505af4158015611607573d6000803e3d6000fd5b50506040805184815290517fcc1eff40ab461aae35275af10e50d93e6e37087e019f27e936816b62540168fe9350908190036020019150a150565b60006110d6613f3c565b60006110d6613fb4565b6000610e298261402a565b611669613af3565b611671613b3e565b60408051631faca50560e21b81526001600160a01b03929092166004830152716c69717569646174696f6e50656e616c747960701b602483015260448201839052517352c339d07e82d49073f6b85ab033599e0eb644f991637eb29414916064808301926000929190829003018186803b1580156116ee57600080fd5b505af4158015611702573d6000803e3d6000fd5b50506040805184815290517fbfb22c07314f4682bba789860ceb851eb8cea2d867920332b2a42cf56be5b2e99350908190036020019150a150565b611745613af3565b61174d613b3e565b6001600160a01b03167352c339d07e82d49073f6b85ab033599e0eb644f9631a5bb1f790916e65786368616e67654665655261746560881b878787876040518763ffffffff1660e01b815260040180876001600160a01b03166001600160a01b0316815260200186815260200180602001806020018381038352878782818152602001925060200280828437600083820152601f01601f19169091018481038352858152602090810191508690860280828437600081840152601f19601f8201169050808301925050509850505050505050505060006040518083038186803b15801561183957600080fd5b505af415801561184d573d6000803e3d6000fd5b506000925050505b838110156118c4577fbbdab54f0da6d720d21f53e4d6f5bbe83e5a2f74c1354175140ea74f8e90c77e85858381811061188a57fe5b9050602002013584848481811061189d57fe5b604080519485526020918202939093013590840152508051918290030190a1600101611855565b5050505050565b6000610e29826140d3565b600060606118e2612cc5565b905060005b81518110156119d75760008282815181106118fe57fe5b6020908102919091018101516000818152600383526040908190205460025482516321f8a72160e01b81526004810185905292519395506001600160a01b03918216949116926321f8a721926024808201939291829003018186803b15801561196657600080fd5b505afa15801561197a573d6000803e3d6000fd5b505050506040513d602081101561199057600080fd5b50516001600160a01b03161415806119bd57506000818152600360205260409020546001600160a01b0316155b156119ce57600093505050506110d9565b506001016118e7565b50600191505090565b6119e8613af3565b60006119f2613b3e565b6040805162856d3960e51b81526001600160a01b039290921660048301526e1d185c99d95d151a1c995cda1bdb19608a1b602483015260448201849052517352c339d07e82d49073f6b85ab033599e0eb644f9916310ada720916064808301926020929190829003018186803b158015611a6b57600080fd5b505af4158015611a7f573d6000803e3d6000fd5b505050506040513d6020811015611a9557600080fd5b50516040805182815290519192507fb2b3a840c101d8e7f0cf8d80d3868976968714347038fe89b36c5031f94dab12919081900360200190a15050565b60006110d661418e565b6000610e2982614203565b611aef613af3565b611af7613b3e565b60408051636c5a980960e01b81526001600160a01b039290921660048301527f63726f7373436861696e53796e74685472616e73666572456e61626c6564000060248301526044820184905260648201839052517352c339d07e82d49073f6b85ab033599e0eb644f991636c5a9809916084808301926000929190829003018186803b158015611b8657600080fd5b505af4158015611b9a573d6000803e3d6000fd5b5050604080518581526020810185905281517f2f10f42e3d725e85dada13510e81fc571c49386ab4cd9152b12e2db2b0c04b729450908190039091019150a15050565b60006110d66142b4565b611bef613af3565b611bf7613b3e565b604080516339aafdf360e21b81526001600160a01b039290921660048301527465786368616e67654d617844796e616d696346656560581b602483015260448201839052517352c339d07e82d49073f6b85ab033599e0eb644f99163e6abf7cc916064808301926000929190829003018186803b158015611c7757600080fd5b505af4158015611c8b573d6000803e3d6000fd5b50506040805184815290517fd7764866d2b524c8fa50c82668b78d32bf7b46a87e37b891de9dd40853de464f9350908190036020019150a150565b611cce613af3565b80611d20576040805162461bcd60e51b815260206004820152601860248201527f5765696768742064656361792063616e6e6f7420626520300000000000000000604482015290519081900360640190fd5b611d28613b3e565b6001600160a01b0316631d5b277f6000805160206154a98339815191527f65786368616e676544796e616d69634665655765696768744465636179000000846040518463ffffffff1660e01b8152600401808481526020018381526020018281526020019350505050600060405180830381600087803b158015611dab57600080fd5b505af1158015611dbf573d6000803e3d6000fd5b50506040805184815290517fd80e77b0d087a975f2a783eb806eb9a1e93dab1bf148651d3e70c6e85d740eba9350908190036020019150a150565b611e02613af3565b611e0a613b3e565b60408051633e0ecceb60e11b81526001600160a01b03929092166004830152741d1c98591a5b99d4995dd85c991cd15b98589b1959605a1b60248301528215156044830152517352c339d07e82d49073f6b85ab033599e0eb644f991637c1d99d6916064808301926000929190829003018186803b158015611e8b57600080fd5b505af4158015611e9f573d6000803e3d6000fd5b505060408051841515815290517fe11c1893b6f97decd3ac13637137734a4b75d159e899e5a8abb48470ab0bc4fd9350908190036020019150a150565b60006110d6614337565b6000611ef06143b3565b51905090565b611efe613af3565b611f06613b3e565b6001600160a01b0316631d5b277f6000805160206154a98339815191526e1b1a5c5d5a59185d1954995dd85c99608a1b846040518463ffffffff1660e01b8152600401808481526020018381526020018281526020019350505050600060405180830381600087803b158015611f7b57600080fd5b505af1158015611f8f573d6000803e3d6000fd5b50506040805184815290517f6586b69a20f0202ee8802e307c1ca76ce96354ff6b1123d5d7fd3e9b0057e0359350908190036020019150a150565b6001546001600160a01b031681565b611fe1613af3565b611fe9613b3e565b60408051636a5b304360e01b81526001600160a01b0392909216600483015274736e784c69717569646174696f6e50656e616c747960581b602483015260448201839052517352c339d07e82d49073f6b85ab033599e0eb644f991636a5b3043916064808301926000929190829003018186803b15801561206957600080fd5b505af415801561207d573d6000803e3d6000fd5b50506040805184815290517fe7a7d374b4557aa224d3675ac9b1abd0ac00b616e7b669db75d30d8582935bb39350908190036020019150a150565b6120c0613af3565b6120c8613b3e565b6040805163064c16cf60e21b81526001600160a01b039290921660048301527661746f6d69634d6178566f6c756d65506572426c6f636b60481b602483015260448201839052517352c339d07e82d49073f6b85ab033599e0eb644f9916319305b3c916064808301926000929190829003018186803b15801561214a57600080fd5b505af415801561215e573d6000803e3d6000fd5b50506040805184815290517ff96e059cb3386bb65fd1d80017c7ce524f813b012d7dc97a1252f9cd4f4c99f39350908190036020019150a150565b6000610e298261469d565b6121ac613af3565b6121b4613b3e565b60408051632cfaf72960e21b81526001600160a01b039290921660048301526f6c69717569646174696f6e44656c617960801b602483015260448201839052517352c339d07e82d49073f6b85ab033599e0eb644f99163b3ebdca4916064808301926000929190829003018186803b15801561222f57600080fd5b505af4158015612243573d6000803e3d6000fd5b50506040805184815290517f9917e32433edcb65f8982c1b2c26c3469468308456f93cf34b98c1b0459c53989350908190036020019150a150565b60007352c339d07e82d49073f6b85ab033599e0eb644f96375d0c0dc6040518163ffffffff1660e01b815260040160206040518083038186803b1580156122c457600080fd5b505af41580156122d8573d6000803e3d6000fd5b505050506040513d60208110156122ee57600080fd5b5051905090565b6122fd613af3565b612305613b3e565b6040805163d4aebcef60e01b81526001600160a01b039290921660048301527464656274536e617073686f745374616c6554696d6560581b602483015260448201839052517352c339d07e82d49073f6b85ab033599e0eb644f99163d4aebcef916064808301926000929190829003018186803b15801561238557600080fd5b505af4158015612399573d6000803e3d6000fd5b50506040805184815290517f9795be9f1478ed09e9e47e67318b8aa7a0c0213170403191099bf7dd435fb4d79350908190036020019150a150565b6123dc613af3565b6123e4613b3e565b604080516341a7936f60e11b81526001600160a01b039290921660048301527077616974696e67506572696f645365637360781b602483015260448201839052517352c339d07e82d49073f6b85ab033599e0eb644f99163834f26de916064808301926000929190829003018186803b15801561246057600080fd5b505af4158015612474573d6000803e3d6000fd5b50506040805184815290517fc32c92cac11e29883e0fb2d9e38230cc510e3bda48abc270b780de60bb8465f89350908190036020019150a150565b60006110d6614755565b6000610e29826147cb565b60606124ce612cc5565b905060005b81518110156126885760008282815181106124ea57fe5b602090810291909101810151600254604080517f5265736f6c766572206d697373696e67207461726765743a2000000000000000818601526039808201859052825180830390910181526059820180845263dacb2d0160e01b9052605d8201858152607d83019384528151609d84015281519597506000966001600160a01b039095169563dacb2d01958995939492939260bd0191908501908083838c5b838110156125a0578181015183820152602001612588565b50505050905090810190601f1680156125cd5780820380516001836020036101000a031916815260200191505b50935050505060206040518083038186803b1580156125eb57600080fd5b505afa1580156125ff573d6000803e3d6000fd5b505050506040513d602081101561261557600080fd5b505160008381526003602090815260409182902080546001600160a01b0319166001600160a01b03851690811790915582518681529182015281519293507f88a93678a3692f6789d9546fc621bf7234b101ddb7d4fe479455112831b8aa68929081900390910190a150506001016124d3565b5050565b612694613af3565b61269c613b3e565b6040805163fe250a5560e01b81526001600160a01b03929092166004830152766574686572577261707065724d696e744665655261746560481b602483015260448201839052517352c339d07e82d49073f6b85ab033599e0eb644f99163fe250a55916064808301926000929190829003018186803b15801561271e57600080fd5b505af4158015612732573d6000803e3d6000fd5b50506040805184815290517f19ef86e0422ac5c02afdc7b9f91f468ccc5e9b785bf7c158e01357e8503a819b9350908190036020019150a150565b6001546001600160a01b031633146127b65760405162461bcd60e51b81526004018080602001828103825260358152602001806154456035913960400191505060405180910390fd5b600054600154604080516001600160a01b03938416815292909116602083015280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b612831613af3565b612839613b3e565b6040805163fd194a3560e01b81526001600160a01b039290921660048301526e1c985d1954dd185b1954195c9a5bd9608a1b602483015260448201839052517352c339d07e82d49073f6b85ab033599e0eb644f99163fd194a35916064808301926000929190829003018186803b1580156128b357600080fd5b505af41580156128c7573d6000803e3d6000fd5b50506040805184815290517f16529d8c407b08938da67de7fa4319199baffce4f5d1971f812cc770b0237e669350908190036020019150a150565b61290a613af3565b612912613b3e565b604080516330d6e65760e21b81526001600160a01b0392831660048201527561676772656761746f725761726e696e67466c61677360501b60248201529183166044830152517352c339d07e82d49073f6b85ab033599e0eb644f99163c35b995c916064808301926000929190829003018186803b15801561299357600080fd5b505af41580156129a7573d6000803e3d6000fd5b5050604080516001600160a01b038516815290517f0f4cbdee769ea02d5757b91905563555cc648fe42fc3ef201e28d97d2bbde9659350908190036020019150a150565b6129f3613af3565b6129fb613b3e565b6040805163067bb56d60e31b81526001600160a01b039290921660048301526f61746f6d69635477617057696e646f7760801b602483015260448201839052517352c339d07e82d49073f6b85ab033599e0eb644f9916333ddab68916064808301926000929190829003018186803b158015612a7657600080fd5b505af4158015612a8a573d6000803e3d6000fd5b50506040805184815290517f61ee2076e20b46130ce31de66f08321493e96f79de0837fb0296b7feca92285b9350908190036020019150a150565b6000612acf6143b3565b60400151905090565b60006110d6614886565b612aea613af3565b612af2613b3e565b60408051631b5238f760e31b81526001600160a01b0392831660048201526e636f6c6c617073654665655261746560881b6024820152918416604483015260648201839052517352c339d07e82d49073f6b85ab033599e0eb644f99163da91c7b8916084808301926000929190829003018186803b158015612b7357600080fd5b505af4158015612b87573d6000803e3d6000fd5b50506040805184815290517f7e9498fa8cb2442ec5a6f05b47f4adaafaf286d03a3fa580cc0f3592b60b32359350908190036020019150a15050565b60006110d66148f6565b612bd5613af3565b612bdd613b3e565b60408051637c14e56b60e01b81526001600160a01b039290921660048301527f70757265436861696e6c696e6b466f7241746f6d696373456e61626c656400006024830152604482018490528215156064830152517352c339d07e82d49073f6b85ab033599e0eb644f991637c14e56b916084808301926000929190829003018186803b158015612c6d57600080fd5b505af4158015612c81573d6000803e3d6000fd5b505060408051858152841515602082015281517fc39c526ec779c4ad9e0426c2a964a82134f99c4490e764153e19574c58b2ab539450908190039091019150a15050565b604080516001808252818301909252606091602080830190803883390190505090506e466c657869626c6553746f7261676560881b81600081518110612d0757fe5b60200260200101818152505090565b6000546001600160a01b031681565b60006110d661496d565b612d37613af3565b612d3f613b3e565b6001600160a01b03167352c339d07e82d49073f6b85ab033599e0eb644f96311d78c0c90916f6c69717569646174696f6e526174696f60801b84612d816149ea565b612d89614a65565b6040518663ffffffff1660e01b815260040180866001600160a01b03166001600160a01b031681526020018581526020018481526020018381526020018281526020019550505050505060006040518083038186803b158015612deb57600080fd5b505af4158015612dff573d6000803e3d6000fd5b50506040805184815290517f5568be83e5cf7405adf8fb39305e2cdf49c43336606d23c3e0d3fe54e205150a9350908190036020019150a150565b6000610e2982614ad8565b6000610e2982614b7b565b612e58613af3565b612e60613b3e565b6001600160a01b03167352c339d07e82d49073f6b85ab033599e0eb644f963c404a0de909171777261707065724275726e4665655261746560701b8585612ea6886140d3565b6040518663ffffffff1660e01b815260040180866001600160a01b03166001600160a01b03168152602001858152602001846001600160a01b03166001600160a01b031681526020018381526020018281526020019550505050505060006040518083038186803b158015612f1a57600080fd5b505af4158015612f2e573d6000803e3d6000fd5b5050604080516001600160a01b03861681526020810185905281517f65647551bef307c3b3c3cc08ff4dd60cf02eb1e9e9d20604c5603b90a453e4979450908190039091019150a15050565b60006110d6614c27565b60006110d6614c9d565b6000610e2982614d1a565b60006110d6614dcb565b612fab613af3565b612fb3613b3e565b60408051631f86e9a960e21b81526001600160a01b0392831660048201526f777261707065724d6178546f6b656e7360801b6024820152918416604483015260648201839052517352c339d07e82d49073f6b85ab033599e0eb644f991637e1ba6a4916084808301926000929190829003018186803b15801561303557600080fd5b505af4158015613049573d6000803e3d6000fd5b5050604080516001600160a01b03861681526020810185905281517fc466f93337e5645290e02cdbed66a95340e81d809b710d8f6de2280de3e27b2f9450908190039091019150a15050565b60006110d6614a65565b60006110d6614e46565b60006110d6614ebe565b6130bb613af3565b6130c3613b3e565b60408051635f7ad87160e01b81526001600160a01b0392831660048201527f61746f6d69634571756976616c656e74466f7244657850726963696e670000006024820152604481018590529183166064830152517352c339d07e82d49073f6b85ab033599e0eb644f991635f7ad871916084808301926000929190829003018186803b15801561315257600080fd5b505af4158015613166573d6000803e3d6000fd5b5050604080518581526001600160a01b038516602082015281517fc7cff0a6f47777500050f9a29aac5206e15b25b782d1834a176f3b3b134d4f3a9450908190039091019150a15050565b6131b9613af3565b6131c1613b3e565b60408051637dfecb2360e11b81526001600160a01b0392831660048201526f696e746572616374696f6e44656c617960801b6024820152918416604483015260648201839052517352c339d07e82d49073f6b85ab033599e0eb644f99163fbfd9646916084808301926000929190829003018186803b15801561324357600080fd5b505af4158015613257573d6000803e3d6000fd5b50506040805184815290517f4d71c92b0a9dc236066597b95637bb04d58cd135e9165aee13eb68e3199c23619350908190036020019150a15050565b60006110d6614f39565b6132a5613af3565b6132ad613b3e565b60408051630a6c461160e41b81526001600160a01b03929092166004830152710cae8d0cae4aee4c2e0e0cae49ac2f08aa8960731b602483015260448201839052517352c339d07e82d49073f6b85ab033599e0eb644f99163a6c46110916064808301926000929190829003018186803b15801561332a57600080fd5b505af415801561333e573d6000803e3d6000fd5b50506040805184815290517f8086de8bfec0a6cd9a9213caef7ee137a59e4d8da145de163dc3f244dacddc689350908190036020019150a150565b613381613af3565b613389613b3e565b6001600160a01b0316631d5b277f6000805160206154a98339815191527765786368616e676544796e616d6963466565526f756e647360401b846040518463ffffffff1660e01b8152600401808481526020018381526020018281526020019350505050600060405180830381600087803b15801561340757600080fd5b505af115801561341b573d6000803e3d6000fd5b50506040805184815290517f098d0190950f074545dd4e10dda16c804bd054facc9ed1ec4181e076ab09bd479350908190036020019150a150565b61345e613af3565b613466613b3e565b6001600160a01b03167352c339d07e82d49073f6b85ab033599e0eb644f96353c0bf1c909171777261707065724d696e744665655261746560701b85856134ac886147cb565b6040518663ffffffff1660e01b815260040180866001600160a01b03166001600160a01b03168152602001858152602001846001600160a01b03166001600160a01b031681526020018381526020018281526020019550505050505060006040518083038186803b15801561352057600080fd5b505af4158015613534573d6000803e3d6000fd5b5050604080516001600160a01b03861681526020810185905281517ffe7e17467e216f68f8d4a3aea0ab082631afc874fb216e93c38e52a2ddb7ec659450908190039091019150a15050565b600061358a6143b3565b60200151905090565b61359b613af3565b6135a3613b3e565b6001600160a01b03167352c339d07e82d49073f6b85ab033599e0eb644f963f02d9a5b90916135d185614fb8565b846040518463ffffffff1660e01b815260040180846001600160a01b03166001600160a01b03168152602001838152602001828152602001935050505060006040518083038186803b15801561362657600080fd5b505af415801561363a573d6000803e3d6000fd5b505050507fbf62a396f632016f0e0cffedb18ee9be41a161c79cee3b64736b0c97a924554a82826040518083600581111561367157fe5b60ff1681526020018281526020019250505060405180910390a15050565b60006110d6615161565b6136a1613af3565b6136a9613b3e565b6001600160a01b0316631d5b277f6000805160206154a9833981519152783634b8bab4b230ba34b7b722b9b1b937bba23ab930ba34b7b760391b846040518463ffffffff1660e01b8152600401808481526020018381526020018281526020019350505050600060405180830381600087803b15801561372857600080fd5b505af115801561373c573d6000803e3d6000fd5b50506040805184815290517f9f268a84b9cb3eb37f078345457b36a34236602cd78eac0d9166e9e62579fef19350908190036020019150a150565b61377f613af3565b613787613b3e565b6040805163496d5d7960e11b81526001600160a01b03929092166004830152766574686572577261707065724275726e4665655261746560481b602483015260448201839052517352c339d07e82d49073f6b85ab033599e0eb644f9916392dabaf2916064808301926000929190829003018186803b15801561380957600080fd5b505af415801561381d573d6000803e3d6000fd5b50506040805184815290517f1c97c2e8b44aa487062d3e92ce52ac814b35191f4799fd2d5a3f36c67f1d9d4a9350908190036020019150a150565b60006110d66149ea565b61386a613af3565b613872613b3e565b6040805163d9158b0360e01b81526001600160a01b039290921660048301526f6d696e696d756d5374616b6554696d6560801b602483015260448201839052517352c339d07e82d49073f6b85ab033599e0eb644f99163d9158b03916064808301926000929190829003018186803b1580156138ed57600080fd5b505af4158015613901573d6000803e3d6000fd5b50506040805184815290517f2b0fa66d155c9598699cb6569577f27b95729bbf580268eed39db6bc4e8144779350908190036020019150a150565b6000610e29826151d6565b61394f613af3565b613957613b3e565b6040805163446ca4fd60e01b81526001600160a01b0392909216600483015277185d1bdb5a58d59bdb155c19185d19551a1c995cda1bdb1960421b60248301526044820184905260648201839052517352c339d07e82d49073f6b85ab033599e0eb644f99163446ca4fd916084808301926000929190829003018186803b1580156139e157600080fd5b505af41580156139f5573d6000803e3d6000fd5b5050604080518581526020810185905281517f460476cc6f40e86f19053ba74c9baf4c2cef96452bb2722a454d66db953a7b3d9450908190039091019150a15050565b6000610e2982615287565b6000613a4d6143b3565b60600151905090565b6000613a60613b3e565b6001600160a01b03166323257c2b6000805160206154a9833981519152613a8685614fb8565b6040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613ac157600080fd5b505afa158015613ad5573d6000803e3d6000fd5b505050506040513d6020811015613aeb57600080fd5b505192915050565b6000546001600160a01b03163314613b3c5760405162461bcd60e51b815260040180806020018281038252602f81526020018061547a602f913960400191505060405180910390fd5b565b60006110d66e466c657869626c6553746f7261676560881b615338565b6000613b65613b3e565b6001600160a01b03166323257c2b6000805160206154a98339815191526f696e746572616374696f6e44656c617960801b8560405160200180838152602001826001600160a01b03166001600160a01b031660601b815260140192505050604051602081830303815290604052805190602001206040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613ac157600080fd5b6000613c1e613b3e565b6001600160a01b03166323257c2b6000805160206154a98339815191526e1c985d1954dd185b1954195c9a5bd9608a1b6040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613c8957600080fd5b505afa1580156122d8573d6000803e3d6000fd5b6000613ca7613b3e565b6001600160a01b03166323257c2b6000805160206154a9833981519152766574686572577261707065724d696e744665655261746560481b6040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613c8957600080fd5b6000613d24613b3e565b6001600160a01b03166323257c2b6000805160206154a98339815191527573656c664c69717569646174696f6e50656e616c747960501b6040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613c8957600080fd5b6000613da0613b3e565b6001600160a01b03166323257c2b6000805160206154a98339815191526f6c69717569646174696f6e526174696f60801b6040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613c8957600080fd5b6000613e16613b3e565b6001600160a01b03166323257c2b6000805160206154a98339815191526f777261707065724d6178546f6b656e7360801b8560405160200180838152602001826001600160a01b03166001600160a01b031660601b815260140192505050604051602081830303815290604052805190602001206040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613ac157600080fd5b6000613ecf613b3e565b6001600160a01b03166323257c2b6000805160206154a9833981519152703332b2a832b934b7b2223ab930ba34b7b760791b6040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613c8957600080fd5b6000613f46613b3e565b6001600160a01b03166323257c2b6000805160206154a9833981519152716c69717569646174696f6e50656e616c747960701b6040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613c8957600080fd5b6000613fbe613b3e565b6001600160a01b03166323257c2b6000805160206154a98339815191526f6d696e696d756d5374616b6554696d6560801b6040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613c8957600080fd5b6000614034613b3e565b6001600160a01b03166323257c2b6000805160206154a98339815191527461746f6d696345786368616e67654665655261746560581b856040516020018083815260200182815260200192505050604051602081830303815290604052805190602001206040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613ac157600080fd5b60006140dd613b3e565b6001600160a01b031663c4f610ed6000805160206154a983398151915271777261707065724d696e744665655261746560701b8560405160200180838152602001826001600160a01b03166001600160a01b031660601b815260140192505050604051602081830303815290604052805190602001206040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613ac157600080fd5b6000614198613b3e565b6001600160a01b03166323257c2b6000805160206154a98339815191526e1b1a5c5d5a59185d1954995dd85c99608a1b6040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613c8957600080fd5b600061420d613b3e565b6001600160a01b031663d994502d6000805160206154a98339815191527f70757265436861696e6c696e6b466f7241746f6d696373456e61626c65640000856040516020018083815260200182815260200192505050604051602081830303815290604052805190602001206040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613ac157600080fd5b60006142be613b3e565b6001600160a01b03166323257c2b6000805160206154a98339815191527f7072696365446576696174696f6e5468726573686f6c64466163746f720000006040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613c8957600080fd5b6000614341613b3e565b6001600160a01b0316639ee5955a6000805160206154a98339815191527561676772656761746f725761726e696e67466c61677360501b6040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613c8957600080fd5b6143bb61541c565b60408051600480825260a08201909252606091602082016080803883390190505090507f65786368616e676544796e616d69634665655468726573686f6c6400000000008160008151811061440c57fe5b6020026020010181815250507f65786368616e676544796e616d696346656557656967687444656361790000008160018151811061444657fe5b6020026020010181815250507765786368616e676544796e616d6963466565526f756e647360401b8160028151811061447b57fe5b6020026020010181815250507465786368616e67654d617844796e616d696346656560581b816003815181106144ad57fe5b60200260200101818152505060606144c3613b3e565b6001600160a01b031663b67fa7ed6000805160206154a9833981519152846040518363ffffffff1660e01b81526004018083815260200180602001828103825283818151815260200191508051906020019060200280838360005b8381101561453657818101518382015260200161451e565b50505050905001935050505060006040518083038186803b15801561455a57600080fd5b505afa15801561456e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052602081101561459757600080fd5b81019080805160405193929190846401000000008211156145b757600080fd5b9083019060208201858111156145cc57600080fd5b82518660208202830111640100000000821117156145e957600080fd5b82525081516020918201928201910280838360005b838110156146165781810151838201526020016145fe565b50505050905001604052505050905060405180608001604052808260008151811061463d57fe5b602002602001015181526020018260018151811061465757fe5b602002602001015181526020018260028151811061467157fe5b602002602001015181526020018260038151811061468b57fe5b60200260200101518152509250505090565b60006146a7613b3e565b6001600160a01b03166323257c2b6000805160206154a98339815191526e636f6c6c617073654665655261746560881b8560405160200180838152602001826001600160a01b03166001600160a01b031660601b815260140192505050604051602081830303815290604052805190602001206040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613ac157600080fd5b600061475f613b3e565b6001600160a01b03166323257c2b6000805160206154a98339815191526f61746f6d69635477617057696e646f7760801b6040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613c8957600080fd5b60006147d5613b3e565b6001600160a01b031663c4f610ed6000805160206154a983398151915271777261707065724275726e4665655261746560701b8560405160200180838152602001826001600160a01b03166001600160a01b031660601b815260140192505050604051602081830303815290604052805190602001206040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613ac157600080fd5b6000614890613b3e565b6001600160a01b03166323257c2b6000805160206154a983398151915269199b1859d4995dd85c9960b21b6040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613c8957600080fd5b6000614900613b3e565b6001600160a01b03166323257c2b6000805160206154a98339815191527077616974696e67506572696f645365637360781b6040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613c8957600080fd5b6000614977613b3e565b6001600160a01b03166323257c2b6000805160206154a9833981519152766574686572577261707065724275726e4665655261746560481b6040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613c8957600080fd5b60006149f4613b3e565b6001600160a01b03166323257c2b6000805160206154a983398151915274736e784c69717569646174696f6e50656e616c747960581b6040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613c8957600080fd5b6000614a6f613b3e565b6001600160a01b03166323257c2b6000805160206154a98339815191526c69737375616e6365526174696f60981b6040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613c8957600080fd5b6000614ae2613b3e565b6001600160a01b03166323257c2b6000805160206154a98339815191526e65786368616e67654665655261746560881b856040516020018083815260200182815260200192505050604051602081830303815290604052805190602001206040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613ac157600080fd5b6000614b85613b3e565b6001600160a01b03166323257c2b6000805160206154a983398151915277185d1bdb5a58d59bdb155c19185d19551a1c995cda1bdb1960421b856040516020018083815260200182815260200192505050604051602081830303815290604052805190602001206040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613ac157600080fd5b6000614c31613b3e565b6001600160a01b03166323257c2b6000805160206154a98339815191526f6c69717569646174696f6e44656c617960801b6040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613c8957600080fd5b6000614ca7613b3e565b6001600160a01b03166323257c2b6000805160206154a98339815191527661746f6d69634d6178566f6c756d65506572426c6f636b60481b6040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613c8957600080fd5b6000614d24613b3e565b6001600160a01b03166323257c2b6000805160206154a98339815191527f61746f6d6963566f6c436f6e73696465726174696f6e57696e646f7700000000856040516020018083815260200182815260200192505050604051602081830303815290604052805190602001206040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613ac157600080fd5b6000614dd5613b3e565b6001600160a01b03166323257c2b6000805160206154a98339815191527464656274536e617073686f745374616c6554696d6560581b6040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613c8957600080fd5b6000614e50613b3e565b6001600160a01b03166323257c2b6000805160206154a9833981519152710cae8d0cae4aee4c2e0e0cae49ac2f08aa8960731b6040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613c8957600080fd5b6000614ec8613b3e565b6001600160a01b031663d994502d6000805160206154a9833981519152741d1c98591a5b99d4995dd85c991cd15b98589b1959605a1b6040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613c8957600080fd5b6000614f43613b3e565b6001600160a01b03166323257c2b6000805160206154a9833981519152783634b8bab4b230ba34b7b722b9b1b937bba23ab930ba34b7b760391b6040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613c8957600080fd5b600080826005811115614fc757fe5b1415614ff457507f63726f7373446f6d61696e4465706f7369744761734c696d6974000000000000610e2c565b600182600581111561500257fe5b141561502f57507f63726f7373446f6d61696e457363726f774761734c696d697400000000000000610e2c565b600282600581111561503d57fe5b141561506a57507f63726f7373446f6d61696e5265776172644761734c696d697400000000000000610e2c565b600382600581111561507857fe5b14156150a557507f63726f7373446f6d61696e5769746864726177616c4761734c696d6974000000610e2c565b60058260058111156150b357fe5b14156150e057507f63726f7373446f6d61696e52656c61794761734c696d69740000000000000000610e2c565b60048260058111156150ee57fe5b141561511b57507f63726f7373446f6d61696e436c6f73654761734c696d69740000000000000000610e2c565b6040805162461bcd60e51b8152602060048201526016602482015275556e6b6e6f776e20676173206c696d6974207479706560501b604482015290519081900360640190fd5b600061516b613b3e565b6001600160a01b03166323257c2b6000805160206154a98339815191526e1d185c99d95d151a1c995cda1bdb19608a1b6040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613c8957600080fd5b60006151e0613b3e565b6001600160a01b03166323257c2b6000805160206154a98339815191527f63726f7373436861696e53796e74685472616e73666572456e61626c65640000856040516020018083815260200182815260200192505050604051602081830303815290604052805190602001206040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613ac157600080fd5b6000615291613b3e565b6001600160a01b0316639ee5955a6000805160206154a98339815191527f61746f6d69634571756976616c656e74466f7244657850726963696e67000000856040516020018083815260200182815260200192505050604051602081830303815290604052805190602001206040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b158015613ac157600080fd5b600081815260036020908152604080832054815170026b4b9b9b4b7339030b2323932b9b99d1607d1b9381019390935260318084018690528251808503909101815260519093019091526001600160a01b031690816154155760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156153da5781810151838201526020016153c2565b50505050905090810190601f1680156154075780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5092915050565b604051806080016040528060008152602001600081526020016000815260200160008152509056fe596f75206d757374206265206e6f6d696e61746564206265666f726520796f752063616e20616363657074206f776e6572736869704f6e6c792074686520636f6e7472616374206f776e6572206d617920706572666f726d207468697320616374696f6e53797374656d53657474696e6773000000000000000000000000000000000000a265627a7a72315820032bfd705d71b297711677cb27c167eb44b71f1642e213a4cb432d6e92fceaa764736f6c6343000510003200000000000000000000000048914229dedd5a9922f44441ffccfc2cb7856ee900000000000000000000000058719e8ef4d201541e44505a2acb3424481d6681
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000048914229dedd5a9922f44441ffccfc2cb7856ee900000000000000000000000058719e8ef4d201541e44505a2acb3424481d6681
-----Decoded View---------------
Arg [0] : _owner (address): 0x48914229deDd5A9922f44441ffCCfC2Cb7856Ee9
Arg [1] : _resolver (address): 0x58719E8Ef4d201541e44505a2ACB3424481d6681
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 00000000000000000000000048914229dedd5a9922f44441ffccfc2cb7856ee9
Arg [1] : 00000000000000000000000058719e8ef4d201541e44505a2acb3424481d6681
Libraries Used
SafeDecimalMath : 0xb6a200136891be1c881431320e4092953788c7e0SystemSettingsLib : 0x52c339d07e82d49073f6b85ab033599e0eb644f9SignedSafeDecimalMath : 0xbfe5da86981e2db461bd85d31795ad233748ee32ExchangeSettlementLib : 0xa4d8e25579fc765ff1963dd37132061599c61689
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.