Overview
ETH Balance
0 ETH
ETH Value
$0.00More Info
Private Name Tags
ContractCreator
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
SystemSettingsLib
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 optimistic.etherscan.io on 2022-02-09 */ /* ____ __ __ __ _ / __/__ __ ___ / /_ / / ___ / /_ (_)__ __ _\ \ / // // _ \/ __// _ \/ -_)/ __// / \ \ / /___/ \_, //_//_/\__//_//_/\__/ \__//_/ /_\_\ /___/ * Synthetix: SystemSettingsLib.sol * * Latest source (may be newer): https://github.com/Synthetixio/synthetix/blob/master/contracts/SystemSettingsLib.sol * Docs: https://docs.synthetix.io/contracts/SystemSettingsLib * * Contract Dependencies: (none) * 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.4.24; // 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; } /** * @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 = 1e18 / 4; // Max 25% liquidation penalty / bonus uint public constant MAX_LIQUIDATION_DELAY = 30 days; uint public constant MIN_LIQUIDATION_DELAY = 1 days; // 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 = 8e6; 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 30 days"); require(time >= MIN_LIQUIDATION_DELAY, "Must be greater than 1 day"); flexibleStorage.setUIntValue(SETTINGS_CONTRACT_NAME, settingName, time); } function setLiquidationRatio( IFlexibleStorage flexibleStorage, bytes32 settingName, uint _liquidationRatio, uint getLiquidationPenalty, uint getIssuanceRatio ) external { require( _liquidationRatio <= MAX_LIQUIDATION_RATIO.divideDecimal(SafeDecimalMath.unit().add(getLiquidationPenalty)), "liquidationRatio > MAX_LIQUIDATION_RATIO / (1 + penalty)" ); // MIN_LIQUIDATION_RATIO is a product of target issuance ratio * RATIO_FROM_TARGET_BUFFER // Ensures that liquidation ratio is set so that there is a buffer between the issuance ratio and liquidation ratio. uint MIN_LIQUIDATION_RATIO = getIssuanceRatio.multiplyDecimal(RATIO_FROM_TARGET_BUFFER); require(_liquidationRatio >= MIN_LIQUIDATION_RATIO, "liquidationRatio < MIN_LIQUIDATION_RATIO"); flexibleStorage.setUIntValue(SETTINGS_CONTRACT_NAME, settingName, _liquidationRatio); } function 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 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 setAtomicPriceBuffer( IFlexibleStorage flexibleStorage, bytes32 settingName, bytes32 _currencyKey, uint _buffer ) external { flexibleStorage.setUIntValue( SETTINGS_CONTRACT_NAME, keccak256(abi.encodePacked(settingName, _currencyKey)), _buffer ); } 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 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); } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"constant":true,"inputs":[],"name":"MAX_ATOMIC_TWAP_WINDOW","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MAX_ATOMIC_VOLATILITY_CONSIDERATION_WINDOW","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MAX_ATOMIC_VOLUME_PER_BLOCK","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MAX_CROSS_DOMAIN_GAS_LIMIT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MAX_EXCHANGE_FEE_RATE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MAX_FEE_PERIOD_DURATION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MAX_ISSUANCE_RATIO","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MAX_LIQUIDATION_DELAY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MAX_LIQUIDATION_PENALTY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MAX_LIQUIDATION_RATIO","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MAX_MINIMUM_STAKE_TIME","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MAX_TARGET_THRESHOLD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MAX_WRAPPER_BURN_FEE_RATE","outputs":[{"internalType":"int256","name":"","type":"int256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MAX_WRAPPER_MINT_FEE_RATE","outputs":[{"internalType":"int256","name":"","type":"int256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MIN_ATOMIC_TWAP_WINDOW","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MIN_ATOMIC_VOLATILITY_CONSIDERATION_WINDOW","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MIN_CROSS_DOMAIN_GAS_LIMIT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MIN_FEE_PERIOD_DURATION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MIN_LIQUIDATION_DELAY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"RATIO_FROM_TARGET_BUFFER","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"SETTINGS_CONTRACT_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"contractName","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"}]
Contract Creation Code
612106610026600b82828239805160001a60731461001957fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106103315760003560e01c806394286a1e116101c2578063c58c9ae41161010e578063f02d9a5b116100ac578063fb1b4c7e11610086578063fb1b4c7e14610a58578063fbfd964614610a60578063fd194a3514610350578063fe250a5514610aa757610331565b8063f02d9a5b14610a09578063f1076b2514610a48578063f344da6714610a5057610331565b8063d9158b03116100e8578063d9158b0314610983578063da91c7b814610782578063e6abf7cc146109c2578063e78e6bb914610a0157610331565b8063c58c9ae41461097b578063d4aebcef14610350578063d62ae3991461089457610331565b8063add0989d1161017b578063b3ebdca411610155578063b3ebdca4146108ac578063c264b8f3146106e2578063c35b995c146108eb578063c404a0de1461092e57610331565b8063add0989d14610894578063af8bc660146108a4578063b2ea7054146106e257610331565b806394286a1e1461088c57806398be8e3f146108945780639f91787d1461088c578063a4ce5b711461089c578063a6c4611014610350578063aad237391461089457610331565b806363daca09116102815780637ce2cc7f1161023a5780638134ddb7116102145780638134ddb714610808578063834f26de146103505780638ab5a4a2146106e257806392dabaf21461084d57610331565b80637ce2cc7f1461077a5780637e1ba6a4146107825780637eb29414146107c957610331565b806363daca09146106a3578063657c6dc7146106e25780636d4851f1146106ea57806372c6c3411461072957806375d0c0dc146107315780637c1d99d61461073957610331565b806321d0b6ce116102ee57806353c0bf1c116102c857806353c0bf1c146105c2578063580a975c1461060f5780635d3045ab146106175780635f7ad8711461065c57610331565b806321d0b6ce1461053e57806333ddab6814610583578063446ca4fd1461053e57610331565b8063085f95cd146103365780630e7bf1c51461035057806310ada7201461039157806311d78c0c146103d057806319305b3c1461041b5780631a5bb1f71461045a575b600080fd5b61033e610ae6565b60408051918252519081900360200190f35b81801561035c57600080fd5b5061038f6004803603606081101561037357600080fd5b506001600160a01b038135169060208101359060400135610af2565b005b81801561039d57600080fd5b5061033e600480360360608110156103b457600080fd5b506001600160a01b038135169060208101359060400135610b75565b8180156103dc57600080fd5b5061038f600480360360a08110156103f357600080fd5b506001600160a01b038135169060208101359060408101359060608101359060800135610cdb565b81801561042757600080fd5b5061038f6004803603606081101561043e57600080fd5b506001600160a01b038135169060208101359060400135610e92565b81801561046657600080fd5b5061038f6004803603608081101561047d57600080fd5b6001600160a01b03823516916020810135918101906060810160408201356401000000008111156104ad57600080fd5b8201836020820111156104bf57600080fd5b803590602001918460208302840111640100000000831117156104e157600080fd5b9193909290916020810190356401000000008111156104ff57600080fd5b82018360208201111561051157600080fd5b8035906020019184602083028401116401000000008311171561053357600080fd5b509092509050610ed8565b81801561054a57600080fd5b5061038f6004803603608081101561056157600080fd5b506001600160a01b038135169060208101359060408101359060600135611083565b81801561058f57600080fd5b5061038f600480360360608110156105a657600080fd5b506001600160a01b03813516906020810135906040013561112b565b8180156105ce57600080fd5b5061038f600480360360a08110156105e557600080fd5b506001600160a01b03813581169160208101359160408201351690606081013590608001356111ad565b61033e61136f565b81801561062357600080fd5b5061038f6004803603608081101561063a57600080fd5b506001600160a01b038135169060208101359060408101359060600135611376565b81801561066857600080fd5b5061038f6004803603608081101561067f57600080fd5b506001600160a01b03813581169160208101359160408201359160600135166113fe565b8180156106af57600080fd5b5061038f600480360360608110156106c657600080fd5b506001600160a01b0381351690602081013590604001356114e6565b61033e611596565b8180156106f657600080fd5b5061038f6004803603606081101561070d57600080fd5b506001600160a01b0381351690602081013590604001356115a2565b61033e6115e9565b61033e6115fe565b81801561074557600080fd5b5061038f6004803603606081101561075c57600080fd5b506001600160a01b0381351690602081013590604001351515611613565b61033e61167a565b81801561078e57600080fd5b5061038f600480360360808110156107a557600080fd5b506001600160a01b0381358116916020810135916040820135169060600135611681565b8180156107d557600080fd5b5061038f600480360360608110156107ec57600080fd5b506001600160a01b03813516906020810135906040013561171e565b81801561081457600080fd5b5061038f6004803603608081101561082b57600080fd5b506001600160a01b038135169060208101359060408101359060600135611765565b81801561085957600080fd5b5061038f6004803603606081101561087057600080fd5b506001600160a01b0381351690602081013590604001356117c2565b61033e61181f565b61033e611824565b61033e61182b565b61033e611837565b8180156108b857600080fd5b5061038f600480360360608110156108cf57600080fd5b506001600160a01b03813516906020810135906040013561183c565b8180156108f757600080fd5b5061038f6004803603606081101561090e57600080fd5b506001600160a01b038135811691602081013591604090910135166118ec565b81801561093a57600080fd5b5061038f600480360360a081101561095157600080fd5b506001600160a01b03813581169160208101359160408201351690606081013590608001356119b0565b61033e611ab6565b81801561098f57600080fd5b5061038f600480360360608110156109a657600080fd5b506001600160a01b038135169060208101359060400135611abd565b8180156109ce57600080fd5b5061038f600480360360608110156109e557600080fd5b506001600160a01b038135169060208101359060400135611b15565b61033e611bc4565b818015610a1557600080fd5b5061038f60048036036060811015610a2c57600080fd5b506001600160a01b038135169060208101359060400135611bcf565b61033e611c36565b61033e611c3d565b61033e611c44565b818015610a6c57600080fd5b5061038f60048036036080811015610a8357600080fd5b506001600160a01b0381358116916020810135916040820135169060600135611c50565b818015610ab357600080fd5b5061038f60048036036060811015610aca57600080fd5b506001600160a01b038135169060208101359060400135611d05565b6703782dace9d9000081565b60408051631d5b277f60e01b81526d53797374656d53657474696e677360901b6004820152602481018490526044810183905290516001600160a01b03851691631d5b277f91606480830192600092919082900301818387803b158015610b5857600080fd5b505af1158015610b6c573d6000803e3d6000fd5b50505050505050565b60006032821115610bc2576040805162461bcd60e51b81526020600482015260126024820152710a8d0e4cae6d0ded8c840e8dede40d0d2ced60731b604482015290519081900360640190fd5b610c536064610c47730142f40c25ce1f1177ed131101fa19217396cb8863907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b158015610c0e57600080fd5b505af4158015610c22573d6000803e3d6000fd5b505050506040513d6020811015610c3857600080fd5b5051859063ffffffff611d6216565b9063ffffffff611dc416565b9050836001600160a01b0316631d5b277f6d53797374656d53657474696e677360901b85846040518463ffffffff1660e01b8152600401808481526020018381526020018281526020019350505050600060405180830381600087803b158015610cbc57600080fd5b505af1158015610cd0573d6000803e3d6000fd5b505050509392505050565b610d73610d5e83730142f40c25ce1f1177ed131101fa19217396cb8863907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b158015610d2657600080fd5b505af4158015610d3a573d6000803e3d6000fd5b505050506040513d6020811015610d5057600080fd5b50519063ffffffff611e2e16565b670de0b6b3a76400009063ffffffff611e8816565b831115610db15760405162461bcd60e51b8152600401808060200182810382526038815260200180611f136038913960400191505060405180910390fd5b6000610dcb82671bc16d674ec8000063ffffffff611ea616565b905080841015610e0c5760405162461bcd60e51b81526004018080602001828103825260288152602001806120486028913960400191505060405180910390fd5b60408051631d5b277f60e01b81526d53797374656d53657474696e677360901b6004820152602481018790526044810186905290516001600160a01b03881691631d5b277f91606480830192600092919082900301818387803b158015610e7257600080fd5b505af1158015610e86573d6000803e3d6000fd5b50505050505050505050565b6001600160c01b03811115610af25760405162461bcd60e51b8152600401808060200182810382526028815260200180611f6c6028913960400191505060405180910390fd5b828114610f2c576040805162461bcd60e51b815260206004820152601860248201527f4172726179206c656e6774687320646f6e74206d617463680000000000000000604482015290519081900360640190fd5b60005b83811015610b6c5767016345785d8a0000838383818110610f4c57fe5b905060200201351115610fa6576040805162461bcd60e51b815260206004820152601e60248201527f4d41585f45584348414e47455f4645455f524154452065786365656465640000604482015290519081900360640190fd5b866001600160a01b0316631d5b277f6d53797374656d53657474696e677360901b88888886818110610fd457fe5b9050602002013560405160200180838152602001828152602001925050506040516020818303038152906040528051906020012086868681811061101457fe5b905060200201356040518463ffffffff1660e01b8152600401808481526020018381526020018281526020019350505050600060405180830381600087803b15801561105f57600080fd5b505af1158015611073573d6000803e3d6000fd5b505060019092019150610f2f9050565b6040805160208082018690528183018590528251808303840181526060830180855281519190920120631d5b277f60e01b9091526d53797374656d53657474696e677360901b6064830152608482015260a4810183905290516001600160a01b03861691631d5b277f9160c480830192600092919082900301818387803b15801561110d57600080fd5b505af1158015611121573d6000803e3d6000fd5b5050505050505050565b603c81101561116b5760405162461bcd60e51b8152600401808060200182810382526026815260200180611fef6026913960400191505060405180910390fd5b62015180811115610af25760405162461bcd60e51b81526004018080602001828103825260278152602001806120706027913960400191505060405180910390fd5b670de0b6b3a764000082131561120a576040805162461bcd60e51b815260206004820181905260248201527f72617465203e204d41585f575241505045525f4d494e545f4645455f52415445604482015290519081900360640190fd5b670de0b6b3a763ffff198212156112525760405162461bcd60e51b8152600401808060200182810382526021815260200180611f4b6021913960400191505060405180910390fd5b60008212156112b357808260000313156112b3576040805162461bcd60e51b815260206004820152601a60248201527f2d72617465203e20777261707065724275726e46656552617465000000000000604482015290519081900360640190fd5b6040805160208082018790526bffffffffffffffffffffffff19606087901b168284015282516034818403018152605483018085528151919092012063d71a9b0160e01b9091526d53797374656d53657474696e677360901b605883015260788201526098810184905290516001600160a01b0387169163d71a9b019160b880830192600092919082900301818387803b15801561135057600080fd5b505af1158015611364573d6000803e3d6000fd5b505050505050505050565b62093a8081565b801561108357603c8110156113bc5760405162461bcd60e51b815260040180806020018281038252603a815260200180611fb5603a913960400191505060405180910390fd5b620151808111156110835760405162461bcd60e51b815260040180806020018281038252603b815260200180612097603b913960400191505060405180910390fd5b6001600160a01b038116611459576040805162461bcd60e51b815260206004820152601e60248201527f41746f6d6963206571756976616c656e74206973203020616464726573730000604482015290519081900360640190fd5b60408051602080820186905281830185905282518083038401815260608301808552815191909201206309b9412f60e31b9091526d53797374656d53657474696e677360901b606483015260848201526001600160a01b0383811660a4830152915191861691634dca09789160c48082019260009290919082900301818387803b15801561110d57600080fd5b6201518081101561153e576040805162461bcd60e51b815260206004820152601f60248201527f76616c7565203c204d494e5f4645455f504552494f445f4455524154494f4e00604482015290519081900360640190fd5b624f1a00811115610af2576040805162461bcd60e51b815260206004820152601f60248201527f76616c7565203e204d41585f4645455f504552494f445f4455524154494f4e00604482015290519081900360640190fd5b670de0b6b3a764000081565b670de0b6b3a7640000811115610af25760405162461bcd60e51b81526004018080602001828103825260338152602001806120156033913960400191505060405180910390fd5b6d53797374656d53657474696e677360901b81565b6d53797374656d53657474696e677360901b90565b60408051630fca29bf60e21b81526d53797374656d53657474696e677360901b600482015260248101849052821515604482015290516001600160a01b03851691633f28a6fc91606480830192600092919082900301818387803b158015610b5857600080fd5b622dc6c081565b6040805160208082018690526bffffffffffffffffffffffff19606086901b1682840152825160348184030181526054830180855281519190920120631d5b277f60e01b9091526d53797374656d53657474696e677360901b605883015260788201526098810183905290516001600160a01b03861691631d5b277f9160b880830192600092919082900301818387803b15801561110d57600080fd5b6703782dace9d90000811115610af25760405162461bcd60e51b8152600401808060200182810382526021815260200180611ed16021913960400191505060405180910390fd5b67016345785d8a0000811115611083576040805162461bcd60e51b815260206004820152601e60248201527f4d41585f45584348414e47455f4645455f524154452065786365656465640000604482015290519081900360640190fd5b670de0b6b3a7640000811115610af2576040805162461bcd60e51b815260206004820181905260248201527f72617465203e204d41585f575241505045525f4255524e5f4645455f52415445604482015290519081900360640190fd5b603c81565b6201518081565b671bc16d674ec8000081565b603281565b62278d00811115611894576040805162461bcd60e51b815260206004820152601960248201527f4d757374206265206c657373207468616e203330206461797300000000000000604482015290519081900360640190fd5b62015180811015610af2576040805162461bcd60e51b815260206004820152601a60248201527f4d7573742062652067726561746572207468616e203120646179000000000000604482015290519081900360640190fd5b6001600160a01b038116611947576040805162461bcd60e51b815260206004820152601b60248201527f56616c69642061646472657373206d75737420626520676976656e0000000000604482015290519081900360640190fd5b604080516309b9412f60e31b81526d53797374656d53657474696e677360901b6004820152602481018490526001600160a01b038381166044830152915191851691634dca09789160648082019260009290919082900301818387803b158015610b5857600080fd5b670de0b6b3a7640000821315611a0d576040805162461bcd60e51b815260206004820181905260248201527f72617465203e204d41585f575241505045525f4255524e5f4645455f52415445604482015290519081900360640190fd5b670de0b6b3a763ffff19821215611a555760405162461bcd60e51b8152600401808060200182810382526021815260200180611ef26021913960400191505060405180910390fd5b60008212156112b357808260000313156112b3576040805162461bcd60e51b815260206004820152601a60248201527f2d72617465203e20777261707065724d696e7446656552617465000000000000604482015290519081900360640190fd5b627a120081565b62093a80811115610af2576040805162461bcd60e51b815260206004820181905260248201527f7374616b652074696d6520657863656564206d6178696d756d2031207765656b604482015290519081900360640190fd5b80611b67576040805162461bcd60e51b815260206004820152601b60248201527f4d61782064796e616d6963206665652063616e6e6f7420626520300000000000604482015290519081900360640190fd5b67016345785d8a0000811115610af2576040805162461bcd60e51b815260206004820152601e60248201527f4d41585f45584348414e47455f4645455f524154452065786365656465640000604482015290519081900360640190fd5b6001600160c01b0381565b622dc6c08110158015611be55750627a12008111155b610af2576040805162461bcd60e51b815260206004820152601d60248201527f4f7574206f662072616e67652078446f6d61696e206761734c696d6974000000604482015290519081900360640190fd5b62278d0081565b624f1a0081565b67016345785d8a000081565b730142f40c25ce1f1177ed131101fa19217396cb8863907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b158015611c9457600080fd5b505af4158015611ca8573d6000803e3d6000fd5b505050506040513d6020811015611cbe57600080fd5b5051610e1002811115611681576040805162461bcd60e51b815260206004820152600a60248201526926b0bc1018903437bab960b11b604482015290519081900360640190fd5b670de0b6b3a7640000811115610af2576040805162461bcd60e51b815260206004820181905260248201527f72617465203e204d41585f575241505045525f4d494e545f4645455f52415445604482015290519081900360640190fd5b600082611d7157506000611dbe565b82820282848281611d7e57fe5b0414611dbb5760405162461bcd60e51b8152600401808060200182810382526021815260200180611f946021913960400191505060405180910390fd5b90505b92915050565b6000808211611e1a576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b6000828481611e2557fe5b04949350505050565b600082820183811015611dbb576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000611dbb82610c4785670de0b6b3a764000063ffffffff611d6216565b6000670de0b6b3a7640000611ec1848463ffffffff611d6216565b81611ec857fe5b04939250505056fe70656e616c7479203e204d41585f4c49515549444154494f4e5f50454e414c545972617465203c202d4d41585f575241505045525f4255524e5f4645455f524154456c69717569646174696f6e526174696f203e204d41585f4c49515549444154494f4e5f524154494f202f202831202b2070656e616c74792972617465203c202d4d41585f575241505045525f4d494e545f4645455f5241544541746f6d6963206d617820766f6c756d6520657863656564206d6178696d756d2075696e74313932536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7741746f6d696320766f6c6174696c69747920636f6e73696465726174696f6e2077696e646f7720756e646572206d696e696d756d2031206d696e41746f6d696320747761702077696e646f7720756e646572206d696e696d756d2031206d696e4e65772069737375616e636520726174696f2063616e6e6f7420657863656564204d41585f49535355414e43455f524154494f6c69717569646174696f6e526174696f203c204d494e5f4c49515549444154494f4e5f524154494f41746f6d696320747761702077696e646f7720657863656564206d6178696d756d20312064617941746f6d696320766f6c6174696c69747920636f6e73696465726174696f6e2077696e646f7720657863656564206d6178696d756d203120646179a265627a7a72315820eedaf74d5402da0b714c33936100228ebf45ebc421e03b93387d48e858fe60af64736f6c63430005100032
Deployed Bytecode
0x73478d479bac034f89fa28d8d2ab430ec973a3a0ac30146080604052600436106103315760003560e01c806394286a1e116101c2578063c58c9ae41161010e578063f02d9a5b116100ac578063fb1b4c7e11610086578063fb1b4c7e14610a58578063fbfd964614610a60578063fd194a3514610350578063fe250a5514610aa757610331565b8063f02d9a5b14610a09578063f1076b2514610a48578063f344da6714610a5057610331565b8063d9158b03116100e8578063d9158b0314610983578063da91c7b814610782578063e6abf7cc146109c2578063e78e6bb914610a0157610331565b8063c58c9ae41461097b578063d4aebcef14610350578063d62ae3991461089457610331565b8063add0989d1161017b578063b3ebdca411610155578063b3ebdca4146108ac578063c264b8f3146106e2578063c35b995c146108eb578063c404a0de1461092e57610331565b8063add0989d14610894578063af8bc660146108a4578063b2ea7054146106e257610331565b806394286a1e1461088c57806398be8e3f146108945780639f91787d1461088c578063a4ce5b711461089c578063a6c4611014610350578063aad237391461089457610331565b806363daca09116102815780637ce2cc7f1161023a5780638134ddb7116102145780638134ddb714610808578063834f26de146103505780638ab5a4a2146106e257806392dabaf21461084d57610331565b80637ce2cc7f1461077a5780637e1ba6a4146107825780637eb29414146107c957610331565b806363daca09146106a3578063657c6dc7146106e25780636d4851f1146106ea57806372c6c3411461072957806375d0c0dc146107315780637c1d99d61461073957610331565b806321d0b6ce116102ee57806353c0bf1c116102c857806353c0bf1c146105c2578063580a975c1461060f5780635d3045ab146106175780635f7ad8711461065c57610331565b806321d0b6ce1461053e57806333ddab6814610583578063446ca4fd1461053e57610331565b8063085f95cd146103365780630e7bf1c51461035057806310ada7201461039157806311d78c0c146103d057806319305b3c1461041b5780631a5bb1f71461045a575b600080fd5b61033e610ae6565b60408051918252519081900360200190f35b81801561035c57600080fd5b5061038f6004803603606081101561037357600080fd5b506001600160a01b038135169060208101359060400135610af2565b005b81801561039d57600080fd5b5061033e600480360360608110156103b457600080fd5b506001600160a01b038135169060208101359060400135610b75565b8180156103dc57600080fd5b5061038f600480360360a08110156103f357600080fd5b506001600160a01b038135169060208101359060408101359060608101359060800135610cdb565b81801561042757600080fd5b5061038f6004803603606081101561043e57600080fd5b506001600160a01b038135169060208101359060400135610e92565b81801561046657600080fd5b5061038f6004803603608081101561047d57600080fd5b6001600160a01b03823516916020810135918101906060810160408201356401000000008111156104ad57600080fd5b8201836020820111156104bf57600080fd5b803590602001918460208302840111640100000000831117156104e157600080fd5b9193909290916020810190356401000000008111156104ff57600080fd5b82018360208201111561051157600080fd5b8035906020019184602083028401116401000000008311171561053357600080fd5b509092509050610ed8565b81801561054a57600080fd5b5061038f6004803603608081101561056157600080fd5b506001600160a01b038135169060208101359060408101359060600135611083565b81801561058f57600080fd5b5061038f600480360360608110156105a657600080fd5b506001600160a01b03813516906020810135906040013561112b565b8180156105ce57600080fd5b5061038f600480360360a08110156105e557600080fd5b506001600160a01b03813581169160208101359160408201351690606081013590608001356111ad565b61033e61136f565b81801561062357600080fd5b5061038f6004803603608081101561063a57600080fd5b506001600160a01b038135169060208101359060408101359060600135611376565b81801561066857600080fd5b5061038f6004803603608081101561067f57600080fd5b506001600160a01b03813581169160208101359160408201359160600135166113fe565b8180156106af57600080fd5b5061038f600480360360608110156106c657600080fd5b506001600160a01b0381351690602081013590604001356114e6565b61033e611596565b8180156106f657600080fd5b5061038f6004803603606081101561070d57600080fd5b506001600160a01b0381351690602081013590604001356115a2565b61033e6115e9565b61033e6115fe565b81801561074557600080fd5b5061038f6004803603606081101561075c57600080fd5b506001600160a01b0381351690602081013590604001351515611613565b61033e61167a565b81801561078e57600080fd5b5061038f600480360360808110156107a557600080fd5b506001600160a01b0381358116916020810135916040820135169060600135611681565b8180156107d557600080fd5b5061038f600480360360608110156107ec57600080fd5b506001600160a01b03813516906020810135906040013561171e565b81801561081457600080fd5b5061038f6004803603608081101561082b57600080fd5b506001600160a01b038135169060208101359060408101359060600135611765565b81801561085957600080fd5b5061038f6004803603606081101561087057600080fd5b506001600160a01b0381351690602081013590604001356117c2565b61033e61181f565b61033e611824565b61033e61182b565b61033e611837565b8180156108b857600080fd5b5061038f600480360360608110156108cf57600080fd5b506001600160a01b03813516906020810135906040013561183c565b8180156108f757600080fd5b5061038f6004803603606081101561090e57600080fd5b506001600160a01b038135811691602081013591604090910135166118ec565b81801561093a57600080fd5b5061038f600480360360a081101561095157600080fd5b506001600160a01b03813581169160208101359160408201351690606081013590608001356119b0565b61033e611ab6565b81801561098f57600080fd5b5061038f600480360360608110156109a657600080fd5b506001600160a01b038135169060208101359060400135611abd565b8180156109ce57600080fd5b5061038f600480360360608110156109e557600080fd5b506001600160a01b038135169060208101359060400135611b15565b61033e611bc4565b818015610a1557600080fd5b5061038f60048036036060811015610a2c57600080fd5b506001600160a01b038135169060208101359060400135611bcf565b61033e611c36565b61033e611c3d565b61033e611c44565b818015610a6c57600080fd5b5061038f60048036036080811015610a8357600080fd5b506001600160a01b0381358116916020810135916040820135169060600135611c50565b818015610ab357600080fd5b5061038f60048036036060811015610aca57600080fd5b506001600160a01b038135169060208101359060400135611d05565b6703782dace9d9000081565b60408051631d5b277f60e01b81526d53797374656d53657474696e677360901b6004820152602481018490526044810183905290516001600160a01b03851691631d5b277f91606480830192600092919082900301818387803b158015610b5857600080fd5b505af1158015610b6c573d6000803e3d6000fd5b50505050505050565b60006032821115610bc2576040805162461bcd60e51b81526020600482015260126024820152710a8d0e4cae6d0ded8c840e8dede40d0d2ced60731b604482015290519081900360640190fd5b610c536064610c47730142f40c25ce1f1177ed131101fa19217396cb8863907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b158015610c0e57600080fd5b505af4158015610c22573d6000803e3d6000fd5b505050506040513d6020811015610c3857600080fd5b5051859063ffffffff611d6216565b9063ffffffff611dc416565b9050836001600160a01b0316631d5b277f6d53797374656d53657474696e677360901b85846040518463ffffffff1660e01b8152600401808481526020018381526020018281526020019350505050600060405180830381600087803b158015610cbc57600080fd5b505af1158015610cd0573d6000803e3d6000fd5b505050509392505050565b610d73610d5e83730142f40c25ce1f1177ed131101fa19217396cb8863907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b158015610d2657600080fd5b505af4158015610d3a573d6000803e3d6000fd5b505050506040513d6020811015610d5057600080fd5b50519063ffffffff611e2e16565b670de0b6b3a76400009063ffffffff611e8816565b831115610db15760405162461bcd60e51b8152600401808060200182810382526038815260200180611f136038913960400191505060405180910390fd5b6000610dcb82671bc16d674ec8000063ffffffff611ea616565b905080841015610e0c5760405162461bcd60e51b81526004018080602001828103825260288152602001806120486028913960400191505060405180910390fd5b60408051631d5b277f60e01b81526d53797374656d53657474696e677360901b6004820152602481018790526044810186905290516001600160a01b03881691631d5b277f91606480830192600092919082900301818387803b158015610e7257600080fd5b505af1158015610e86573d6000803e3d6000fd5b50505050505050505050565b6001600160c01b03811115610af25760405162461bcd60e51b8152600401808060200182810382526028815260200180611f6c6028913960400191505060405180910390fd5b828114610f2c576040805162461bcd60e51b815260206004820152601860248201527f4172726179206c656e6774687320646f6e74206d617463680000000000000000604482015290519081900360640190fd5b60005b83811015610b6c5767016345785d8a0000838383818110610f4c57fe5b905060200201351115610fa6576040805162461bcd60e51b815260206004820152601e60248201527f4d41585f45584348414e47455f4645455f524154452065786365656465640000604482015290519081900360640190fd5b866001600160a01b0316631d5b277f6d53797374656d53657474696e677360901b88888886818110610fd457fe5b9050602002013560405160200180838152602001828152602001925050506040516020818303038152906040528051906020012086868681811061101457fe5b905060200201356040518463ffffffff1660e01b8152600401808481526020018381526020018281526020019350505050600060405180830381600087803b15801561105f57600080fd5b505af1158015611073573d6000803e3d6000fd5b505060019092019150610f2f9050565b6040805160208082018690528183018590528251808303840181526060830180855281519190920120631d5b277f60e01b9091526d53797374656d53657474696e677360901b6064830152608482015260a4810183905290516001600160a01b03861691631d5b277f9160c480830192600092919082900301818387803b15801561110d57600080fd5b505af1158015611121573d6000803e3d6000fd5b5050505050505050565b603c81101561116b5760405162461bcd60e51b8152600401808060200182810382526026815260200180611fef6026913960400191505060405180910390fd5b62015180811115610af25760405162461bcd60e51b81526004018080602001828103825260278152602001806120706027913960400191505060405180910390fd5b670de0b6b3a764000082131561120a576040805162461bcd60e51b815260206004820181905260248201527f72617465203e204d41585f575241505045525f4d494e545f4645455f52415445604482015290519081900360640190fd5b670de0b6b3a763ffff198212156112525760405162461bcd60e51b8152600401808060200182810382526021815260200180611f4b6021913960400191505060405180910390fd5b60008212156112b357808260000313156112b3576040805162461bcd60e51b815260206004820152601a60248201527f2d72617465203e20777261707065724275726e46656552617465000000000000604482015290519081900360640190fd5b6040805160208082018790526bffffffffffffffffffffffff19606087901b168284015282516034818403018152605483018085528151919092012063d71a9b0160e01b9091526d53797374656d53657474696e677360901b605883015260788201526098810184905290516001600160a01b0387169163d71a9b019160b880830192600092919082900301818387803b15801561135057600080fd5b505af1158015611364573d6000803e3d6000fd5b505050505050505050565b62093a8081565b801561108357603c8110156113bc5760405162461bcd60e51b815260040180806020018281038252603a815260200180611fb5603a913960400191505060405180910390fd5b620151808111156110835760405162461bcd60e51b815260040180806020018281038252603b815260200180612097603b913960400191505060405180910390fd5b6001600160a01b038116611459576040805162461bcd60e51b815260206004820152601e60248201527f41746f6d6963206571756976616c656e74206973203020616464726573730000604482015290519081900360640190fd5b60408051602080820186905281830185905282518083038401815260608301808552815191909201206309b9412f60e31b9091526d53797374656d53657474696e677360901b606483015260848201526001600160a01b0383811660a4830152915191861691634dca09789160c48082019260009290919082900301818387803b15801561110d57600080fd5b6201518081101561153e576040805162461bcd60e51b815260206004820152601f60248201527f76616c7565203c204d494e5f4645455f504552494f445f4455524154494f4e00604482015290519081900360640190fd5b624f1a00811115610af2576040805162461bcd60e51b815260206004820152601f60248201527f76616c7565203e204d41585f4645455f504552494f445f4455524154494f4e00604482015290519081900360640190fd5b670de0b6b3a764000081565b670de0b6b3a7640000811115610af25760405162461bcd60e51b81526004018080602001828103825260338152602001806120156033913960400191505060405180910390fd5b6d53797374656d53657474696e677360901b81565b6d53797374656d53657474696e677360901b90565b60408051630fca29bf60e21b81526d53797374656d53657474696e677360901b600482015260248101849052821515604482015290516001600160a01b03851691633f28a6fc91606480830192600092919082900301818387803b158015610b5857600080fd5b622dc6c081565b6040805160208082018690526bffffffffffffffffffffffff19606086901b1682840152825160348184030181526054830180855281519190920120631d5b277f60e01b9091526d53797374656d53657474696e677360901b605883015260788201526098810183905290516001600160a01b03861691631d5b277f9160b880830192600092919082900301818387803b15801561110d57600080fd5b6703782dace9d90000811115610af25760405162461bcd60e51b8152600401808060200182810382526021815260200180611ed16021913960400191505060405180910390fd5b67016345785d8a0000811115611083576040805162461bcd60e51b815260206004820152601e60248201527f4d41585f45584348414e47455f4645455f524154452065786365656465640000604482015290519081900360640190fd5b670de0b6b3a7640000811115610af2576040805162461bcd60e51b815260206004820181905260248201527f72617465203e204d41585f575241505045525f4255524e5f4645455f52415445604482015290519081900360640190fd5b603c81565b6201518081565b671bc16d674ec8000081565b603281565b62278d00811115611894576040805162461bcd60e51b815260206004820152601960248201527f4d757374206265206c657373207468616e203330206461797300000000000000604482015290519081900360640190fd5b62015180811015610af2576040805162461bcd60e51b815260206004820152601a60248201527f4d7573742062652067726561746572207468616e203120646179000000000000604482015290519081900360640190fd5b6001600160a01b038116611947576040805162461bcd60e51b815260206004820152601b60248201527f56616c69642061646472657373206d75737420626520676976656e0000000000604482015290519081900360640190fd5b604080516309b9412f60e31b81526d53797374656d53657474696e677360901b6004820152602481018490526001600160a01b038381166044830152915191851691634dca09789160648082019260009290919082900301818387803b158015610b5857600080fd5b670de0b6b3a7640000821315611a0d576040805162461bcd60e51b815260206004820181905260248201527f72617465203e204d41585f575241505045525f4255524e5f4645455f52415445604482015290519081900360640190fd5b670de0b6b3a763ffff19821215611a555760405162461bcd60e51b8152600401808060200182810382526021815260200180611ef26021913960400191505060405180910390fd5b60008212156112b357808260000313156112b3576040805162461bcd60e51b815260206004820152601a60248201527f2d72617465203e20777261707065724d696e7446656552617465000000000000604482015290519081900360640190fd5b627a120081565b62093a80811115610af2576040805162461bcd60e51b815260206004820181905260248201527f7374616b652074696d6520657863656564206d6178696d756d2031207765656b604482015290519081900360640190fd5b80611b67576040805162461bcd60e51b815260206004820152601b60248201527f4d61782064796e616d6963206665652063616e6e6f7420626520300000000000604482015290519081900360640190fd5b67016345785d8a0000811115610af2576040805162461bcd60e51b815260206004820152601e60248201527f4d41585f45584348414e47455f4645455f524154452065786365656465640000604482015290519081900360640190fd5b6001600160c01b0381565b622dc6c08110158015611be55750627a12008111155b610af2576040805162461bcd60e51b815260206004820152601d60248201527f4f7574206f662072616e67652078446f6d61696e206761734c696d6974000000604482015290519081900360640190fd5b62278d0081565b624f1a0081565b67016345785d8a000081565b730142f40c25ce1f1177ed131101fa19217396cb8863907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b158015611c9457600080fd5b505af4158015611ca8573d6000803e3d6000fd5b505050506040513d6020811015611cbe57600080fd5b5051610e1002811115611681576040805162461bcd60e51b815260206004820152600a60248201526926b0bc1018903437bab960b11b604482015290519081900360640190fd5b670de0b6b3a7640000811115610af2576040805162461bcd60e51b815260206004820181905260248201527f72617465203e204d41585f575241505045525f4d494e545f4645455f52415445604482015290519081900360640190fd5b600082611d7157506000611dbe565b82820282848281611d7e57fe5b0414611dbb5760405162461bcd60e51b8152600401808060200182810382526021815260200180611f946021913960400191505060405180910390fd5b90505b92915050565b6000808211611e1a576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b6000828481611e2557fe5b04949350505050565b600082820183811015611dbb576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000611dbb82610c4785670de0b6b3a764000063ffffffff611d6216565b6000670de0b6b3a7640000611ec1848463ffffffff611d6216565b81611ec857fe5b04939250505056fe70656e616c7479203e204d41585f4c49515549444154494f4e5f50454e414c545972617465203c202d4d41585f575241505045525f4255524e5f4645455f524154456c69717569646174696f6e526174696f203e204d41585f4c49515549444154494f4e5f524154494f202f202831202b2070656e616c74792972617465203c202d4d41585f575241505045525f4d494e545f4645455f5241544541746f6d6963206d617820766f6c756d6520657863656564206d6178696d756d2075696e74313932536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7741746f6d696320766f6c6174696c69747920636f6e73696465726174696f6e2077696e646f7720756e646572206d696e696d756d2031206d696e41746f6d696320747761702077696e646f7720756e646572206d696e696d756d2031206d696e4e65772069737375616e636520726174696f2063616e6e6f7420657863656564204d41585f49535355414e43455f524154494f6c69717569646174696f6e526174696f203c204d494e5f4c49515549444154494f4e5f524154494f41746f6d696320747761702077696e646f7720657863656564206d6178696d756d20312064617941746f6d696320766f6c6174696c69747920636f6e73696465726174696f6e2077696e646f7720657863656564206d6178696d756d203120646179a265627a7a72315820eedaf74d5402da0b714c33936100228ebf45ebc421e03b93387d48e858fe60af64736f6c63430005100032
Library Used
SafeDecimalMath : 0x0142f40c25ce1f1177ed131101fa19217396cb88SystemSettingsLib : 0x478d479bac034f89fa28d8d2ab430ec973a3a0ac
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.