Feature Tip: Add private address tag to any address under My Name Tag !
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
Contract Name:
DirectIntegrationManager
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: DirectIntegrationManager.sol * * Latest source (may be newer): https://github.com/Synthetixio/synthetix/blob/master/contracts/DirectIntegrationManager.sol * Docs: https://docs.synthetix.io/contracts/DirectIntegrationManager * * Contract Dependencies: * - IAddressResolver * - IDirectIntegrationManager * - MixinResolver * - MixinSystemSettings * - Owned * Libraries: (none) * * 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); } } pragma experimental ABIEncoderV2; // https://docs.synthetix.io/contracts/source/interfaces/IDirectIntegration interface IDirectIntegrationManager { struct ParameterIntegrationSettings { bytes32 currencyKey; address dexPriceAggregator; address atomicEquivalentForDexPricing; uint atomicExchangeFeeRate; uint atomicTwapWindow; uint atomicMaxVolumePerBlock; uint atomicVolatilityConsiderationWindow; uint atomicVolatilityUpdateThreshold; uint exchangeFeeRate; uint exchangeMaxDynamicFee; uint exchangeDynamicFeeRounds; uint exchangeDynamicFeeThreshold; uint exchangeDynamicFeeWeightDecay; } function getExchangeParameters(address integration, bytes32 key) external view returns (ParameterIntegrationSettings memory settings); function setExchangeParameters( address integration, bytes32[] calldata currencyKeys, ParameterIntegrationSettings calldata params ) external; } // Inheritance /* * SIP-267: Direct Integration * https://sips.synthetix.io/sips/sip-267/ * * Used by the Spartan Council to approve an external contract, (i.e. one which is not owned or managed by the Synthetix protocol), * to interact with Synthetix's core exchange functionalities with overridden parameters. * If no parameter overrides are specified, then the prevailing parameter configuration will be automatically used. */ contract DirectIntegrationManager is Owned, MixinSystemSettings, IDirectIntegrationManager { /* ========== CONSTANTS ========== */ bytes32 private constant CONTRACT_NAME = "DirectIntegration"; bytes32 private constant CONTRACT_NAME_EXCHANGE_RATES = "ExchangeRates"; bytes32 internal constant SETTING_DEX_PRICE_AGGREGATOR = "dexPriceAggregator"; uint internal constant DI_VERSION = 1; /* ---------- Internal Variables ---------- */ // Stores a mapping of all overridden parameters for a given direct integration. mapping(address => mapping(bytes32 => ParameterIntegrationSettings)) internal _settings; /* ========== CONSTRUCTOR ========== */ constructor(address _owner, address _resolver) public Owned(_owner) MixinSystemSettings(_resolver) {} /* ========== VIEWS ========== */ /* ---------- Getters ---------- */ /** * Used to read the configured overridden values for a given integration. * @param integration the address of the external integrator's contract */ function getExchangeParameters(address integration, bytes32 currencyKey) external view returns (ParameterIntegrationSettings memory overrides) { ParameterIntegrationSettings memory storedOverrides = _settings[integration][currencyKey]; return ParameterIntegrationSettings({ currencyKey: currencyKey, dexPriceAggregator: storedOverrides.dexPriceAggregator != address(0) ? storedOverrides.dexPriceAggregator : flexibleStorage().getAddressValue(CONTRACT_NAME_EXCHANGE_RATES, SETTING_DEX_PRICE_AGGREGATOR), atomicEquivalentForDexPricing: storedOverrides.atomicEquivalentForDexPricing != address(0) ? storedOverrides.atomicEquivalentForDexPricing : getAtomicEquivalentForDexPricing(currencyKey), atomicExchangeFeeRate: storedOverrides.atomicExchangeFeeRate > 0 ? storedOverrides.atomicExchangeFeeRate : getAtomicExchangeFeeRate(currencyKey), atomicTwapWindow: storedOverrides.atomicTwapWindow > 0 ? storedOverrides.atomicTwapWindow : getAtomicTwapWindow(), atomicMaxVolumePerBlock: storedOverrides.atomicMaxVolumePerBlock > 0 ? storedOverrides.atomicMaxVolumePerBlock : getAtomicMaxVolumePerBlock(), atomicVolatilityConsiderationWindow: storedOverrides.atomicVolatilityConsiderationWindow > 0 ? storedOverrides.atomicVolatilityConsiderationWindow : getAtomicVolatilityConsiderationWindow(currencyKey), atomicVolatilityUpdateThreshold: storedOverrides.atomicVolatilityUpdateThreshold > 0 ? storedOverrides.atomicVolatilityUpdateThreshold : getAtomicVolatilityUpdateThreshold(currencyKey), exchangeFeeRate: storedOverrides.exchangeFeeRate > 0 ? storedOverrides.exchangeFeeRate : getExchangeFeeRate(currencyKey), exchangeMaxDynamicFee: storedOverrides.exchangeMaxDynamicFee > 0 ? storedOverrides.exchangeMaxDynamicFee : getExchangeMaxDynamicFee(), exchangeDynamicFeeRounds: storedOverrides.exchangeDynamicFeeRounds > 0 ? storedOverrides.exchangeDynamicFeeRounds : getExchangeDynamicFeeRounds(), exchangeDynamicFeeThreshold: storedOverrides.exchangeDynamicFeeThreshold > 0 ? storedOverrides.exchangeDynamicFeeThreshold : getExchangeDynamicFeeThreshold(), exchangeDynamicFeeWeightDecay: storedOverrides.exchangeDynamicFeeWeightDecay > 0 ? storedOverrides.exchangeDynamicFeeWeightDecay : getExchangeDynamicFeeWeightDecay() }); } /* ========== MUTATIVE FUNCTIONS ========== */ /** * Sets an override to be used for a given direct integration that supersedes the default Synthetix parameter value. * @param integration the address of the external integrator's contract * @param settings a collection of parameters to be overridden * @dev Invoking this function will overwrite whatever overrides were previously set. Set overrides to zero to "remove" them. * @notice This will require a SIP and a presentation, given the importance of clearly presenting * external interactions with Synthetix contracts and the parameter overrides that would be implemented. */ function setExchangeParameters( address integration, bytes32[] calldata currencyKeys, ParameterIntegrationSettings calldata settings ) external onlyOwner { for (uint i = 0; i < currencyKeys.length; i++) { _setExchangeParameters(integration, currencyKeys[i], settings); } } /* ---------- Internal Functions ---------- */ function _setExchangeParameters( address integration, bytes32 currencyKey, ParameterIntegrationSettings memory settings ) internal { require(address(integration) != address(0), "Address cannot be 0"); _settings[integration][currencyKey] = settings; // overwrites the parameters for a given direct integration emit IntegrationParametersSet(integration, currencyKey, settings); } /* ========== EVENTS ========== */ event IntegrationParametersSet( address indexed integration, bytes32 indexed currencyKey, ParameterIntegrationSettings overrides ); }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"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":"bytes32","name":"name","type":"bytes32"},{"indexed":false,"internalType":"address","name":"destination","type":"address"}],"name":"CacheUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"integration","type":"address"},{"indexed":true,"internalType":"bytes32","name":"currencyKey","type":"bytes32"},{"components":[{"internalType":"bytes32","name":"currencyKey","type":"bytes32"},{"internalType":"address","name":"dexPriceAggregator","type":"address"},{"internalType":"address","name":"atomicEquivalentForDexPricing","type":"address"},{"internalType":"uint256","name":"atomicExchangeFeeRate","type":"uint256"},{"internalType":"uint256","name":"atomicTwapWindow","type":"uint256"},{"internalType":"uint256","name":"atomicMaxVolumePerBlock","type":"uint256"},{"internalType":"uint256","name":"atomicVolatilityConsiderationWindow","type":"uint256"},{"internalType":"uint256","name":"atomicVolatilityUpdateThreshold","type":"uint256"},{"internalType":"uint256","name":"exchangeFeeRate","type":"uint256"},{"internalType":"uint256","name":"exchangeMaxDynamicFee","type":"uint256"},{"internalType":"uint256","name":"exchangeDynamicFeeRounds","type":"uint256"},{"internalType":"uint256","name":"exchangeDynamicFeeThreshold","type":"uint256"},{"internalType":"uint256","name":"exchangeDynamicFeeWeightDecay","type":"uint256"}],"indexed":false,"internalType":"struct IDirectIntegrationManager.ParameterIntegrationSettings","name":"overrides","type":"tuple"}],"name":"IntegrationParametersSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldOwner","type":"address"},{"indexed":false,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerNominated","type":"event"},{"constant":false,"inputs":[],"name":"acceptOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"integration","type":"address"},{"internalType":"bytes32","name":"currencyKey","type":"bytes32"}],"name":"getExchangeParameters","outputs":[{"components":[{"internalType":"bytes32","name":"currencyKey","type":"bytes32"},{"internalType":"address","name":"dexPriceAggregator","type":"address"},{"internalType":"address","name":"atomicEquivalentForDexPricing","type":"address"},{"internalType":"uint256","name":"atomicExchangeFeeRate","type":"uint256"},{"internalType":"uint256","name":"atomicTwapWindow","type":"uint256"},{"internalType":"uint256","name":"atomicMaxVolumePerBlock","type":"uint256"},{"internalType":"uint256","name":"atomicVolatilityConsiderationWindow","type":"uint256"},{"internalType":"uint256","name":"atomicVolatilityUpdateThreshold","type":"uint256"},{"internalType":"uint256","name":"exchangeFeeRate","type":"uint256"},{"internalType":"uint256","name":"exchangeMaxDynamicFee","type":"uint256"},{"internalType":"uint256","name":"exchangeDynamicFeeRounds","type":"uint256"},{"internalType":"uint256","name":"exchangeDynamicFeeThreshold","type":"uint256"},{"internalType":"uint256","name":"exchangeDynamicFeeWeightDecay","type":"uint256"}],"internalType":"struct IDirectIntegrationManager.ParameterIntegrationSettings","name":"overrides","type":"tuple"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isResolverCached","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":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":false,"inputs":[{"internalType":"address","name":"integration","type":"address"},{"internalType":"bytes32[]","name":"currencyKeys","type":"bytes32[]"},{"components":[{"internalType":"bytes32","name":"currencyKey","type":"bytes32"},{"internalType":"address","name":"dexPriceAggregator","type":"address"},{"internalType":"address","name":"atomicEquivalentForDexPricing","type":"address"},{"internalType":"uint256","name":"atomicExchangeFeeRate","type":"uint256"},{"internalType":"uint256","name":"atomicTwapWindow","type":"uint256"},{"internalType":"uint256","name":"atomicMaxVolumePerBlock","type":"uint256"},{"internalType":"uint256","name":"atomicVolatilityConsiderationWindow","type":"uint256"},{"internalType":"uint256","name":"atomicVolatilityUpdateThreshold","type":"uint256"},{"internalType":"uint256","name":"exchangeFeeRate","type":"uint256"},{"internalType":"uint256","name":"exchangeMaxDynamicFee","type":"uint256"},{"internalType":"uint256","name":"exchangeDynamicFeeRounds","type":"uint256"},{"internalType":"uint256","name":"exchangeDynamicFeeThreshold","type":"uint256"},{"internalType":"uint256","name":"exchangeDynamicFeeWeightDecay","type":"uint256"}],"internalType":"struct IDirectIntegrationManager.ParameterIntegrationSettings","name":"settings","type":"tuple"}],"name":"setExchangeParameters","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60806040523480156200001157600080fd5b5060405162001b4038038062001b408339810160408190526200003491620000fc565b8080836001600160a01b038116620000695760405162461bcd60e51b81526004016200006090620001b8565b60405180910390fd5b600080546001600160a01b0319166001600160a01b0383161781556040517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c91620000b691849062000192565b60405180910390a150600280546001600160a01b0319166001600160a01b03929092169190911790555062000213915050565b8051620000f681620001f9565b92915050565b600080604083850312156200011057600080fd5b60006200011e8585620000e9565b92505060206200013185828601620000e9565b9150509250929050565b6200014681620001e5565b82525050565b6200014681620001d3565b600062000166601983620001ca565b7f4f776e657220616464726573732063616e6e6f74206265203000000000000000815260200192915050565b60408101620001a282856200013b565b620001b160208301846200014c565b9392505050565b60208082528101620000f68162000157565b90815260200190565b60006001600160a01b038216620000f6565b6000620000f6826000620000f682620001d3565b6200020481620001d3565b81146200021057600080fd5b50565b61191d80620002236000396000f3fe608060405234801561001057600080fd5b506004361061009e5760003560e01c8063697b659b11610066578063697b659b14610113578063741853601461013357806379ba50971461013b578063899ffef4146101435780638da5cb5b146101585761009e565b806304f3bcec146100a35780631627540c146100c15780632af64bd3146100d657806353a47bb7146100eb5780635a68456214610100575b600080fd5b6100ab610160565b6040516100b891906117c0565b60405180910390f35b6100d46100cf366004611280565b61016f565b005b6100de6101cd565b6040516100b8919061175b565b6100f36102e5565b6040516100b8919061171a565b6100d461010e3660046112c4565b6102f4565b61012661012136600461132f565b610343565b6040516100b8919061180f565b6100d46106a3565b6100d46107f9565b61014b61089e565b6040516100b8919061174a565b6100f36108ef565b6002546001600160a01b031681565b6101776108fe565b600180546001600160a01b0319166001600160a01b0383161790556040517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce22906101c290839061171a565b60405180910390a150565b600060606101d961089e565b905060005b81518110156102db5760008282815181106101f557fe5b602090810291909101810151600081815260039092526040918290205460025492516321f8a72160e01b81529193506001600160a01b039081169216906321f8a72190610246908590600401611769565b60206040518083038186803b15801561025e57600080fd5b505afa158015610272573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061029691908101906112a6565b6001600160a01b03161415806102c157506000818152600360205260409020546001600160a01b0316155b156102d257600093505050506102e2565b506001016101de565b5060019150505b90565b6001546001600160a01b031681565b6102fc6108fe565b60005b8281101561033c576103348585858481811061031757fe5b905060200201358480360361032f9190810190611369565b61092a565b6001016102ff565b5050505050565b61034b611046565b610353611046565b506001600160a01b03808416600090815260046020818152604080842087855282529283902083516101a080820186528254825260018301548716828501908152600284015488168388015260038401546060840152948301546080830152600583015460a0830152600683015460c0830152600783015460e083015260088301546101008301526009830154610120830152600a830154610140830152600b830154610160830152600c90920154610180820152845191820190945286815291519293919290830191166104d15761042a610a54565b6001600160a01b0316639ee5955a6c45786368616e6765526174657360981b713232bc283934b1b2a0b3b3b932b3b0ba37b960711b6040518363ffffffff1660e01b815260040161047c929190611785565b60206040518083038186803b15801561049457600080fd5b505afa1580156104a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506104cc91908101906112a6565b6104d7565b82602001515b6001600160a01b0316815260200160006001600160a01b031683604001516001600160a01b031614156105125761050d85610a76565b610518565b82604001515b6001600160a01b0316815260200160008360600151116105405761053b85610b56565b610546565b82606001515b815260200160008360800151116105645761055f610c2e565b61056a565b82608001515b815260200160008360a001511161058857610583610cd9565b61058e565b8260a001515b815260200160008360c00151116105ad576105a885610d41565b6105b3565b8260c001515b815260200160008360e00151116105d2576105cd85610d9e565b6105d8565b8260e001515b81526020016000836101000151116105f8576105f385610dfb565b6105ff565b8261010001515b815260200160008361012001511161061e57610619610e4a565b610625565b8261012001515b81526020016000836101400151116106445761063f610eaa565b61064b565b8261014001515b815260200160008361016001511161066a57610665610f12565b610671565b8261016001515b81526020016000836101800151116106905761068b610f7a565b610697565b8261018001515b90529150505b92915050565b60606106ad61089e565b905060005b81518110156107f55760008282815181106106c957fe5b602002602001015190506000600260009054906101000a90046001600160a01b03166001600160a01b031663dacb2d01838460405160200161070b919061170f565b6040516020818303038152906040526040518363ffffffff1660e01b81526004016107379291906117a0565b60206040518083038186803b15801561074f57600080fd5b505afa158015610763573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061078791908101906112a6565b6000838152600360205260409081902080546001600160a01b0319166001600160a01b038416179055519091507f88a93678a3692f6789d9546fc621bf7234b101ddb7d4fe479455112831b8aa68906107e39084908490611777565b60405180910390a150506001016106b2565b5050565b6001546001600160a01b0316331461082c5760405162461bcd60e51b8152600401610823906117df565b60405180910390fd5b6000546001546040517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9261086f926001600160a01b0391821692911690611728565b60405180910390a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b604080516001808252818301909252606091602080830190803883390190505090506e466c657869626c6553746f7261676560881b816000815181106108e057fe5b60200260200101818152505090565b6000546001600160a01b031681565b6000546001600160a01b031633146109285760405162461bcd60e51b8152600401610823906117ef565b565b6001600160a01b0383166109505760405162461bcd60e51b8152600401610823906117ff565b6001600160a01b03808416600081815260046020818152604080842088855282529283902086518155908601516001820180549187166001600160a01b031992831617905583870151600283018054919097169116179094556060850151600385015560808501519084015560a0840151600584015560c0840151600684015560e0840151600784015561010084015160088401556101208401516009840155610140840151600a840155610160840151600b840155610180840151600c9093019290925590518391907fac520ced31ca01ad123194e41989084aeb335064dd7b37291e59a85eb9c972ec90610a4790859061180f565b60405180910390a3505050565b6000610a716e466c657869626c6553746f7261676560881b610fe2565b905090565b6000610a80610a54565b6001600160a01b0316639ee5955a6d53797374656d53657474696e677360901b7f61746f6d69634571756976616c656e74466f7244657850726963696e6700000085604051602001610ad39291906116c9565b604051602081830303815290604052805190602001206040518363ffffffff1660e01b8152600401610b06929190611785565b60206040518083038186803b158015610b1e57600080fd5b505afa158015610b32573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061069d91908101906112a6565b6000610b60610a54565b6001600160a01b03166323257c2b6d53797374656d53657474696e677360901b7461746f6d696345786368616e67654665655261746560581b85604051602001610bab9291906116c9565b604051602081830303815290604052805190602001206040518363ffffffff1660e01b8152600401610bde929190611785565b60206040518083038186803b158015610bf657600080fd5b505afa158015610c0a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061069d9190810190611388565b6000610c38610a54565b6001600160a01b03166323257c2b6d53797374656d53657474696e677360901b6f61746f6d69635477617057696e646f7760801b6040518363ffffffff1660e01b8152600401610c89929190611785565b60206040518083038186803b158015610ca157600080fd5b505afa158015610cb5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610a719190810190611388565b6000610ce3610a54565b6001600160a01b03166323257c2b6d53797374656d53657474696e677360901b7f61746f6d69634d6178566f6c756d65506572426c6f636b0000000000000000006040518363ffffffff1660e01b8152600401610c89929190611785565b6000610d4b610a54565b6001600160a01b03166323257c2b6d53797374656d53657474696e677360901b7f61746f6d6963566f6c436f6e73696465726174696f6e57696e646f770000000085604051602001610bab9291906116c9565b6000610da8610a54565b6001600160a01b03166323257c2b6d53797374656d53657474696e677360901b7f61746f6d6963566f6c5570646174655468726573686f6c64000000000000000085604051602001610bab9291906116c9565b6000610e05610a54565b6001600160a01b03166323257c2b6d53797374656d53657474696e677360901b6e65786368616e67654665655261746560881b85604051602001610bab9291906116c9565b6000610e54610a54565b6001600160a01b03166323257c2b6d53797374656d53657474696e677360901b7465786368616e67654d617844796e616d696346656560581b6040518363ffffffff1660e01b8152600401610c89929190611785565b6000610eb4610a54565b6001600160a01b03166323257c2b6d53797374656d53657474696e677360901b7f65786368616e676544796e616d6963466565526f756e647300000000000000006040518363ffffffff1660e01b8152600401610c89929190611785565b6000610f1c610a54565b6001600160a01b03166323257c2b6d53797374656d53657474696e677360901b7f65786368616e676544796e616d69634665655468726573686f6c6400000000006040518363ffffffff1660e01b8152600401610c89929190611785565b6000610f84610a54565b6001600160a01b03166323257c2b6d53797374656d53657474696e677360901b7f65786368616e676544796e616d696346656557656967687444656361790000006040518363ffffffff1660e01b8152600401610c89929190611785565b60008181526003602090815260408083205490516001600160a01b039091169182151591611012918691016116ef565b6040516020818303038152906040529061103f5760405162461bcd60e51b815260040161082391906117ce565b5092915050565b604051806101a001604052806000801916815260200160006001600160a01b0316815260200160006001600160a01b03168152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b803561069d816118ba565b805161069d816118ba565b60008083601f8401126110eb57600080fd5b50813567ffffffffffffffff81111561110357600080fd5b60208301915083602082028301111561111b57600080fd5b9250929050565b803561069d816118d1565b60006101a0828403121561114057600080fd5b50919050565b60006101a0828403121561115957600080fd5b6111646101a061181e565b905060006111728484611122565b8252506020611183848483016110c3565b6020830152506040611197848285016110c3565b60408301525060606111ab84828501611122565b60608301525060806111bf84828501611122565b60808301525060a06111d384828501611122565b60a08301525060c06111e784828501611122565b60c08301525060e06111fb84828501611122565b60e08301525061010061121084828501611122565b6101008301525061012061122684828501611122565b6101208301525061014061123c84828501611122565b6101408301525061016061125284828501611122565b6101608301525061018061126884828501611122565b6101808301525092915050565b805161069d816118d1565b60006020828403121561129257600080fd5b600061129e84846110c3565b949350505050565b6000602082840312156112b857600080fd5b600061129e84846110ce565b6000806000806101e085870312156112db57600080fd5b60006112e787876110c3565b945050602085013567ffffffffffffffff81111561130457600080fd5b611310878288016110d9565b935093505060406113238782880161112d565b91505092959194509250565b6000806040838503121561134257600080fd5b600061134e85856110c3565b925050602061135f85828601611122565b9150509250929050565b60006101a0828403121561137c57600080fd5b600061129e8484611146565b60006020828403121561139a57600080fd5b600061129e8484611275565b60006113b2838361142b565b505060200190565b6113c38161185d565b82525050565b60006113d48261184b565b6113de818561184f565b93506113e983611845565b8060005b8381101561141757815161140188826113a6565b975061140c83611845565b9250506001016113ed565b509495945050505050565b6113c381611868565b6113c3816102e2565b6113c3611440826102e2565b6102e2565b6113c381611879565b60006114598261184b565b611463818561184f565b9350611473818560208601611884565b61147c816118b0565b9093019392505050565b600061149360358361184f565b7f596f75206d757374206265206e6f6d696e61746564206265666f726520796f7581527402063616e20616363657074206f776e65727368697605c1b602082015260400192915050565b60006114ea601183611858565b70026b4b9b9b4b7339030b2323932b9b99d1607d1b815260110192915050565b6000611517602f8361184f565b7f4f6e6c792074686520636f6e7472616374206f776e6572206d6179207065726681526e37b936903a3434b99030b1ba34b7b760891b602082015260400192915050565b600061156860138361184f565b720416464726573732063616e6e6f74206265203606c1b815260200192915050565b6000611597601983611858565b7f5265736f6c766572206d697373696e67207461726765743a2000000000000000815260190192915050565b80516101a08301906115d5848261142b565b5060208201516115e860208501826113ba565b5060408201516115fb60408501826113ba565b50606082015161160e606085018261142b565b506080820151611621608085018261142b565b5060a082015161163460a085018261142b565b5060c082015161164760c085018261142b565b5060e082015161165a60e085018261142b565b5061010082015161166f61010085018261142b565b5061012082015161168461012085018261142b565b5061014082015161169961014085018261142b565b506101608201516116ae61016085018261142b565b506101808201516116c361018085018261142b565b50505050565b60006116d58285611434565b6020820191506116e58284611434565b5060200192915050565b60006116fa826114dd565b91506117068284611434565b50602001919050565b60006116fa8261158a565b6020810161069d82846113ba565b6040810161173682856113ba565b61174360208301846113ba565b9392505050565b6020808252810161174381846113c9565b6020810161069d8284611422565b6020810161069d828461142b565b60408101611736828561142b565b60408101611793828561142b565b611743602083018461142b565b604081016117ae828561142b565b818103602083015261129e818461144e565b6020810161069d8284611445565b60208082528101611743818461144e565b6020808252810161069d81611486565b6020808252810161069d8161150a565b6020808252810161069d8161155b565b6101a0810161069d82846115c3565b60405181810167ffffffffffffffff8111828210171561183d57600080fd5b604052919050565b60200190565b5190565b90815260200190565b919050565b600061069d8261186d565b151590565b6001600160a01b031690565b600061069d8261185d565b60005b8381101561189f578181015183820152602001611887565b838111156116c35750506000910152565b601f01601f191690565b6118c38161185d565b81146118ce57600080fd5b50565b6118c3816102e256fea365627a7a72315820f9338525b3b515faec47a4e51971e55d24a99bb57270abe3911eeee8abe2bd0d6c6578706572696d656e74616cf564736f6c63430005100040000000000000000000000000302d2451d9f47620374b54c521423bf0403916a20000000000000000000000004e3b31eb0e5cb73641ee1e65e7dcefe520ba3ef2
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061009e5760003560e01c8063697b659b11610066578063697b659b14610113578063741853601461013357806379ba50971461013b578063899ffef4146101435780638da5cb5b146101585761009e565b806304f3bcec146100a35780631627540c146100c15780632af64bd3146100d657806353a47bb7146100eb5780635a68456214610100575b600080fd5b6100ab610160565b6040516100b891906117c0565b60405180910390f35b6100d46100cf366004611280565b61016f565b005b6100de6101cd565b6040516100b8919061175b565b6100f36102e5565b6040516100b8919061171a565b6100d461010e3660046112c4565b6102f4565b61012661012136600461132f565b610343565b6040516100b8919061180f565b6100d46106a3565b6100d46107f9565b61014b61089e565b6040516100b8919061174a565b6100f36108ef565b6002546001600160a01b031681565b6101776108fe565b600180546001600160a01b0319166001600160a01b0383161790556040517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce22906101c290839061171a565b60405180910390a150565b600060606101d961089e565b905060005b81518110156102db5760008282815181106101f557fe5b602090810291909101810151600081815260039092526040918290205460025492516321f8a72160e01b81529193506001600160a01b039081169216906321f8a72190610246908590600401611769565b60206040518083038186803b15801561025e57600080fd5b505afa158015610272573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061029691908101906112a6565b6001600160a01b03161415806102c157506000818152600360205260409020546001600160a01b0316155b156102d257600093505050506102e2565b506001016101de565b5060019150505b90565b6001546001600160a01b031681565b6102fc6108fe565b60005b8281101561033c576103348585858481811061031757fe5b905060200201358480360361032f9190810190611369565b61092a565b6001016102ff565b5050505050565b61034b611046565b610353611046565b506001600160a01b03808416600090815260046020818152604080842087855282529283902083516101a080820186528254825260018301548716828501908152600284015488168388015260038401546060840152948301546080830152600583015460a0830152600683015460c0830152600783015460e083015260088301546101008301526009830154610120830152600a830154610140830152600b830154610160830152600c90920154610180820152845191820190945286815291519293919290830191166104d15761042a610a54565b6001600160a01b0316639ee5955a6c45786368616e6765526174657360981b713232bc283934b1b2a0b3b3b932b3b0ba37b960711b6040518363ffffffff1660e01b815260040161047c929190611785565b60206040518083038186803b15801561049457600080fd5b505afa1580156104a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506104cc91908101906112a6565b6104d7565b82602001515b6001600160a01b0316815260200160006001600160a01b031683604001516001600160a01b031614156105125761050d85610a76565b610518565b82604001515b6001600160a01b0316815260200160008360600151116105405761053b85610b56565b610546565b82606001515b815260200160008360800151116105645761055f610c2e565b61056a565b82608001515b815260200160008360a001511161058857610583610cd9565b61058e565b8260a001515b815260200160008360c00151116105ad576105a885610d41565b6105b3565b8260c001515b815260200160008360e00151116105d2576105cd85610d9e565b6105d8565b8260e001515b81526020016000836101000151116105f8576105f385610dfb565b6105ff565b8261010001515b815260200160008361012001511161061e57610619610e4a565b610625565b8261012001515b81526020016000836101400151116106445761063f610eaa565b61064b565b8261014001515b815260200160008361016001511161066a57610665610f12565b610671565b8261016001515b81526020016000836101800151116106905761068b610f7a565b610697565b8261018001515b90529150505b92915050565b60606106ad61089e565b905060005b81518110156107f55760008282815181106106c957fe5b602002602001015190506000600260009054906101000a90046001600160a01b03166001600160a01b031663dacb2d01838460405160200161070b919061170f565b6040516020818303038152906040526040518363ffffffff1660e01b81526004016107379291906117a0565b60206040518083038186803b15801561074f57600080fd5b505afa158015610763573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061078791908101906112a6565b6000838152600360205260409081902080546001600160a01b0319166001600160a01b038416179055519091507f88a93678a3692f6789d9546fc621bf7234b101ddb7d4fe479455112831b8aa68906107e39084908490611777565b60405180910390a150506001016106b2565b5050565b6001546001600160a01b0316331461082c5760405162461bcd60e51b8152600401610823906117df565b60405180910390fd5b6000546001546040517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9261086f926001600160a01b0391821692911690611728565b60405180910390a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b604080516001808252818301909252606091602080830190803883390190505090506e466c657869626c6553746f7261676560881b816000815181106108e057fe5b60200260200101818152505090565b6000546001600160a01b031681565b6000546001600160a01b031633146109285760405162461bcd60e51b8152600401610823906117ef565b565b6001600160a01b0383166109505760405162461bcd60e51b8152600401610823906117ff565b6001600160a01b03808416600081815260046020818152604080842088855282529283902086518155908601516001820180549187166001600160a01b031992831617905583870151600283018054919097169116179094556060850151600385015560808501519084015560a0840151600584015560c0840151600684015560e0840151600784015561010084015160088401556101208401516009840155610140840151600a840155610160840151600b840155610180840151600c9093019290925590518391907fac520ced31ca01ad123194e41989084aeb335064dd7b37291e59a85eb9c972ec90610a4790859061180f565b60405180910390a3505050565b6000610a716e466c657869626c6553746f7261676560881b610fe2565b905090565b6000610a80610a54565b6001600160a01b0316639ee5955a6d53797374656d53657474696e677360901b7f61746f6d69634571756976616c656e74466f7244657850726963696e6700000085604051602001610ad39291906116c9565b604051602081830303815290604052805190602001206040518363ffffffff1660e01b8152600401610b06929190611785565b60206040518083038186803b158015610b1e57600080fd5b505afa158015610b32573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061069d91908101906112a6565b6000610b60610a54565b6001600160a01b03166323257c2b6d53797374656d53657474696e677360901b7461746f6d696345786368616e67654665655261746560581b85604051602001610bab9291906116c9565b604051602081830303815290604052805190602001206040518363ffffffff1660e01b8152600401610bde929190611785565b60206040518083038186803b158015610bf657600080fd5b505afa158015610c0a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061069d9190810190611388565b6000610c38610a54565b6001600160a01b03166323257c2b6d53797374656d53657474696e677360901b6f61746f6d69635477617057696e646f7760801b6040518363ffffffff1660e01b8152600401610c89929190611785565b60206040518083038186803b158015610ca157600080fd5b505afa158015610cb5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610a719190810190611388565b6000610ce3610a54565b6001600160a01b03166323257c2b6d53797374656d53657474696e677360901b7f61746f6d69634d6178566f6c756d65506572426c6f636b0000000000000000006040518363ffffffff1660e01b8152600401610c89929190611785565b6000610d4b610a54565b6001600160a01b03166323257c2b6d53797374656d53657474696e677360901b7f61746f6d6963566f6c436f6e73696465726174696f6e57696e646f770000000085604051602001610bab9291906116c9565b6000610da8610a54565b6001600160a01b03166323257c2b6d53797374656d53657474696e677360901b7f61746f6d6963566f6c5570646174655468726573686f6c64000000000000000085604051602001610bab9291906116c9565b6000610e05610a54565b6001600160a01b03166323257c2b6d53797374656d53657474696e677360901b6e65786368616e67654665655261746560881b85604051602001610bab9291906116c9565b6000610e54610a54565b6001600160a01b03166323257c2b6d53797374656d53657474696e677360901b7465786368616e67654d617844796e616d696346656560581b6040518363ffffffff1660e01b8152600401610c89929190611785565b6000610eb4610a54565b6001600160a01b03166323257c2b6d53797374656d53657474696e677360901b7f65786368616e676544796e616d6963466565526f756e647300000000000000006040518363ffffffff1660e01b8152600401610c89929190611785565b6000610f1c610a54565b6001600160a01b03166323257c2b6d53797374656d53657474696e677360901b7f65786368616e676544796e616d69634665655468726573686f6c6400000000006040518363ffffffff1660e01b8152600401610c89929190611785565b6000610f84610a54565b6001600160a01b03166323257c2b6d53797374656d53657474696e677360901b7f65786368616e676544796e616d696346656557656967687444656361790000006040518363ffffffff1660e01b8152600401610c89929190611785565b60008181526003602090815260408083205490516001600160a01b039091169182151591611012918691016116ef565b6040516020818303038152906040529061103f5760405162461bcd60e51b815260040161082391906117ce565b5092915050565b604051806101a001604052806000801916815260200160006001600160a01b0316815260200160006001600160a01b03168152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b803561069d816118ba565b805161069d816118ba565b60008083601f8401126110eb57600080fd5b50813567ffffffffffffffff81111561110357600080fd5b60208301915083602082028301111561111b57600080fd5b9250929050565b803561069d816118d1565b60006101a0828403121561114057600080fd5b50919050565b60006101a0828403121561115957600080fd5b6111646101a061181e565b905060006111728484611122565b8252506020611183848483016110c3565b6020830152506040611197848285016110c3565b60408301525060606111ab84828501611122565b60608301525060806111bf84828501611122565b60808301525060a06111d384828501611122565b60a08301525060c06111e784828501611122565b60c08301525060e06111fb84828501611122565b60e08301525061010061121084828501611122565b6101008301525061012061122684828501611122565b6101208301525061014061123c84828501611122565b6101408301525061016061125284828501611122565b6101608301525061018061126884828501611122565b6101808301525092915050565b805161069d816118d1565b60006020828403121561129257600080fd5b600061129e84846110c3565b949350505050565b6000602082840312156112b857600080fd5b600061129e84846110ce565b6000806000806101e085870312156112db57600080fd5b60006112e787876110c3565b945050602085013567ffffffffffffffff81111561130457600080fd5b611310878288016110d9565b935093505060406113238782880161112d565b91505092959194509250565b6000806040838503121561134257600080fd5b600061134e85856110c3565b925050602061135f85828601611122565b9150509250929050565b60006101a0828403121561137c57600080fd5b600061129e8484611146565b60006020828403121561139a57600080fd5b600061129e8484611275565b60006113b2838361142b565b505060200190565b6113c38161185d565b82525050565b60006113d48261184b565b6113de818561184f565b93506113e983611845565b8060005b8381101561141757815161140188826113a6565b975061140c83611845565b9250506001016113ed565b509495945050505050565b6113c381611868565b6113c3816102e2565b6113c3611440826102e2565b6102e2565b6113c381611879565b60006114598261184b565b611463818561184f565b9350611473818560208601611884565b61147c816118b0565b9093019392505050565b600061149360358361184f565b7f596f75206d757374206265206e6f6d696e61746564206265666f726520796f7581527402063616e20616363657074206f776e65727368697605c1b602082015260400192915050565b60006114ea601183611858565b70026b4b9b9b4b7339030b2323932b9b99d1607d1b815260110192915050565b6000611517602f8361184f565b7f4f6e6c792074686520636f6e7472616374206f776e6572206d6179207065726681526e37b936903a3434b99030b1ba34b7b760891b602082015260400192915050565b600061156860138361184f565b720416464726573732063616e6e6f74206265203606c1b815260200192915050565b6000611597601983611858565b7f5265736f6c766572206d697373696e67207461726765743a2000000000000000815260190192915050565b80516101a08301906115d5848261142b565b5060208201516115e860208501826113ba565b5060408201516115fb60408501826113ba565b50606082015161160e606085018261142b565b506080820151611621608085018261142b565b5060a082015161163460a085018261142b565b5060c082015161164760c085018261142b565b5060e082015161165a60e085018261142b565b5061010082015161166f61010085018261142b565b5061012082015161168461012085018261142b565b5061014082015161169961014085018261142b565b506101608201516116ae61016085018261142b565b506101808201516116c361018085018261142b565b50505050565b60006116d58285611434565b6020820191506116e58284611434565b5060200192915050565b60006116fa826114dd565b91506117068284611434565b50602001919050565b60006116fa8261158a565b6020810161069d82846113ba565b6040810161173682856113ba565b61174360208301846113ba565b9392505050565b6020808252810161174381846113c9565b6020810161069d8284611422565b6020810161069d828461142b565b60408101611736828561142b565b60408101611793828561142b565b611743602083018461142b565b604081016117ae828561142b565b818103602083015261129e818461144e565b6020810161069d8284611445565b60208082528101611743818461144e565b6020808252810161069d81611486565b6020808252810161069d8161150a565b6020808252810161069d8161155b565b6101a0810161069d82846115c3565b60405181810167ffffffffffffffff8111828210171561183d57600080fd5b604052919050565b60200190565b5190565b90815260200190565b919050565b600061069d8261186d565b151590565b6001600160a01b031690565b600061069d8261185d565b60005b8381101561189f578181015183820152602001611887565b838111156116c35750506000910152565b601f01601f191690565b6118c38161185d565b81146118ce57600080fd5b50565b6118c3816102e256fea365627a7a72315820f9338525b3b515faec47a4e51971e55d24a99bb57270abe3911eeee8abe2bd0d6c6578706572696d656e74616cf564736f6c63430005100040
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000302d2451d9f47620374b54c521423bf0403916a20000000000000000000000004e3b31eb0e5cb73641ee1e65e7dcefe520ba3ef2
-----Decoded View---------------
Arg [0] : _owner (address): 0x302d2451d9f47620374B54c521423Bf0403916A2
Arg [1] : _resolver (address): 0x4E3b31eB0E5CB73641EE1E65E7dCEFe520bA3ef2
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000302d2451d9f47620374b54c521423bf0403916a2
Arg [1] : 0000000000000000000000004e3b31eb0e5cb73641ee1e65e7dcefe520ba3ef2
Libraries Used
SafeDecimalMath : 0x84d626b2bb4d0f064067e4bf80fce7055d8f3e7bSystemSettingsLib : 0x4a39aef2281ac0d192a9c4783604833ba8f31174SignedSafeDecimalMath : 0x728a2b79cad691531cc1146ef802617ff50c7095ExchangeSettlementLib : 0xaa5a3d7f04e15b22eb3664b56310aa18a3527ec7
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 26 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.