Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Nominate New Own... | 14934043 | 987 days ago | IN | 0 ETH | 0.00373872 |
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 Source Code Verified (Exact Match)
Contract Name:
Issuer
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-06-09 */ /* ____ __ __ __ _ / __/__ __ ___ / /_ / / ___ / /_ (_)__ __ _\ \ / // // _ \/ __// _ \/ -_)/ __// / \ \ / /___/ \_, //_//_/\__//_//_/\__/ \__//_/ /_\_\ /___/ * Synthetix: Issuer.sol * * Latest source (may be newer): https://github.com/Synthetixio/synthetix/blob/master/contracts/Issuer.sol * Docs: https://docs.synthetix.io/contracts/Issuer * * Contract Dependencies: * - IAddressResolver * - IIssuer * - MixinResolver * - MixinSystemSettings * - Owned * Libraries: * - SafeCast * - SafeDecimalMath * - SafeMath * - VestingEntries * * MIT License * =========== * * Copyright (c) 2022 Synthetix * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE */ pragma solidity ^0.5.16; // https://docs.synthetix.io/contracts/source/contracts/owned contract Owned { address public owner; address public nominatedOwner; constructor(address _owner) public { require(_owner != address(0), "Owner address cannot be 0"); owner = _owner; emit OwnerChanged(address(0), _owner); } function nominateNewOwner(address _owner) external onlyOwner { nominatedOwner = _owner; emit OwnerNominated(_owner); } function acceptOwnership() external { require(msg.sender == nominatedOwner, "You must be nominated before you can accept ownership"); emit OwnerChanged(owner, nominatedOwner); owner = nominatedOwner; nominatedOwner = address(0); } modifier onlyOwner { _onlyOwner(); _; } function _onlyOwner() private view { require(msg.sender == owner, "Only the contract owner may perform this action"); } event OwnerNominated(address newOwner); event OwnerChanged(address oldOwner, address newOwner); } // https://docs.synthetix.io/contracts/source/interfaces/iaddressresolver interface IAddressResolver { function getAddress(bytes32 name) external view returns (address); function getSynth(bytes32 key) external view returns (address); function requireAndGetAddress(bytes32 name, string calldata reason) external view returns (address); } // https://docs.synthetix.io/contracts/source/interfaces/isynth interface ISynth { // Views function currencyKey() external view returns (bytes32); function transferableSynths(address account) external view returns (uint); // Mutative functions function transferAndSettle(address to, uint value) external returns (bool); function transferFromAndSettle( address from, address to, uint value ) external returns (bool); // Restricted: used internally to Synthetix function burn(address account, uint amount) external; function issue(address account, uint amount) external; } // https://docs.synthetix.io/contracts/source/interfaces/iissuer interface IIssuer { // Views function allNetworksDebtInfo() external view returns ( uint256 debt, uint256 sharesSupply, bool isStale ); function anySynthOrSNXRateIsInvalid() external view returns (bool anyRateInvalid); function availableCurrencyKeys() external view returns (bytes32[] memory); function availableSynthCount() external view returns (uint); function availableSynths(uint index) external view returns (ISynth); function canBurnSynths(address account) external view returns (bool); function collateral(address account) external view returns (uint); function collateralisationRatio(address issuer) external view returns (uint); function collateralisationRatioAndAnyRatesInvalid(address _issuer) external view returns (uint cratio, bool anyRateIsInvalid); function debtBalanceOf(address issuer, bytes32 currencyKey) external view returns (uint debtBalance); function issuanceRatio() external view returns (uint); function lastIssueEvent(address account) external view returns (uint); function maxIssuableSynths(address issuer) external view returns (uint maxIssuable); function minimumStakeTime() external view returns (uint); function remainingIssuableSynths(address issuer) external view returns ( uint maxIssuable, uint alreadyIssued, uint totalSystemDebt ); function synths(bytes32 currencyKey) external view returns (ISynth); function getSynths(bytes32[] calldata currencyKeys) external view returns (ISynth[] memory); function synthsByAddress(address synthAddress) external view returns (bytes32); function totalIssuedSynths(bytes32 currencyKey, bool excludeOtherCollateral) external view returns (uint); function transferableSynthetixAndAnyRateIsInvalid(address account, uint balance) external view returns (uint transferable, bool anyRateIsInvalid); // Restricted: used internally to Synthetix function 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 amountToLiquidate); function issueSynthsWithoutDebt( bytes32 currencyKey, address to, uint amount ) external returns (bool rateInvalid); function burnSynthsWithoutDebt( bytes32 currencyKey, address to, uint amount ) external returns (bool rateInvalid); } // Inheritance // Internal references // https://docs.synthetix.io/contracts/source/contracts/addressresolver contract AddressResolver is Owned, IAddressResolver { mapping(bytes32 => address) public repository; constructor(address _owner) public Owned(_owner) {} /* ========== RESTRICTED FUNCTIONS ========== */ function importAddresses(bytes32[] calldata names, address[] calldata destinations) external onlyOwner { require(names.length == destinations.length, "Input lengths must match"); for (uint i = 0; i < names.length; i++) { bytes32 name = names[i]; address destination = destinations[i]; repository[name] = destination; emit AddressImported(name, destination); } } /* ========= PUBLIC FUNCTIONS ========== */ function rebuildCaches(MixinResolver[] calldata destinations) external { for (uint i = 0; i < destinations.length; i++) { destinations[i].rebuildCache(); } } /* ========== VIEWS ========== */ function areAddressesImported(bytes32[] calldata names, address[] calldata destinations) external view returns (bool) { for (uint i = 0; i < names.length; i++) { if (repository[names[i]] != destinations[i]) { return false; } } return true; } function getAddress(bytes32 name) external view returns (address) { return repository[name]; } function requireAndGetAddress(bytes32 name, string calldata reason) external view returns (address) { address _foundAddress = repository[name]; require(_foundAddress != address(0), reason); return _foundAddress; } function getSynth(bytes32 key) external view returns (address) { IIssuer issuer = IIssuer(repository["Issuer"]); require(address(issuer) != address(0), "Cannot find Issuer address"); return address(issuer.synths(key)); } /* ========== EVENTS ========== */ event AddressImported(bytes32 name, address destination); } // Internal references // https://docs.synthetix.io/contracts/source/contracts/mixinresolver contract MixinResolver { AddressResolver public resolver; mapping(bytes32 => address) private addressCache; constructor(address _resolver) internal { resolver = AddressResolver(_resolver); } /* ========== INTERNAL FUNCTIONS ========== */ function combineArrays(bytes32[] memory first, bytes32[] memory second) internal pure returns (bytes32[] memory combination) { combination = new bytes32[](first.length + second.length); for (uint i = 0; i < first.length; i++) { combination[i] = first[i]; } for (uint j = 0; j < second.length; j++) { combination[first.length + j] = second[j]; } } /* ========== PUBLIC FUNCTIONS ========== */ // Note: this function is public not external in order for it to be overridden and invoked via super in subclasses function resolverAddressesRequired() public view returns (bytes32[] memory addresses) {} function rebuildCache() public { bytes32[] memory requiredAddresses = resolverAddressesRequired(); // The resolver must call this function whenver it updates its state for (uint i = 0; i < requiredAddresses.length; i++) { bytes32 name = requiredAddresses[i]; // Note: can only be invoked once the resolver has all the targets needed added address destination = resolver.requireAndGetAddress(name, string(abi.encodePacked("Resolver missing target: ", name))); addressCache[name] = destination; emit CacheUpdated(name, destination); } } /* ========== VIEWS ========== */ function isResolverCached() external view returns (bool) { bytes32[] memory requiredAddresses = resolverAddressesRequired(); for (uint i = 0; i < requiredAddresses.length; i++) { bytes32 name = requiredAddresses[i]; // false if our cache is invalid or if the resolver doesn't have the required address if (resolver.getAddress(name) != addressCache[name] || addressCache[name] == address(0)) { return false; } } return true; } /* ========== INTERNAL FUNCTIONS ========== */ function requireAndGetAddress(bytes32 name) internal view returns (address) { address _foundAddress = addressCache[name]; require(_foundAddress != address(0), string(abi.encodePacked("Missing address: ", name))); return _foundAddress; } /* ========== EVENTS ========== */ event CacheUpdated(bytes32 name, address destination); } // https://docs.synthetix.io/contracts/source/interfaces/iflexiblestorage interface IFlexibleStorage { // Views function getUIntValue(bytes32 contractName, bytes32 record) external view returns (uint); function getUIntValues(bytes32 contractName, bytes32[] calldata records) external view returns (uint[] memory); function getIntValue(bytes32 contractName, bytes32 record) external view returns (int); function getIntValues(bytes32 contractName, bytes32[] calldata records) external view returns (int[] memory); function getAddressValue(bytes32 contractName, bytes32 record) external view returns (address); function getAddressValues(bytes32 contractName, bytes32[] calldata records) external view returns (address[] memory); function getBoolValue(bytes32 contractName, bytes32 record) external view returns (bool); function getBoolValues(bytes32 contractName, bytes32[] calldata records) external view returns (bool[] memory); function getBytes32Value(bytes32 contractName, bytes32 record) external view returns (bytes32); function getBytes32Values(bytes32 contractName, bytes32[] calldata records) external view returns (bytes32[] memory); // Mutative functions function deleteUIntValue(bytes32 contractName, bytes32 record) external; function deleteIntValue(bytes32 contractName, bytes32 record) external; function deleteAddressValue(bytes32 contractName, bytes32 record) external; function deleteBoolValue(bytes32 contractName, bytes32 record) external; function deleteBytes32Value(bytes32 contractName, bytes32 record) external; function setUIntValue( bytes32 contractName, bytes32 record, uint value ) external; function setUIntValues( bytes32 contractName, bytes32[] calldata records, uint[] calldata values ) external; function setIntValue( bytes32 contractName, bytes32 record, int value ) external; function setIntValues( bytes32 contractName, bytes32[] calldata records, int[] calldata values ) external; function setAddressValue( bytes32 contractName, bytes32 record, address value ) external; function setAddressValues( bytes32 contractName, bytes32[] calldata records, address[] calldata values ) external; function setBoolValue( bytes32 contractName, bytes32 record, bool value ) external; function setBoolValues( bytes32 contractName, bytes32[] calldata records, bool[] calldata values ) external; function setBytes32Value( bytes32 contractName, bytes32 record, bytes32 value ) external; function setBytes32Values( bytes32 contractName, bytes32[] calldata records, bytes32[] calldata values ) external; } // Internal references // https://docs.synthetix.io/contracts/source/contracts/mixinsystemsettings contract MixinSystemSettings is MixinResolver { // must match the one defined SystemSettingsLib, defined in both places due to sol v0.5 limitations bytes32 internal constant SETTING_CONTRACT_NAME = "SystemSettings"; bytes32 internal constant SETTING_WAITING_PERIOD_SECS = "waitingPeriodSecs"; bytes32 internal constant SETTING_PRICE_DEVIATION_THRESHOLD_FACTOR = "priceDeviationThresholdFactor"; bytes32 internal constant SETTING_ISSUANCE_RATIO = "issuanceRatio"; bytes32 internal constant SETTING_FEE_PERIOD_DURATION = "feePeriodDuration"; bytes32 internal constant SETTING_TARGET_THRESHOLD = "targetThreshold"; bytes32 internal constant SETTING_LIQUIDATION_DELAY = "liquidationDelay"; bytes32 internal constant SETTING_LIQUIDATION_RATIO = "liquidationRatio"; bytes32 internal constant SETTING_LIQUIDATION_ESCROW_DURATION = "liquidationEscrowDuration"; bytes32 internal constant SETTING_LIQUIDATION_PENALTY = "liquidationPenalty"; bytes32 internal constant SETTING_SELF_LIQUIDATION_PENALTY = "selfLiquidationPenalty"; bytes32 internal constant SETTING_FLAG_REWARD = "flagReward"; bytes32 internal constant SETTING_LIQUIDATE_REWARD = "liquidateReward"; bytes32 internal constant SETTING_RATE_STALE_PERIOD = "rateStalePeriod"; /* ========== Exchange Fees Related ========== */ bytes32 internal constant SETTING_EXCHANGE_FEE_RATE = "exchangeFeeRate"; bytes32 internal constant SETTING_EXCHANGE_DYNAMIC_FEE_THRESHOLD = "exchangeDynamicFeeThreshold"; bytes32 internal constant SETTING_EXCHANGE_DYNAMIC_FEE_WEIGHT_DECAY = "exchangeDynamicFeeWeightDecay"; bytes32 internal constant SETTING_EXCHANGE_DYNAMIC_FEE_ROUNDS = "exchangeDynamicFeeRounds"; bytes32 internal constant SETTING_EXCHANGE_MAX_DYNAMIC_FEE = "exchangeMaxDynamicFee"; /* ========== End Exchange Fees Related ========== */ bytes32 internal constant SETTING_MINIMUM_STAKE_TIME = "minimumStakeTime"; bytes32 internal constant SETTING_AGGREGATOR_WARNING_FLAGS = "aggregatorWarningFlags"; bytes32 internal constant SETTING_TRADING_REWARDS_ENABLED = "tradingRewardsEnabled"; bytes32 internal constant SETTING_DEBT_SNAPSHOT_STALE_TIME = "debtSnapshotStaleTime"; bytes32 internal constant SETTING_CROSS_DOMAIN_DEPOSIT_GAS_LIMIT = "crossDomainDepositGasLimit"; bytes32 internal constant SETTING_CROSS_DOMAIN_ESCROW_GAS_LIMIT = "crossDomainEscrowGasLimit"; bytes32 internal constant SETTING_CROSS_DOMAIN_REWARD_GAS_LIMIT = "crossDomainRewardGasLimit"; bytes32 internal constant SETTING_CROSS_DOMAIN_WITHDRAWAL_GAS_LIMIT = "crossDomainWithdrawalGasLimit"; bytes32 internal constant SETTING_CROSS_DOMAIN_FEE_PERIOD_CLOSE_GAS_LIMIT = "crossDomainCloseGasLimit"; bytes32 internal constant SETTING_CROSS_DOMAIN_RELAY_GAS_LIMIT = "crossDomainRelayGasLimit"; bytes32 internal constant SETTING_ETHER_WRAPPER_MAX_ETH = "etherWrapperMaxETH"; bytes32 internal constant SETTING_ETHER_WRAPPER_MINT_FEE_RATE = "etherWrapperMintFeeRate"; bytes32 internal constant SETTING_ETHER_WRAPPER_BURN_FEE_RATE = "etherWrapperBurnFeeRate"; bytes32 internal constant SETTING_WRAPPER_MAX_TOKEN_AMOUNT = "wrapperMaxTokens"; bytes32 internal constant SETTING_WRAPPER_MINT_FEE_RATE = "wrapperMintFeeRate"; bytes32 internal constant SETTING_WRAPPER_BURN_FEE_RATE = "wrapperBurnFeeRate"; bytes32 internal constant SETTING_INTERACTION_DELAY = "interactionDelay"; bytes32 internal constant SETTING_COLLAPSE_FEE_RATE = "collapseFeeRate"; bytes32 internal constant SETTING_ATOMIC_MAX_VOLUME_PER_BLOCK = "atomicMaxVolumePerBlock"; bytes32 internal constant SETTING_ATOMIC_TWAP_WINDOW = "atomicTwapWindow"; bytes32 internal constant SETTING_ATOMIC_EQUIVALENT_FOR_DEX_PRICING = "atomicEquivalentForDexPricing"; bytes32 internal constant SETTING_ATOMIC_EXCHANGE_FEE_RATE = "atomicExchangeFeeRate"; bytes32 internal constant SETTING_ATOMIC_VOLATILITY_CONSIDERATION_WINDOW = "atomicVolConsiderationWindow"; bytes32 internal constant SETTING_ATOMIC_VOLATILITY_UPDATE_THRESHOLD = "atomicVolUpdateThreshold"; bytes32 internal constant SETTING_PURE_CHAINLINK_PRICE_FOR_ATOMIC_SWAPS_ENABLED = "pureChainlinkForAtomicsEnabled"; bytes32 internal constant SETTING_CROSS_SYNTH_TRANSFER_ENABLED = "crossChainSynthTransferEnabled"; bytes32 internal constant CONTRACT_FLEXIBLESTORAGE = "FlexibleStorage"; enum CrossDomainMessageGasLimits {Deposit, Escrow, Reward, Withdrawal, CloseFeePeriod, Relay} struct DynamicFeeConfig { uint threshold; uint weightDecay; uint rounds; uint maxFee; } constructor(address _resolver) internal MixinResolver(_resolver) {} function resolverAddressesRequired() public view returns (bytes32[] memory addresses) { addresses = new bytes32[](1); addresses[0] = CONTRACT_FLEXIBLESTORAGE; } function flexibleStorage() internal view returns (IFlexibleStorage) { return IFlexibleStorage(requireAndGetAddress(CONTRACT_FLEXIBLESTORAGE)); } function _getGasLimitSetting(CrossDomainMessageGasLimits gasLimitType) internal pure returns (bytes32) { if (gasLimitType == CrossDomainMessageGasLimits.Deposit) { return SETTING_CROSS_DOMAIN_DEPOSIT_GAS_LIMIT; } else if (gasLimitType == CrossDomainMessageGasLimits.Escrow) { return SETTING_CROSS_DOMAIN_ESCROW_GAS_LIMIT; } else if (gasLimitType == CrossDomainMessageGasLimits.Reward) { return SETTING_CROSS_DOMAIN_REWARD_GAS_LIMIT; } else if (gasLimitType == CrossDomainMessageGasLimits.Withdrawal) { return SETTING_CROSS_DOMAIN_WITHDRAWAL_GAS_LIMIT; } else if (gasLimitType == CrossDomainMessageGasLimits.Relay) { return SETTING_CROSS_DOMAIN_RELAY_GAS_LIMIT; } else if (gasLimitType == CrossDomainMessageGasLimits.CloseFeePeriod) { return SETTING_CROSS_DOMAIN_FEE_PERIOD_CLOSE_GAS_LIMIT; } else { revert("Unknown gas limit type"); } } function getCrossDomainMessageGasLimit(CrossDomainMessageGasLimits gasLimitType) internal view returns (uint) { return flexibleStorage().getUIntValue(SETTING_CONTRACT_NAME, _getGasLimitSetting(gasLimitType)); } function getTradingRewardsEnabled() internal view returns (bool) { return flexibleStorage().getBoolValue(SETTING_CONTRACT_NAME, SETTING_TRADING_REWARDS_ENABLED); } function getWaitingPeriodSecs() internal view returns (uint) { return flexibleStorage().getUIntValue(SETTING_CONTRACT_NAME, SETTING_WAITING_PERIOD_SECS); } function getPriceDeviationThresholdFactor() internal view returns (uint) { return flexibleStorage().getUIntValue(SETTING_CONTRACT_NAME, SETTING_PRICE_DEVIATION_THRESHOLD_FACTOR); } function getIssuanceRatio() internal view returns (uint) { // lookup on flexible storage directly for gas savings (rather than via SystemSettings) return flexibleStorage().getUIntValue(SETTING_CONTRACT_NAME, SETTING_ISSUANCE_RATIO); } function getFeePeriodDuration() internal view returns (uint) { // lookup on flexible storage directly for gas savings (rather than via SystemSettings) return flexibleStorage().getUIntValue(SETTING_CONTRACT_NAME, SETTING_FEE_PERIOD_DURATION); } function getTargetThreshold() internal view returns (uint) { // lookup on flexible storage directly for gas savings (rather than via SystemSettings) return flexibleStorage().getUIntValue(SETTING_CONTRACT_NAME, SETTING_TARGET_THRESHOLD); } function getLiquidationDelay() internal view returns (uint) { return flexibleStorage().getUIntValue(SETTING_CONTRACT_NAME, SETTING_LIQUIDATION_DELAY); } function getLiquidationRatio() internal view returns (uint) { return flexibleStorage().getUIntValue(SETTING_CONTRACT_NAME, SETTING_LIQUIDATION_RATIO); } function getLiquidationEscrowDuration() internal view returns (uint) { return flexibleStorage().getUIntValue(SETTING_CONTRACT_NAME, SETTING_LIQUIDATION_ESCROW_DURATION); } function getLiquidationPenalty() internal view returns (uint) { return flexibleStorage().getUIntValue(SETTING_CONTRACT_NAME, SETTING_LIQUIDATION_PENALTY); } function getSelfLiquidationPenalty() internal view returns (uint) { return flexibleStorage().getUIntValue(SETTING_CONTRACT_NAME, SETTING_SELF_LIQUIDATION_PENALTY); } function getFlagReward() internal view returns (uint) { return flexibleStorage().getUIntValue(SETTING_CONTRACT_NAME, SETTING_FLAG_REWARD); } function getLiquidateReward() internal view returns (uint) { return flexibleStorage().getUIntValue(SETTING_CONTRACT_NAME, SETTING_LIQUIDATE_REWARD); } function getRateStalePeriod() internal view returns (uint) { return flexibleStorage().getUIntValue(SETTING_CONTRACT_NAME, SETTING_RATE_STALE_PERIOD); } /* ========== Exchange Related Fees ========== */ function getExchangeFeeRate(bytes32 currencyKey) internal view returns (uint) { return flexibleStorage().getUIntValue( SETTING_CONTRACT_NAME, keccak256(abi.encodePacked(SETTING_EXCHANGE_FEE_RATE, currencyKey)) ); } /// @notice Get exchange dynamic fee related keys /// @return threshold, weight decay, rounds, and max fee function getExchangeDynamicFeeConfig() internal view returns (DynamicFeeConfig memory) { bytes32[] memory keys = new bytes32[](4); keys[0] = SETTING_EXCHANGE_DYNAMIC_FEE_THRESHOLD; keys[1] = SETTING_EXCHANGE_DYNAMIC_FEE_WEIGHT_DECAY; keys[2] = SETTING_EXCHANGE_DYNAMIC_FEE_ROUNDS; keys[3] = SETTING_EXCHANGE_MAX_DYNAMIC_FEE; uint[] memory values = flexibleStorage().getUIntValues(SETTING_CONTRACT_NAME, keys); return DynamicFeeConfig({threshold: values[0], weightDecay: values[1], rounds: values[2], maxFee: values[3]}); } /* ========== End Exchange Related Fees ========== */ function getMinimumStakeTime() internal view returns (uint) { return flexibleStorage().getUIntValue(SETTING_CONTRACT_NAME, SETTING_MINIMUM_STAKE_TIME); } function getAggregatorWarningFlags() internal view returns (address) { return flexibleStorage().getAddressValue(SETTING_CONTRACT_NAME, SETTING_AGGREGATOR_WARNING_FLAGS); } function getDebtSnapshotStaleTime() internal view returns (uint) { return flexibleStorage().getUIntValue(SETTING_CONTRACT_NAME, SETTING_DEBT_SNAPSHOT_STALE_TIME); } function getEtherWrapperMaxETH() internal view returns (uint) { return flexibleStorage().getUIntValue(SETTING_CONTRACT_NAME, SETTING_ETHER_WRAPPER_MAX_ETH); } function getEtherWrapperMintFeeRate() internal view returns (uint) { return flexibleStorage().getUIntValue(SETTING_CONTRACT_NAME, SETTING_ETHER_WRAPPER_MINT_FEE_RATE); } function getEtherWrapperBurnFeeRate() internal view returns (uint) { return flexibleStorage().getUIntValue(SETTING_CONTRACT_NAME, SETTING_ETHER_WRAPPER_BURN_FEE_RATE); } function getWrapperMaxTokenAmount(address wrapper) internal view returns (uint) { return flexibleStorage().getUIntValue( SETTING_CONTRACT_NAME, keccak256(abi.encodePacked(SETTING_WRAPPER_MAX_TOKEN_AMOUNT, wrapper)) ); } function getWrapperMintFeeRate(address wrapper) internal view returns (int) { return flexibleStorage().getIntValue( SETTING_CONTRACT_NAME, keccak256(abi.encodePacked(SETTING_WRAPPER_MINT_FEE_RATE, wrapper)) ); } function getWrapperBurnFeeRate(address wrapper) internal view returns (int) { return flexibleStorage().getIntValue( SETTING_CONTRACT_NAME, keccak256(abi.encodePacked(SETTING_WRAPPER_BURN_FEE_RATE, wrapper)) ); } function getInteractionDelay(address collateral) internal view returns (uint) { return flexibleStorage().getUIntValue( SETTING_CONTRACT_NAME, keccak256(abi.encodePacked(SETTING_INTERACTION_DELAY, collateral)) ); } function getCollapseFeeRate(address collateral) internal view returns (uint) { return flexibleStorage().getUIntValue( SETTING_CONTRACT_NAME, keccak256(abi.encodePacked(SETTING_COLLAPSE_FEE_RATE, collateral)) ); } function getAtomicMaxVolumePerBlock() internal view returns (uint) { return flexibleStorage().getUIntValue(SETTING_CONTRACT_NAME, SETTING_ATOMIC_MAX_VOLUME_PER_BLOCK); } function getAtomicTwapWindow() internal view returns (uint) { return flexibleStorage().getUIntValue(SETTING_CONTRACT_NAME, SETTING_ATOMIC_TWAP_WINDOW); } function getAtomicEquivalentForDexPricing(bytes32 currencyKey) internal view returns (address) { return flexibleStorage().getAddressValue( SETTING_CONTRACT_NAME, keccak256(abi.encodePacked(SETTING_ATOMIC_EQUIVALENT_FOR_DEX_PRICING, currencyKey)) ); } function getAtomicExchangeFeeRate(bytes32 currencyKey) internal view returns (uint) { return flexibleStorage().getUIntValue( SETTING_CONTRACT_NAME, keccak256(abi.encodePacked(SETTING_ATOMIC_EXCHANGE_FEE_RATE, currencyKey)) ); } function getAtomicVolatilityConsiderationWindow(bytes32 currencyKey) internal view returns (uint) { return flexibleStorage().getUIntValue( SETTING_CONTRACT_NAME, keccak256(abi.encodePacked(SETTING_ATOMIC_VOLATILITY_CONSIDERATION_WINDOW, currencyKey)) ); } function getAtomicVolatilityUpdateThreshold(bytes32 currencyKey) internal view returns (uint) { return flexibleStorage().getUIntValue( SETTING_CONTRACT_NAME, keccak256(abi.encodePacked(SETTING_ATOMIC_VOLATILITY_UPDATE_THRESHOLD, currencyKey)) ); } function getPureChainlinkPriceForAtomicSwapsEnabled(bytes32 currencyKey) internal view returns (bool) { return flexibleStorage().getBoolValue( SETTING_CONTRACT_NAME, keccak256(abi.encodePacked(SETTING_PURE_CHAINLINK_PRICE_FOR_ATOMIC_SWAPS_ENABLED, currencyKey)) ); } function getCrossChainSynthTransferEnabled(bytes32 currencyKey) internal view returns (uint) { return flexibleStorage().getUIntValue( SETTING_CONTRACT_NAME, keccak256(abi.encodePacked(SETTING_CROSS_SYNTH_TRANSFER_ENABLED, currencyKey)) ); } } // SPDX-License-Identifier: MIT /** * @dev Wrappers over Solidity's uintXX casting operators with added overflow * checks. * * Downcasting from uint256 in Solidity does not revert on overflow. This can * easily result in undesired exploitation or bugs, since developers usually * assume that overflows raise errors. `SafeCast` restores this intuition by * reverting the transaction when such 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. * * Can be combined with {SafeMath} to extend it to smaller types, by performing * all math on `uint256` and then downcasting. */ library SafeCast { /** * @dev Returns the downcasted uint128 from uint256, reverting on * overflow (when the input is greater than largest uint128). * * Counterpart to Solidity's `uint128` operator. * * Requirements: * * - input must fit into 128 bits */ function toUint128(uint256 value) internal pure returns (uint128) { require(value < 2**128, "SafeCast: value doesn't fit in 128 bits"); return uint128(value); } /** * @dev Returns the downcasted uint64 from uint256, reverting on * overflow (when the input is greater than largest uint64). * * Counterpart to Solidity's `uint64` operator. * * Requirements: * * - input must fit into 64 bits */ function toUint64(uint256 value) internal pure returns (uint64) { require(value < 2**64, "SafeCast: value doesn't fit in 64 bits"); return uint64(value); } /** * @dev Returns the downcasted uint32 from uint256, reverting on * overflow (when the input is greater than largest uint32). * * Counterpart to Solidity's `uint32` operator. * * Requirements: * * - input must fit into 32 bits */ function toUint32(uint256 value) internal pure returns (uint32) { require(value < 2**32, "SafeCast: value doesn't fit in 32 bits"); return uint32(value); } /** * @dev Returns the downcasted uint16 from uint256, reverting on * overflow (when the input is greater than largest uint16). * * Counterpart to Solidity's `uint16` operator. * * Requirements: * * - input must fit into 16 bits */ function toUint16(uint256 value) internal pure returns (uint16) { require(value < 2**16, "SafeCast: value doesn't fit in 16 bits"); return uint16(value); } /** * @dev Returns the downcasted uint8 from uint256, reverting on * overflow (when the input is greater than largest uint8). * * Counterpart to Solidity's `uint8` operator. * * Requirements: * * - input must fit into 8 bits. */ function toUint8(uint256 value) internal pure returns (uint8) { require(value < 2**8, "SafeCast: value doesn't fit in 8 bits"); return uint8(value); } /** * @dev Converts a signed int256 into an unsigned uint256. * * Requirements: * * - input must be greater than or equal to 0. */ function toUint256(int256 value) internal pure returns (uint256) { require(value >= 0, "SafeCast: value must be positive"); return uint256(value); } /** * @dev Converts an unsigned uint256 into a signed int256. * * Requirements: * * - input must be less than or equal to maxInt256. */ function toInt256(uint256 value) internal pure returns (int256) { require(value < 2**255, "SafeCast: value doesn't fit in an int256"); return int256(value); } } /** * @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)); } } interface IVirtualSynth { // Views function balanceOfUnderlying(address account) external view returns (uint); function rate() external view returns (uint); function readyToSettle() external view returns (bool); function secsLeftInWaitingPeriod() external view returns (uint); function settled() external view returns (bool); function synth() external view returns (ISynth); // Mutative functions function settle(address account) external; } // https://docs.synthetix.io/contracts/source/interfaces/isynthetix interface ISynthetix { // Views function anySynthOrSNXRateIsInvalid() external view returns (bool anyRateInvalid); function availableCurrencyKeys() external view returns (bytes32[] memory); function availableSynthCount() external view returns (uint); function availableSynths(uint index) external view returns (ISynth); function collateral(address account) external view returns (uint); function collateralisationRatio(address issuer) external view returns (uint); function debtBalanceOf(address issuer, bytes32 currencyKey) external view returns (uint); function isWaitingPeriod(bytes32 currencyKey) external view returns (bool); function maxIssuableSynths(address issuer) external view returns (uint maxIssuable); function remainingIssuableSynths(address issuer) external view returns ( uint maxIssuable, uint alreadyIssued, uint totalSystemDebt ); function synths(bytes32 currencyKey) external view returns (ISynth); function synthsByAddress(address synthAddress) external view returns (bytes32); function totalIssuedSynths(bytes32 currencyKey) external view returns (uint); function totalIssuedSynthsExcludeOtherCollateral(bytes32 currencyKey) external view returns (uint); function transferableSynthetix(address account) external view returns (uint transferable); // Mutative Functions function burnSynths(uint amount) external; function burnSynthsOnBehalf(address burnForAddress, uint amount) external; function burnSynthsToTarget() external; function burnSynthsToTargetOnBehalf(address burnForAddress) external; function exchange( bytes32 sourceCurrencyKey, uint sourceAmount, bytes32 destinationCurrencyKey ) external returns (uint amountReceived); function exchangeOnBehalf( address exchangeForAddress, bytes32 sourceCurrencyKey, uint sourceAmount, bytes32 destinationCurrencyKey ) external returns (uint amountReceived); function exchangeWithTracking( bytes32 sourceCurrencyKey, uint sourceAmount, bytes32 destinationCurrencyKey, address rewardAddress, bytes32 trackingCode ) external returns (uint amountReceived); function exchangeWithTrackingForInitiator( bytes32 sourceCurrencyKey, uint sourceAmount, bytes32 destinationCurrencyKey, address rewardAddress, bytes32 trackingCode ) external returns (uint amountReceived); function exchangeOnBehalfWithTracking( address exchangeForAddress, bytes32 sourceCurrencyKey, uint sourceAmount, bytes32 destinationCurrencyKey, address rewardAddress, bytes32 trackingCode ) external returns (uint amountReceived); function exchangeWithVirtual( bytes32 sourceCurrencyKey, uint sourceAmount, bytes32 destinationCurrencyKey, bytes32 trackingCode ) external returns (uint amountReceived, IVirtualSynth vSynth); function exchangeAtomically( bytes32 sourceCurrencyKey, uint sourceAmount, bytes32 destinationCurrencyKey, bytes32 trackingCode, uint minAmount ) external returns (uint amountReceived); function issueMaxSynths() external; function issueMaxSynthsOnBehalf(address issueForAddress) external; function issueSynths(uint amount) external; function issueSynthsOnBehalf(address issueForAddress, uint amount) external; function mint() external returns (bool); function settle(bytes32 currencyKey) external returns ( uint reclaimed, uint refunded, uint numEntries ); // Liquidations function liquidateDelinquentAccount(address account) external returns (bool); function liquidateSelf() external returns (bool); // Restricted Functions function mintSecondary(address account, uint amount) external; function mintSecondaryRewards(uint amount) external; function burnSecondary(address account, uint amount) external; } // https://docs.synthetix.io/contracts/source/interfaces/ifeepool interface IFeePool { // Views // solhint-disable-next-line func-name-mixedcase function FEE_ADDRESS() external view returns (address); function feesAvailable(address account) external view returns (uint, uint); function feePeriodDuration() external view returns (uint); function isFeesClaimable(address account) external view returns (bool); function targetThreshold() external view returns (uint); function totalFeesAvailable() external view returns (uint); function totalRewardsAvailable() external view returns (uint); // Mutative Functions function claimFees() external returns (bool); function claimOnBehalf(address claimingForAddress) external returns (bool); function closeCurrentFeePeriod() external; function closeSecondary(uint snxBackedDebt, uint debtShareSupply) external; function recordFeePaid(uint sUSDAmount) external; function setRewardsToDistribute(uint amount) external; } // https://docs.synthetix.io/contracts/source/interfaces/isynthetixdebtshare interface ISynthetixDebtShare { // Views function currentPeriodId() external view returns (uint128); function allowance(address account, address spender) external view returns (uint); function balanceOf(address account) external view returns (uint); function balanceOfOnPeriod(address account, uint periodId) external view returns (uint); function totalSupply() external view returns (uint); function sharePercent(address account) external view returns (uint); function sharePercentOnPeriod(address account, uint periodId) external view returns (uint); // Mutative functions function takeSnapshot(uint128 id) external; function mintShare(address account, uint256 amount) external; function burnShare(address account, uint256 amount) external; function approve(address, uint256) external pure returns (bool); function transfer(address to, uint256 amount) external pure returns (bool); function transferFrom( address from, address to, uint256 amount ) external returns (bool); function addAuthorizedBroker(address target) external; function removeAuthorizedBroker(address target) external; function addAuthorizedToSnapshot(address target) external; function removeAuthorizedToSnapshot(address target) external; } // https://docs.synthetix.io/contracts/source/interfaces/iexchanger interface IExchanger { struct ExchangeEntrySettlement { bytes32 src; uint amount; bytes32 dest; uint reclaim; uint rebate; uint srcRoundIdAtPeriodEnd; uint destRoundIdAtPeriodEnd; uint timestamp; } struct ExchangeEntry { uint sourceRate; uint destinationRate; uint destinationAmount; uint exchangeFeeRate; uint exchangeDynamicFeeRate; uint roundIdForSrc; uint roundIdForDest; } // Views function calculateAmountAfterSettlement( address from, bytes32 currencyKey, uint amount, uint refunded ) external view returns (uint amountAfterSettlement); function isSynthRateInvalid(bytes32 currencyKey) external view returns (bool); function maxSecsLeftInWaitingPeriod(address account, bytes32 currencyKey) external view returns (uint); function settlementOwing(address account, bytes32 currencyKey) external view returns ( uint reclaimAmount, uint rebateAmount, uint numEntries ); function hasWaitingPeriodOrSettlementOwing(address account, bytes32 currencyKey) external view returns (bool); function feeRateForExchange(bytes32 sourceCurrencyKey, bytes32 destinationCurrencyKey) external view returns (uint); function dynamicFeeRateForExchange(bytes32 sourceCurrencyKey, bytes32 destinationCurrencyKey) external view returns (uint feeRate, bool tooVolatile); function getAmountsForExchange( uint sourceAmount, bytes32 sourceCurrencyKey, bytes32 destinationCurrencyKey ) external view returns ( uint amountReceived, uint fee, uint exchangeFeeRate ); function priceDeviationThresholdFactor() external view returns (uint); function waitingPeriodSecs() external view returns (uint); function lastExchangeRate(bytes32 currencyKey) external view returns (uint); // Mutative functions function exchange( address exchangeForAddress, address from, bytes32 sourceCurrencyKey, uint sourceAmount, bytes32 destinationCurrencyKey, address destinationAddress, bool virtualSynth, address rewardAddress, bytes32 trackingCode ) external returns (uint amountReceived, IVirtualSynth vSynth); function exchangeAtomically( address from, bytes32 sourceCurrencyKey, uint sourceAmount, bytes32 destinationCurrencyKey, address destinationAddress, bytes32 trackingCode, uint minAmount ) external returns (uint amountReceived); function settle(address from, bytes32 currencyKey) external returns ( uint reclaimed, uint refunded, uint numEntries ); function suspendSynthWithInvalidRate(bytes32 currencyKey) external; } // https://docs.synthetix.io/contracts/source/interfaces/idelegateapprovals interface IDelegateApprovals { // Views function canBurnFor(address authoriser, address delegate) external view returns (bool); function canIssueFor(address authoriser, address delegate) external view returns (bool); function canClaimFor(address authoriser, address delegate) external view returns (bool); function canExchangeFor(address authoriser, address delegate) external view returns (bool); // Mutative function approveAllDelegatePowers(address delegate) external; function removeAllDelegatePowers(address delegate) external; function approveBurnOnBehalf(address delegate) external; function removeBurnOnBehalf(address delegate) external; function approveIssueOnBehalf(address delegate) external; function removeIssueOnBehalf(address delegate) external; function approveClaimOnBehalf(address delegate) external; function removeClaimOnBehalf(address delegate) external; function approveExchangeOnBehalf(address delegate) external; function removeExchangeOnBehalf(address delegate) external; } // https://docs.synthetix.io/contracts/source/interfaces/iexchangerates interface IExchangeRates { // Structs struct RateAndUpdatedTime { uint216 rate; uint40 time; } // Views function aggregators(bytes32 currencyKey) external view returns (address); function aggregatorWarningFlags() external view returns (address); function anyRateIsInvalid(bytes32[] calldata currencyKeys) external view returns (bool); function anyRateIsInvalidAtRound(bytes32[] calldata currencyKeys, uint[] calldata roundIds) external view returns (bool); function currenciesUsingAggregator(address aggregator) external view returns (bytes32[] memory); function effectiveValue( bytes32 sourceCurrencyKey, uint sourceAmount, bytes32 destinationCurrencyKey ) external view returns (uint value); function effectiveValueAndRates( bytes32 sourceCurrencyKey, uint sourceAmount, bytes32 destinationCurrencyKey ) external view returns ( uint value, uint sourceRate, uint destinationRate ); function effectiveValueAndRatesAtRound( bytes32 sourceCurrencyKey, uint sourceAmount, bytes32 destinationCurrencyKey, uint roundIdForSrc, uint roundIdForDest ) external view returns ( uint value, uint sourceRate, uint destinationRate ); function effectiveAtomicValueAndRates( bytes32 sourceCurrencyKey, uint sourceAmount, bytes32 destinationCurrencyKey ) external view returns ( uint value, uint systemValue, uint systemSourceRate, uint systemDestinationRate ); function getCurrentRoundId(bytes32 currencyKey) external view returns (uint); function getLastRoundIdBeforeElapsedSecs( bytes32 currencyKey, uint startingRoundId, uint startingTimestamp, uint timediff ) external view returns (uint); function lastRateUpdateTimes(bytes32 currencyKey) external view returns (uint256); function rateAndTimestampAtRound(bytes32 currencyKey, uint roundId) external view returns (uint rate, uint time); function rateAndUpdatedTime(bytes32 currencyKey) external view returns (uint rate, uint time); function rateAndInvalid(bytes32 currencyKey) external view returns (uint rate, bool isInvalid); function rateForCurrency(bytes32 currencyKey) external view returns (uint); function rateIsFlagged(bytes32 currencyKey) external view returns (bool); function rateIsInvalid(bytes32 currencyKey) external view returns (bool); function rateIsStale(bytes32 currencyKey) external view returns (bool); function rateStalePeriod() external view returns (uint); function ratesAndUpdatedTimeForCurrencyLastNRounds( bytes32 currencyKey, uint numRounds, uint roundId ) external view returns (uint[] memory rates, uint[] memory times); function ratesAndInvalidForCurrencies(bytes32[] calldata currencyKeys) external view returns (uint[] memory rates, bool anyRateInvalid); function ratesForCurrencies(bytes32[] calldata currencyKeys) external view returns (uint[] memory); function synthTooVolatileForAtomicExchange(bytes32 currencyKey) external view returns (bool); } // https://docs.synthetix.io/contracts/source/interfaces/ihasbalance interface IHasBalance { // Views function balanceOf(address account) external view returns (uint); } // https://docs.synthetix.io/contracts/source/interfaces/ierc20 interface IERC20 { // ERC20 Optional Views function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); // Views function totalSupply() external view returns (uint); function balanceOf(address owner) external view returns (uint); function allowance(address owner, address spender) external view returns (uint); // Mutative functions function transfer(address to, uint value) external returns (bool); function approve(address spender, uint value) external returns (bool); function transferFrom( address from, address to, uint value ) external returns (bool); // Events event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } interface ILiquidator { // Views function issuanceRatio() external view returns (uint); function liquidationDelay() external view returns (uint); function liquidationRatio() external view returns (uint); function liquidationEscrowDuration() external view returns (uint); function liquidationPenalty() external view returns (uint); function selfLiquidationPenalty() external view returns (uint); function liquidateReward() external view returns (uint); function flagReward() external view returns (uint); function liquidationCollateralRatio() external view returns (uint); function getLiquidationDeadlineForAccount(address account) external view returns (uint); function getLiquidationCallerForAccount(address account) external view returns (address); function isLiquidationOpen(address account, bool isSelfLiquidation) external view returns (bool); function isLiquidationDeadlinePassed(address account) external view returns (bool); function calculateAmountToFixCollateral( uint debtBalance, uint collateral, uint penalty ) external view returns (uint); // Mutative Functions function flagAccountForLiquidation(address account) external; // Restricted: used internally to Synthetix contracts function removeAccountInLiquidation(address account) external; function checkAndRemoveAccountInLiquidation(address account) external; } interface ILiquidatorRewards { // Views function earned(address account) external view returns (uint256); // Mutative function getReward(address account) external; function notifyRewardAmount(uint256 reward) external; function updateEntry(address account) external; } interface ICollateralManager { // Manager information function hasCollateral(address collateral) external view returns (bool); function isSynthManaged(bytes32 currencyKey) external view returns (bool); // State information function long(bytes32 synth) external view returns (uint amount); function short(bytes32 synth) external view returns (uint amount); function totalLong() external view returns (uint susdValue, bool anyRateIsInvalid); function totalShort() external view returns (uint susdValue, bool anyRateIsInvalid); function getBorrowRate() external view returns (uint borrowRate, bool anyRateIsInvalid); function getShortRate(bytes32 synth) external view returns (uint shortRate, bool rateIsInvalid); function getRatesAndTime(uint index) external view returns ( uint entryRate, uint lastRate, uint lastUpdated, uint newIndex ); function getShortRatesAndTime(bytes32 currency, uint index) external view returns ( uint entryRate, uint lastRate, uint lastUpdated, uint newIndex ); function exceedsDebtLimit(uint amount, bytes32 currency) external view returns (bool canIssue, bool anyRateIsInvalid); function areSynthsAndCurrenciesSet(bytes32[] calldata requiredSynthNamesInResolver, bytes32[] calldata synthKeys) external view returns (bool); function areShortableSynthsSet(bytes32[] calldata requiredSynthNamesInResolver, bytes32[] calldata synthKeys) external view returns (bool); // Loans function getNewLoanId() external returns (uint id); // Manager mutative function addCollaterals(address[] calldata collaterals) external; function removeCollaterals(address[] calldata collaterals) external; function addSynths(bytes32[] calldata synthNamesInResolver, bytes32[] calldata synthKeys) external; function removeSynths(bytes32[] calldata synths, bytes32[] calldata synthKeys) external; function addShortableSynths(bytes32[] calldata requiredSynthNamesInResolver, bytes32[] calldata synthKeys) external; function removeShortableSynths(bytes32[] calldata synths) external; // State mutative function incrementLongs(bytes32 synth, uint amount) external; function decrementLongs(bytes32 synth, uint amount) external; function incrementShorts(bytes32 synth, uint amount) external; function decrementShorts(bytes32 synth, uint amount) external; function accrueInterest( uint interestIndex, bytes32 currency, bool isShort ) external returns (uint difference, uint index); function updateBorrowRatesCollateral(uint rate) external; function updateShortRatesCollateral(bytes32 currency, uint rate) external; } pragma experimental ABIEncoderV2; library VestingEntries { struct VestingEntry { uint64 endTime; uint256 escrowAmount; } struct VestingEntryWithID { uint64 endTime; uint256 escrowAmount; uint256 entryID; } } interface IRewardEscrowV2 { // Views function balanceOf(address account) external view returns (uint); function numVestingEntries(address account) external view returns (uint); function totalEscrowedAccountBalance(address account) external view returns (uint); function totalVestedAccountBalance(address account) external view returns (uint); function getVestingQuantity(address account, uint256[] calldata entryIDs) external view returns (uint); function getVestingSchedules( address account, uint256 index, uint256 pageSize ) external view returns (VestingEntries.VestingEntryWithID[] memory); function getAccountVestingEntryIDs( address account, uint256 index, uint256 pageSize ) external view returns (uint256[] memory); function getVestingEntryClaimable(address account, uint256 entryID) external view returns (uint); function getVestingEntry(address account, uint256 entryID) external view returns (uint64, uint256); // Mutative functions function vest(uint256[] calldata entryIDs) external; function createEscrowEntry( address beneficiary, uint256 deposit, uint256 duration ) external; function appendVestingEntry( address account, uint256 quantity, uint256 duration ) external; function migrateVestingSchedule(address _addressToMigrate) external; function migrateAccountEscrowBalances( address[] calldata accounts, uint256[] calldata escrowBalances, uint256[] calldata vestedBalances ) external; // Account Merging function startMergingWindow() external; function mergeAccount(address accountToMerge, uint256[] calldata entryIDs) external; function nominateAccountToMerge(address account) external; function accountMergingIsOpen() external view returns (bool); // L2 Migration function importVestingEntries( address account, uint256 escrowedAmount, VestingEntries.VestingEntry[] calldata vestingEntries ) external; // Return amount of SNX transfered to SynthetixBridgeToOptimism deposit contract function burnForMigration(address account, uint256[] calldata entryIDs) external returns (uint256 escrowedAccountBalance, VestingEntries.VestingEntry[] memory vestingEntries); } interface ISynthRedeemer { // Rate of redemption - 0 for none function redemptions(address synthProxy) external view returns (uint redeemRate); // sUSD balance of deprecated token holder function balanceOf(IERC20 synthProxy, address account) external view returns (uint balanceOfInsUSD); // Full sUSD supply of token function totalSupply(IERC20 synthProxy) external view returns (uint totalSupplyInsUSD); function redeem(IERC20 synthProxy) external; function redeemAll(IERC20[] calldata synthProxies) external; function redeemPartial(IERC20 synthProxy, uint amountOfSynth) external; // Restricted to Issuer function deprecate(IERC20 synthProxy, uint rateToRedeem) external; } // https://docs.synthetix.io/contracts/source/interfaces/isystemstatus interface ISystemStatus { struct Status { bool canSuspend; bool canResume; } struct Suspension { bool suspended; // reason is an integer code, // 0 => no reason, 1 => upgrading, 2+ => defined by system usage uint248 reason; } // Views function accessControl(bytes32 section, address account) external view returns (bool canSuspend, bool canResume); function requireSystemActive() external view; function systemSuspended() external view returns (bool); function requireIssuanceActive() external view; function requireExchangeActive() external view; function requireFuturesActive() external view; function requireFuturesMarketActive(bytes32 marketKey) external view; function requireExchangeBetweenSynthsAllowed(bytes32 sourceCurrencyKey, bytes32 destinationCurrencyKey) external view; function requireSynthActive(bytes32 currencyKey) external view; function synthSuspended(bytes32 currencyKey) external view returns (bool); function requireSynthsActive(bytes32 sourceCurrencyKey, bytes32 destinationCurrencyKey) external view; function systemSuspension() external view returns (bool suspended, uint248 reason); function issuanceSuspension() external view returns (bool suspended, uint248 reason); function exchangeSuspension() external view returns (bool suspended, uint248 reason); function futuresSuspension() external view returns (bool suspended, uint248 reason); function synthExchangeSuspension(bytes32 currencyKey) external view returns (bool suspended, uint248 reason); function synthSuspension(bytes32 currencyKey) external view returns (bool suspended, uint248 reason); function futuresMarketSuspension(bytes32 marketKey) external view returns (bool suspended, uint248 reason); function getSynthExchangeSuspensions(bytes32[] calldata synths) external view returns (bool[] memory exchangeSuspensions, uint256[] memory reasons); function getSynthSuspensions(bytes32[] calldata synths) external view returns (bool[] memory suspensions, uint256[] memory reasons); function getFuturesMarketSuspensions(bytes32[] calldata marketKeys) external view returns (bool[] memory suspensions, uint256[] memory reasons); // Restricted functions function suspendIssuance(uint256 reason) external; function suspendSynth(bytes32 currencyKey, uint256 reason) external; function suspendFuturesMarket(bytes32 marketKey, uint256 reason) external; function updateAccessControl( bytes32 section, address account, bool canSuspend, bool canResume ) external; } // Inheritance // Internal references // https://docs.synthetix.io/contracts/source/contracts/proxy contract Proxy is Owned { Proxyable public target; constructor(address _owner) public Owned(_owner) {} function setTarget(Proxyable _target) external onlyOwner { target = _target; emit TargetUpdated(_target); } function _emit( bytes calldata callData, uint numTopics, bytes32 topic1, bytes32 topic2, bytes32 topic3, bytes32 topic4 ) external onlyTarget { uint size = callData.length; bytes memory _callData = callData; assembly { /* The first 32 bytes of callData contain its length (as specified by the abi). * Length is assumed to be a uint256 and therefore maximum of 32 bytes * in length. It is also leftpadded to be a multiple of 32 bytes. * This means moving call_data across 32 bytes guarantees we correctly access * the data itself. */ switch numTopics case 0 { log0(add(_callData, 32), size) } case 1 { log1(add(_callData, 32), size, topic1) } case 2 { log2(add(_callData, 32), size, topic1, topic2) } case 3 { log3(add(_callData, 32), size, topic1, topic2, topic3) } case 4 { log4(add(_callData, 32), size, topic1, topic2, topic3, topic4) } } } // solhint-disable no-complex-fallback function() external payable { // Mutable call setting Proxyable.messageSender as this is using call not delegatecall target.setMessageSender(msg.sender); assembly { let free_ptr := mload(0x40) calldatacopy(free_ptr, 0, calldatasize) /* We must explicitly forward ether to the underlying contract as well. */ let result := call(gas, sload(target_slot), callvalue, free_ptr, calldatasize, 0, 0) returndatacopy(free_ptr, 0, returndatasize) if iszero(result) { revert(free_ptr, returndatasize) } return(free_ptr, returndatasize) } } modifier onlyTarget { require(Proxyable(msg.sender) == target, "Must be proxy target"); _; } event TargetUpdated(Proxyable newTarget); } // Inheritance // Internal references // https://docs.synthetix.io/contracts/source/contracts/proxyable contract Proxyable is Owned { // This contract should be treated like an abstract contract /* The proxy this contract exists behind. */ Proxy public proxy; /* The caller of the proxy, passed through to this contract. * Note that every function using this member must apply the onlyProxy or * optionalProxy modifiers, otherwise their invocations can use stale values. */ address public messageSender; constructor(address payable _proxy) internal { // This contract is abstract, and thus cannot be instantiated directly require(owner != address(0), "Owner must be set"); proxy = Proxy(_proxy); emit ProxyUpdated(_proxy); } function setProxy(address payable _proxy) external onlyOwner { proxy = Proxy(_proxy); emit ProxyUpdated(_proxy); } function setMessageSender(address sender) external onlyProxy { messageSender = sender; } modifier onlyProxy { _onlyProxy(); _; } function _onlyProxy() private view { require(Proxy(msg.sender) == proxy, "Only the proxy can call"); } modifier optionalProxy { _optionalProxy(); _; } function _optionalProxy() private { if (Proxy(msg.sender) != proxy && messageSender != msg.sender) { messageSender = msg.sender; } } modifier optionalProxy_onlyOwner { _optionalProxy_onlyOwner(); _; } // solhint-disable-next-line func-name-mixedcase function _optionalProxy_onlyOwner() private { if (Proxy(msg.sender) != proxy && messageSender != msg.sender) { messageSender = msg.sender; } require(messageSender == owner, "Owner only function"); } event ProxyUpdated(address proxyAddress); } interface AggregatorInterface { function latestAnswer() external view returns (int256); function latestTimestamp() external view returns (uint256); function latestRound() external view returns (uint256); function getAnswer(uint256 roundId) external view returns (int256); function getTimestamp(uint256 roundId) external view returns (uint256); event AnswerUpdated(int256 indexed current, uint256 indexed roundId, uint256 timestamp); event NewRound(uint256 indexed roundId, address indexed startedBy, uint256 startedAt); } interface AggregatorV3Interface { function decimals() external view returns (uint8); function description() external view returns (string memory); function version() external view returns (uint256); // getRoundData and latestRoundData should both raise "No data present" // if they do not have data to report, instead of returning unset values // which could be misinterpreted as actual reported values. function getRoundData(uint80 _roundId) external view returns ( uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound ); function latestRoundData() external view returns ( uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound ); } /** * @title The V2 & V3 Aggregator Interface * @notice Solidity V0.5 does not allow interfaces to inherit from other * interfaces so this contract is a combination of v0.5 AggregatorInterface.sol * and v0.5 AggregatorV3Interface.sol. */ interface AggregatorV2V3Interface { // // V2 Interface: // function latestAnswer() external view returns (int256); function latestTimestamp() external view returns (uint256); function latestRound() external view returns (uint256); function getAnswer(uint256 roundId) external view returns (int256); function getTimestamp(uint256 roundId) external view returns (uint256); event AnswerUpdated(int256 indexed current, uint256 indexed roundId, uint256 timestamp); event NewRound(uint256 indexed roundId, address indexed startedBy, uint256 startedAt); // // V3 Interface: // function decimals() external view returns (uint8); function description() external view returns (string memory); function version() external view returns (uint256); // getRoundData and latestRoundData should both raise "No data present" // if they do not have data to report, instead of returning unset values // which could be misinterpreted as actual reported values. function getRoundData(uint80 _roundId) external view returns ( uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound ); function latestRoundData() external view returns ( uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound ); } // Inheritance // Libraries // Internal references interface IProxy { function target() external view returns (address); } interface IIssuerInternalDebtCache { function updateCachedSynthDebtWithRate(bytes32 currencyKey, uint currencyRate) external; function updateCachedSynthDebtsWithRates(bytes32[] calldata currencyKeys, uint[] calldata currencyRates) external; function updateDebtCacheValidity(bool currentlyInvalid) external; function totalNonSnxBackedDebt() external view returns (uint excludedDebt, bool isInvalid); function cacheInfo() external view returns ( uint cachedDebt, uint timestamp, bool isInvalid, bool isStale ); function updateCachedsUSDDebt(int amount) external; } // https://docs.synthetix.io/contracts/source/contracts/issuer contract Issuer is Owned, MixinSystemSettings, IIssuer { using SafeMath for uint; using SafeDecimalMath for uint; bytes32 public constant CONTRACT_NAME = "Issuer"; // SIP-165: Circuit breaker for Debt Synthesis uint public constant CIRCUIT_BREAKER_SUSPENSION_REASON = 165; // Available Synths which can be used with the system ISynth[] public availableSynths; mapping(bytes32 => ISynth) public synths; mapping(address => bytes32) public synthsByAddress; uint public lastDebtRatio; /* ========== ENCODED NAMES ========== */ bytes32 internal constant sUSD = "sUSD"; bytes32 internal constant sETH = "sETH"; bytes32 internal constant SNX = "SNX"; // Flexible storage names bytes32 internal constant LAST_ISSUE_EVENT = "lastIssueEvent"; /* ========== ADDRESS RESOLVER CONFIGURATION ========== */ bytes32 private constant CONTRACT_SYNTHETIX = "Synthetix"; bytes32 private constant CONTRACT_EXCHANGER = "Exchanger"; bytes32 private constant CONTRACT_EXRATES = "ExchangeRates"; bytes32 private constant CONTRACT_SYNTHETIXDEBTSHARE = "SynthetixDebtShare"; bytes32 private constant CONTRACT_FEEPOOL = "FeePool"; bytes32 private constant CONTRACT_DELEGATEAPPROVALS = "DelegateApprovals"; bytes32 private constant CONTRACT_REWARDESCROW_V2 = "RewardEscrowV2"; bytes32 private constant CONTRACT_SYNTHETIXESCROW = "SynthetixEscrow"; bytes32 private constant CONTRACT_LIQUIDATOR = "Liquidator"; bytes32 private constant CONTRACT_LIQUIDATOR_REWARDS = "LiquidatorRewards"; bytes32 private constant CONTRACT_DEBTCACHE = "DebtCache"; bytes32 private constant CONTRACT_SYNTHREDEEMER = "SynthRedeemer"; bytes32 private constant CONTRACT_SYSTEMSTATUS = "SystemStatus"; bytes32 private constant CONTRACT_SYNTHETIXBRIDGETOOPTIMISM = "SynthetixBridgeToOptimism"; bytes32 private constant CONTRACT_SYNTHETIXBRIDGETOBASE = "SynthetixBridgeToBase"; bytes32 private constant CONTRACT_EXT_AGGREGATOR_ISSUED_SYNTHS = "ext:AggregatorIssuedSynths"; bytes32 private constant CONTRACT_EXT_AGGREGATOR_DEBT_RATIO = "ext:AggregatorDebtRatio"; constructor(address _owner, address _resolver) public Owned(_owner) MixinSystemSettings(_resolver) {} /* ========== VIEWS ========== */ function resolverAddressesRequired() public view returns (bytes32[] memory addresses) { bytes32[] memory existingAddresses = MixinSystemSettings.resolverAddressesRequired(); bytes32[] memory newAddresses = new bytes32[](15); newAddresses[0] = CONTRACT_SYNTHETIX; newAddresses[1] = CONTRACT_EXCHANGER; newAddresses[2] = CONTRACT_EXRATES; newAddresses[3] = CONTRACT_SYNTHETIXDEBTSHARE; newAddresses[4] = CONTRACT_FEEPOOL; newAddresses[5] = CONTRACT_DELEGATEAPPROVALS; newAddresses[6] = CONTRACT_REWARDESCROW_V2; newAddresses[7] = CONTRACT_SYNTHETIXESCROW; newAddresses[8] = CONTRACT_LIQUIDATOR; newAddresses[9] = CONTRACT_LIQUIDATOR_REWARDS; newAddresses[10] = CONTRACT_DEBTCACHE; newAddresses[11] = CONTRACT_SYNTHREDEEMER; newAddresses[12] = CONTRACT_SYSTEMSTATUS; newAddresses[13] = CONTRACT_EXT_AGGREGATOR_ISSUED_SYNTHS; newAddresses[14] = CONTRACT_EXT_AGGREGATOR_DEBT_RATIO; return combineArrays(existingAddresses, newAddresses); } function synthetix() internal view returns (ISynthetix) { return ISynthetix(requireAndGetAddress(CONTRACT_SYNTHETIX)); } function exchanger() internal view returns (IExchanger) { return IExchanger(requireAndGetAddress(CONTRACT_EXCHANGER)); } function exchangeRates() internal view returns (IExchangeRates) { return IExchangeRates(requireAndGetAddress(CONTRACT_EXRATES)); } function synthetixDebtShare() internal view returns (ISynthetixDebtShare) { return ISynthetixDebtShare(requireAndGetAddress(CONTRACT_SYNTHETIXDEBTSHARE)); } function feePool() internal view returns (IFeePool) { return IFeePool(requireAndGetAddress(CONTRACT_FEEPOOL)); } function liquidator() internal view returns (ILiquidator) { return ILiquidator(requireAndGetAddress(CONTRACT_LIQUIDATOR)); } function liquidatorRewards() internal view returns (ILiquidatorRewards) { return ILiquidatorRewards(requireAndGetAddress(CONTRACT_LIQUIDATOR_REWARDS)); } function delegateApprovals() internal view returns (IDelegateApprovals) { return IDelegateApprovals(requireAndGetAddress(CONTRACT_DELEGATEAPPROVALS)); } function rewardEscrowV2() internal view returns (IRewardEscrowV2) { return IRewardEscrowV2(requireAndGetAddress(CONTRACT_REWARDESCROW_V2)); } function synthetixEscrow() internal view returns (IHasBalance) { return IHasBalance(requireAndGetAddress(CONTRACT_SYNTHETIXESCROW)); } function debtCache() internal view returns (IIssuerInternalDebtCache) { return IIssuerInternalDebtCache(requireAndGetAddress(CONTRACT_DEBTCACHE)); } function synthRedeemer() internal view returns (ISynthRedeemer) { return ISynthRedeemer(requireAndGetAddress(CONTRACT_SYNTHREDEEMER)); } function systemStatus() internal view returns (ISystemStatus) { return ISystemStatus(requireAndGetAddress(CONTRACT_SYSTEMSTATUS)); } function allNetworksDebtInfo() public view returns ( uint256 debt, uint256 sharesSupply, bool isStale ) { (, int256 rawIssuedSynths, , uint issuedSynthsUpdatedAt, ) = AggregatorV2V3Interface(requireAndGetAddress(CONTRACT_EXT_AGGREGATOR_ISSUED_SYNTHS)).latestRoundData(); (, int256 rawRatio, , uint ratioUpdatedAt, ) = AggregatorV2V3Interface(requireAndGetAddress(CONTRACT_EXT_AGGREGATOR_DEBT_RATIO)).latestRoundData(); debt = uint(rawIssuedSynths); sharesSupply = rawRatio == 0 ? 0 : debt.divideDecimalRoundPrecise(uint(rawRatio)); isStale = block.timestamp - getRateStalePeriod() > issuedSynthsUpdatedAt || block.timestamp - getRateStalePeriod() > ratioUpdatedAt; } function issuanceRatio() external view returns (uint) { return getIssuanceRatio(); } function _sharesForDebt(uint debtAmount) internal view returns (uint) { (, int256 rawRatio, , , ) = AggregatorV2V3Interface(requireAndGetAddress(CONTRACT_EXT_AGGREGATOR_DEBT_RATIO)).latestRoundData(); return rawRatio == 0 ? 0 : debtAmount.divideDecimalRoundPrecise(uint(rawRatio)); } function _debtForShares(uint sharesAmount) internal view returns (uint) { (, int256 rawRatio, , , ) = AggregatorV2V3Interface(requireAndGetAddress(CONTRACT_EXT_AGGREGATOR_DEBT_RATIO)).latestRoundData(); return sharesAmount.multiplyDecimalRoundPrecise(uint(rawRatio)); } function _availableCurrencyKeysWithOptionalSNX(bool withSNX) internal view returns (bytes32[] memory) { bytes32[] memory currencyKeys = new bytes32[](availableSynths.length + (withSNX ? 1 : 0)); for (uint i = 0; i < availableSynths.length; i++) { currencyKeys[i] = synthsByAddress[address(availableSynths[i])]; } if (withSNX) { currencyKeys[availableSynths.length] = SNX; } return currencyKeys; } // Returns the total value of the debt pool in currency specified by `currencyKey`. // To return only the SNX-backed debt, set `excludeCollateral` to true. function _totalIssuedSynths(bytes32 currencyKey, bool excludeCollateral) internal view returns (uint totalIssued, bool anyRateIsInvalid) { (uint debt, , bool cacheIsInvalid, bool cacheIsStale) = debtCache().cacheInfo(); anyRateIsInvalid = cacheIsInvalid || cacheIsStale; IExchangeRates exRates = exchangeRates(); // Add total issued synths from non snx collateral back into the total if not excluded if (!excludeCollateral) { (uint nonSnxDebt, bool invalid) = debtCache().totalNonSnxBackedDebt(); debt = debt.add(nonSnxDebt); anyRateIsInvalid = anyRateIsInvalid || invalid; } if (currencyKey == sUSD) { return (debt, anyRateIsInvalid); } (uint currencyRate, bool currencyRateInvalid) = exRates.rateAndInvalid(currencyKey); return (debt.divideDecimalRound(currencyRate), anyRateIsInvalid || currencyRateInvalid); } function _debtBalanceOfAndTotalDebt(uint debtShareBalance, bytes32 currencyKey) internal view returns ( uint debtBalance, uint totalSystemValue, bool anyRateIsInvalid ) { // What's the total value of the system excluding ETH backed synths in their requested currency? (uint snxBackedAmount, , bool debtInfoStale) = allNetworksDebtInfo(); if (debtShareBalance == 0) { return (0, snxBackedAmount, debtInfoStale); } // existing functionality requires for us to convert into the exchange rate specified by `currencyKey` (uint currencyRate, bool currencyRateInvalid) = exchangeRates().rateAndInvalid(currencyKey); debtBalance = _debtForShares(debtShareBalance).divideDecimalRound(currencyRate); totalSystemValue = snxBackedAmount; anyRateIsInvalid = currencyRateInvalid || debtInfoStale; } function _canBurnSynths(address account) internal view returns (bool) { return now >= _lastIssueEvent(account).add(getMinimumStakeTime()); } function _lastIssueEvent(address account) internal view returns (uint) { // Get the timestamp of the last issue this account made return flexibleStorage().getUIntValue(CONTRACT_NAME, keccak256(abi.encodePacked(LAST_ISSUE_EVENT, account))); } function _remainingIssuableSynths(address _issuer) internal view returns ( uint maxIssuable, uint alreadyIssued, uint totalSystemDebt, bool anyRateIsInvalid ) { (alreadyIssued, totalSystemDebt, anyRateIsInvalid) = _debtBalanceOfAndTotalDebt( synthetixDebtShare().balanceOf(_issuer), sUSD ); (uint issuable, bool isInvalid) = _maxIssuableSynths(_issuer); maxIssuable = issuable; anyRateIsInvalid = anyRateIsInvalid || isInvalid; if (alreadyIssued >= maxIssuable) { maxIssuable = 0; } else { maxIssuable = maxIssuable.sub(alreadyIssued); } } function _snxToUSD(uint amount, uint snxRate) internal pure returns (uint) { return amount.multiplyDecimalRound(snxRate); } function _usdToSnx(uint amount, uint snxRate) internal pure returns (uint) { return amount.divideDecimalRound(snxRate); } function _maxIssuableSynths(address _issuer) internal view returns (uint, bool) { // What is the value of their SNX balance in sUSD (uint snxRate, bool isInvalid) = exchangeRates().rateAndInvalid(SNX); uint destinationValue = _snxToUSD(_collateral(_issuer), snxRate); // They're allowed to issue up to issuanceRatio of that value return (destinationValue.multiplyDecimal(getIssuanceRatio()), isInvalid); } function _collateralisationRatio(address _issuer) internal view returns (uint, bool) { uint totalOwnedSynthetix = _collateral(_issuer); (uint debtBalance, , bool anyRateIsInvalid) = _debtBalanceOfAndTotalDebt(synthetixDebtShare().balanceOf(_issuer), SNX); // it's more gas intensive to put this check here if they have 0 SNX, but it complies with the interface if (totalOwnedSynthetix == 0) return (0, anyRateIsInvalid); return (debtBalance.divideDecimalRound(totalOwnedSynthetix), anyRateIsInvalid); } function _collateral(address account) internal view returns (uint) { uint balance = IERC20(address(synthetix())).balanceOf(account); if (address(synthetixEscrow()) != address(0)) { balance = balance.add(synthetixEscrow().balanceOf(account)); } if (address(rewardEscrowV2()) != address(0)) { balance = balance.add(rewardEscrowV2().balanceOf(account)); } if (address(liquidatorRewards()) != address(0)) { balance = balance.add(liquidatorRewards().earned(account)); } return balance; } function minimumStakeTime() external view returns (uint) { return getMinimumStakeTime(); } function canBurnSynths(address account) external view returns (bool) { return _canBurnSynths(account); } function availableCurrencyKeys() external view returns (bytes32[] memory) { return _availableCurrencyKeysWithOptionalSNX(false); } function availableSynthCount() external view returns (uint) { return availableSynths.length; } function anySynthOrSNXRateIsInvalid() external view returns (bool anyRateInvalid) { (, anyRateInvalid) = exchangeRates().ratesAndInvalidForCurrencies(_availableCurrencyKeysWithOptionalSNX(true)); } function totalIssuedSynths(bytes32 currencyKey, bool excludeOtherCollateral) external view returns (uint totalIssued) { (totalIssued, ) = _totalIssuedSynths(currencyKey, excludeOtherCollateral); } function lastIssueEvent(address account) external view returns (uint) { return _lastIssueEvent(account); } function collateralisationRatio(address _issuer) external view returns (uint cratio) { (cratio, ) = _collateralisationRatio(_issuer); } function collateralisationRatioAndAnyRatesInvalid(address _issuer) external view returns (uint cratio, bool anyRateIsInvalid) { return _collateralisationRatio(_issuer); } function collateral(address account) external view returns (uint) { return _collateral(account); } function debtBalanceOf(address _issuer, bytes32 currencyKey) external view returns (uint debtBalance) { ISynthetixDebtShare sds = synthetixDebtShare(); // What was their initial debt ownership? uint debtShareBalance = sds.balanceOf(_issuer); // If it's zero, they haven't issued, and they have no debt. if (debtShareBalance == 0) return 0; (debtBalance, , ) = _debtBalanceOfAndTotalDebt(debtShareBalance, currencyKey); } function remainingIssuableSynths(address _issuer) external view returns ( uint maxIssuable, uint alreadyIssued, uint totalSystemDebt ) { (maxIssuable, alreadyIssued, totalSystemDebt, ) = _remainingIssuableSynths(_issuer); } function maxIssuableSynths(address _issuer) external view returns (uint) { (uint maxIssuable, ) = _maxIssuableSynths(_issuer); return maxIssuable; } function transferableSynthetixAndAnyRateIsInvalid(address account, uint balance) external view returns (uint transferable, bool anyRateIsInvalid) { // How many SNX do they have, excluding escrow? // Note: We're excluding escrow here because we're interested in their transferable amount // and escrowed SNX are not transferable. // How many of those will be locked by the amount they've issued? // Assuming issuance ratio is 20%, then issuing 20 SNX of value would require // 100 SNX to be locked in their wallet to maintain their collateralisation ratio // The locked synthetix value can exceed their balance. uint debtBalance; (debtBalance, , anyRateIsInvalid) = _debtBalanceOfAndTotalDebt(synthetixDebtShare().balanceOf(account), SNX); uint lockedSynthetixValue = debtBalance.divideDecimalRound(getIssuanceRatio()); // If we exceed the balance, no SNX are transferable, otherwise the difference is. if (lockedSynthetixValue >= balance) { transferable = 0; } else { transferable = balance.sub(lockedSynthetixValue); } } function getSynths(bytes32[] calldata currencyKeys) external view returns (ISynth[] memory) { uint numKeys = currencyKeys.length; ISynth[] memory addresses = new ISynth[](numKeys); for (uint i = 0; i < numKeys; i++) { addresses[i] = synths[currencyKeys[i]]; } return addresses; } /* ========== MUTATIVE FUNCTIONS ========== */ function _addSynth(ISynth synth) internal { bytes32 currencyKey = synth.currencyKey(); require(synths[currencyKey] == ISynth(0), "Synth exists"); require(synthsByAddress[address(synth)] == bytes32(0), "Synth address already exists"); availableSynths.push(synth); synths[currencyKey] = synth; synthsByAddress[address(synth)] = currencyKey; emit SynthAdded(currencyKey, address(synth)); } function addSynth(ISynth synth) external onlyOwner { _addSynth(synth); // Invalidate the cache to force a snapshot to be recomputed. If a synth were to be added // back to the system and it still somehow had cached debt, this would force the value to be // updated. debtCache().updateDebtCacheValidity(true); } function addSynths(ISynth[] calldata synthsToAdd) external onlyOwner { uint numSynths = synthsToAdd.length; for (uint i = 0; i < numSynths; i++) { _addSynth(synthsToAdd[i]); } // Invalidate the cache to force a snapshot to be recomputed. debtCache().updateDebtCacheValidity(true); } function _removeSynth(bytes32 currencyKey) internal { address synthToRemove = address(synths[currencyKey]); require(synthToRemove != address(0), "Synth does not exist"); require(currencyKey != sUSD, "Cannot remove synth"); uint synthSupply = IERC20(synthToRemove).totalSupply(); if (synthSupply > 0) { (uint amountOfsUSD, uint rateToRedeem, ) = exchangeRates().effectiveValueAndRates(currencyKey, synthSupply, "sUSD"); require(rateToRedeem > 0, "Cannot remove synth to redeem without rate"); ISynthRedeemer _synthRedeemer = synthRedeemer(); synths[sUSD].issue(address(_synthRedeemer), amountOfsUSD); // ensure the debt cache is aware of the new sUSD issued debtCache().updateCachedsUSDDebt(SafeCast.toInt256(amountOfsUSD)); _synthRedeemer.deprecate(IERC20(address(Proxyable(address(synthToRemove)).proxy())), rateToRedeem); } // Remove the synth from the availableSynths array. for (uint i = 0; i < availableSynths.length; i++) { if (address(availableSynths[i]) == synthToRemove) { delete availableSynths[i]; // Copy the last synth into the place of the one we just deleted // If there's only one synth, this is synths[0] = synths[0]. // If we're deleting the last one, it's also a NOOP in the same way. availableSynths[i] = availableSynths[availableSynths.length - 1]; // Decrease the size of the array by one. availableSynths.length--; break; } } // And remove it from the synths mapping delete synthsByAddress[synthToRemove]; delete synths[currencyKey]; emit SynthRemoved(currencyKey, synthToRemove); } function removeSynth(bytes32 currencyKey) external onlyOwner { // Remove its contribution from the debt pool snapshot, and // invalidate the cache to force a new snapshot. IIssuerInternalDebtCache cache = debtCache(); cache.updateCachedSynthDebtWithRate(currencyKey, 0); cache.updateDebtCacheValidity(true); _removeSynth(currencyKey); } function removeSynths(bytes32[] calldata currencyKeys) external onlyOwner { uint numKeys = currencyKeys.length; // Remove their contributions from the debt pool snapshot, and // invalidate the cache to force a new snapshot. IIssuerInternalDebtCache cache = debtCache(); uint[] memory zeroRates = new uint[](numKeys); cache.updateCachedSynthDebtsWithRates(currencyKeys, zeroRates); cache.updateDebtCacheValidity(true); for (uint i = 0; i < numKeys; i++) { _removeSynth(currencyKeys[i]); } } function issueSynthsWithoutDebt( bytes32 currencyKey, address to, uint amount ) external onlyTrustedMinters returns (bool rateInvalid) { require(address(synths[currencyKey]) != address(0), "Issuer: synth doesn't exist"); require(amount > 0, "Issuer: cannot issue 0 synths"); // record issue timestamp _setLastIssueEvent(to); // Create their synths synths[currencyKey].issue(to, amount); // Account for the issued debt in the cache (uint rate, bool rateInvalid) = exchangeRates().rateAndInvalid(currencyKey); debtCache().updateCachedsUSDDebt(SafeCast.toInt256(amount.multiplyDecimal(rate))); // returned so that the caller can decide what to do if the rate is invalid return rateInvalid; } function burnSynthsWithoutDebt( bytes32 currencyKey, address from, uint amount ) external onlyTrustedMinters returns (bool rateInvalid) { require(address(synths[currencyKey]) != address(0), "Issuer: synth doesn't exist"); require(amount > 0, "Issuer: cannot issue 0 synths"); exchanger().settle(from, currencyKey); // Burn some synths synths[currencyKey].burn(from, amount); // Account for the burnt debt in the cache. If rate is invalid, the user won't be able to exchange (uint rate, bool rateInvalid) = exchangeRates().rateAndInvalid(currencyKey); debtCache().updateCachedsUSDDebt(-SafeCast.toInt256(amount.multiplyDecimal(rate))); // returned so that the caller can decide what to do if the rate is invalid return rateInvalid; } /** * Function used to migrate balances from the CollateralShort contract * @param short The address of the CollateralShort contract to be upgraded * @param amount The amount of sUSD collateral to be burnt */ function upgradeCollateralShort(address short, uint amount) external onlyOwner { require(short != address(0), "Issuer: invalid address"); require(short == resolver.getAddress("CollateralShortLegacy"), "Issuer: wrong short address"); require(address(synths[sUSD]) != address(0), "Issuer: synth doesn't exist"); require(amount > 0, "Issuer: cannot burn 0 synths"); exchanger().settle(short, sUSD); synths[sUSD].burn(short, amount); } function issueSynths(address from, uint amount) external onlySynthetix { require(amount > 0, "Issuer: cannot issue 0 synths"); _issueSynths(from, amount, false); } function issueMaxSynths(address from) external onlySynthetix { _issueSynths(from, 0, true); } function issueSynthsOnBehalf( address issueForAddress, address from, uint amount ) external onlySynthetix { _requireCanIssueOnBehalf(issueForAddress, from); _issueSynths(issueForAddress, amount, false); } function issueMaxSynthsOnBehalf(address issueForAddress, address from) external onlySynthetix { _requireCanIssueOnBehalf(issueForAddress, from); _issueSynths(issueForAddress, 0, true); } function burnSynths(address from, uint amount) external onlySynthetix { _voluntaryBurnSynths(from, amount, false); } function burnSynthsOnBehalf( address burnForAddress, address from, uint amount ) external onlySynthetix { _requireCanBurnOnBehalf(burnForAddress, from); _voluntaryBurnSynths(burnForAddress, amount, false); } function burnSynthsToTarget(address from) external onlySynthetix { _voluntaryBurnSynths(from, 0, true); } function burnSynthsToTargetOnBehalf(address burnForAddress, address from) external onlySynthetix { _requireCanBurnOnBehalf(burnForAddress, from); _voluntaryBurnSynths(burnForAddress, 0, true); } function burnForRedemption( address deprecatedSynthProxy, address account, uint balance ) external onlySynthRedeemer { ISynth(IProxy(deprecatedSynthProxy).target()).burn(account, balance); } // SIP-148: Upgraded Liquidation Mechanism /// @notice This is where the core internal liquidation logic resides. This function can only be invoked by Synthetix. /// @param account The account to be liquidated /// @param isSelfLiquidation boolean to determine if this is a forced or self-invoked liquidation /// @return uint the total amount of collateral (SNX) to redeem /// @return uint the amount of debt (sUSD) to burn in order to fix the account's c-ratio function liquidateAccount(address account, bool isSelfLiquidation) external onlySynthetix returns (uint totalRedeemed, uint amountToLiquidate) { require(liquidator().isLiquidationOpen(account, isSelfLiquidation), "Not open for liquidation"); // Get the penalty for the liquidation type uint penalty = isSelfLiquidation ? getSelfLiquidationPenalty() : getLiquidationPenalty(); // Get the account's debt balance (uint debtBalance, , bool anyRateIsInvalid) = _debtBalanceOfAndTotalDebt(synthetixDebtShare().balanceOf(account), sUSD); // Get the SNX rate (uint snxRate, bool snxRateInvalid) = exchangeRates().rateAndInvalid(SNX); _requireRatesNotInvalid(anyRateIsInvalid || snxRateInvalid); // Get the total amount of SNX collateral (including escrows and rewards) uint collateralForAccount = _collateral(account); // Calculate the amount of debt to liquidate to fix c-ratio amountToLiquidate = liquidator().calculateAmountToFixCollateral( debtBalance, _snxToUSD(collateralForAccount, snxRate), penalty ); // Get the equivalent amount of SNX for the amount to liquidate // Note: While amountToLiquidate takes the penalty into account, it does not accommodate for the addition of the penalty in terms of SNX. // Therefore, it is correct to add the penalty modification below to the totalRedeemed. totalRedeemed = _usdToSnx(amountToLiquidate, snxRate).multiplyDecimal(SafeDecimalMath.unit().add(penalty)); // The balanceOf here can be considered "transferable" since it's not escrowed, // and it is the only SNX that can potentially be transfered if unstaked. uint transferableBalance = IERC20(address(synthetix())).balanceOf(account); if (totalRedeemed > transferableBalance) { // Liquidate the account's debt based on the liquidation penalty. amountToLiquidate = amountToLiquidate.multiplyDecimal(transferableBalance).divideDecimal(totalRedeemed); // Set totalRedeemed to all transferable collateral. // i.e. the value of the account's staking position relative to balanceOf will be unwound. totalRedeemed = transferableBalance; } // Reduce debt shares by amount to liquidate. _removeFromDebtRegister(account, amountToLiquidate, debtBalance); // Remove liquidation flag liquidator().removeAccountInLiquidation(account); } function setCurrentPeriodId(uint128 periodId) external { require(msg.sender == address(feePool()), "Must be fee pool"); ISynthetixDebtShare sds = synthetixDebtShare(); if (sds.currentPeriodId() < periodId) { sds.takeSnapshot(periodId); } } function setLastDebtRatio(uint256 ratio) external onlyOwner { lastDebtRatio = ratio; } /* ========== INTERNAL FUNCTIONS ========== */ function _requireRatesNotInvalid(bool anyRateIsInvalid) internal pure { require(!anyRateIsInvalid, "A synth or SNX rate is invalid"); } function _requireCanIssueOnBehalf(address issueForAddress, address from) internal view { require(delegateApprovals().canIssueFor(issueForAddress, from), "Not approved to act on behalf"); } function _requireCanBurnOnBehalf(address burnForAddress, address from) internal view { require(delegateApprovals().canBurnFor(burnForAddress, from), "Not approved to act on behalf"); } function _issueSynths( address from, uint amount, bool issueMax ) internal { // check breaker if (!_verifyCircuitBreaker()) { return; } (uint maxIssuable, , , bool anyRateIsInvalid) = _remainingIssuableSynths(from); _requireRatesNotInvalid(anyRateIsInvalid); if (!issueMax) { require(amount <= maxIssuable, "Amount too large"); } else { amount = maxIssuable; } // Keep track of the debt they're about to create _addToDebtRegister(from, amount); // record issue timestamp _setLastIssueEvent(from); // Create their synths synths[sUSD].issue(from, amount); // Account for the issued debt in the cache debtCache().updateCachedsUSDDebt(SafeCast.toInt256(amount)); } function _burnSynths( address debtAccount, address burnAccount, uint amount, uint existingDebt ) internal returns (uint amountBurnt) { // check breaker if (!_verifyCircuitBreaker()) { return 0; } // liquidation requires sUSD to be already settled / not in waiting period // If they're trying to burn more debt than they actually owe, rather than fail the transaction, let's just // clear their debt and leave them be. amountBurnt = existingDebt < amount ? existingDebt : amount; // Remove liquidated debt from the ledger _removeFromDebtRegister(debtAccount, amountBurnt, existingDebt); // synth.burn does a safe subtraction on balance (so it will revert if there are not enough synths). synths[sUSD].burn(burnAccount, amountBurnt); // Account for the burnt debt in the cache. debtCache().updateCachedsUSDDebt(-SafeCast.toInt256(amountBurnt)); } // If burning to target, `amount` is ignored, and the correct quantity of sUSD is burnt to reach the target // c-ratio, allowing fees to be claimed. In this case, pending settlements will be skipped as the user // will still have debt remaining after reaching their target. function _voluntaryBurnSynths( address from, uint amount, bool burnToTarget ) internal { // check breaker if (!_verifyCircuitBreaker()) { return; } if (!burnToTarget) { // If not burning to target, then burning requires that the minimum stake time has elapsed. require(_canBurnSynths(from), "Minimum stake time not reached"); // First settle anything pending into sUSD as burning or issuing impacts the size of the debt pool (, uint refunded, uint numEntriesSettled) = exchanger().settle(from, sUSD); if (numEntriesSettled > 0) { amount = exchanger().calculateAmountAfterSettlement(from, sUSD, amount, refunded); } } (uint existingDebt, , bool anyRateIsInvalid) = _debtBalanceOfAndTotalDebt(synthetixDebtShare().balanceOf(from), sUSD); (uint maxIssuableSynthsForAccount, bool snxRateInvalid) = _maxIssuableSynths(from); _requireRatesNotInvalid(anyRateIsInvalid || snxRateInvalid); require(existingDebt > 0, "No debt to forgive"); if (burnToTarget) { amount = existingDebt.sub(maxIssuableSynthsForAccount); } uint amountBurnt = _burnSynths(from, from, amount, existingDebt); // Check and remove liquidation if existingDebt after burning is <= maxIssuableSynths // Issuance ratio is fixed so should remove any liquidations if (existingDebt.sub(amountBurnt) <= maxIssuableSynthsForAccount) { liquidator().removeAccountInLiquidation(from); } } function _setLastIssueEvent(address account) internal { // Set the timestamp of the last issueSynths flexibleStorage().setUIntValue( CONTRACT_NAME, keccak256(abi.encodePacked(LAST_ISSUE_EVENT, account)), block.timestamp ); } function _addToDebtRegister(address from, uint amount) internal { // important: this has to happen before any updates to user's debt shares liquidatorRewards().updateEntry(from); ISynthetixDebtShare sds = synthetixDebtShare(); // it is possible (eg in tests, system initialized with extra debt) to have issued debt without any shares issued // in which case, the first account to mint gets the debt. yw. uint debtShares = _sharesForDebt(amount); if (debtShares == 0) { sds.mintShare(from, amount); } else { sds.mintShare(from, debtShares); } } function _removeFromDebtRegister( address from, uint debtToRemove, uint existingDebt ) internal { // important: this has to happen before any updates to user's debt shares liquidatorRewards().updateEntry(from); ISynthetixDebtShare sds = synthetixDebtShare(); uint currentDebtShare = sds.balanceOf(from); if (debtToRemove == existingDebt) { sds.burnShare(from, currentDebtShare); } else { uint sharesToRemove = _sharesForDebt(debtToRemove); sds.burnShare(from, sharesToRemove < currentDebtShare ? sharesToRemove : currentDebtShare); } } function _verifyCircuitBreaker() internal returns (bool) { (, int256 rawRatio, , , ) = AggregatorV2V3Interface(requireAndGetAddress(CONTRACT_EXT_AGGREGATOR_DEBT_RATIO)).latestRoundData(); uint deviation = _calculateDeviation(lastDebtRatio, uint(rawRatio)); if (deviation >= getPriceDeviationThresholdFactor()) { systemStatus().suspendIssuance(CIRCUIT_BREAKER_SUSPENSION_REASON); return false; } lastDebtRatio = uint(rawRatio); return true; } function _calculateDeviation(uint last, uint fresh) internal pure returns (uint deviation) { if (last == 0) { deviation = 1; } else if (fresh == 0) { deviation = uint(-1); } else if (last > fresh) { deviation = last.divideDecimal(fresh); } else { deviation = fresh.divideDecimal(last); } } /* ========== MODIFIERS ========== */ modifier onlySynthetix() { require(msg.sender == address(synthetix()), "Issuer: Only the synthetix contract can perform this action"); _; } modifier onlyTrustedMinters() { address bridgeL1 = resolver.getAddress(CONTRACT_SYNTHETIXBRIDGETOOPTIMISM); address bridgeL2 = resolver.getAddress(CONTRACT_SYNTHETIXBRIDGETOBASE); require(msg.sender == bridgeL1 || msg.sender == bridgeL2, "Issuer: only trusted minters"); require(bridgeL1 == address(0) || bridgeL2 == address(0), "Issuer: one minter must be 0x0"); _; } function _onlySynthRedeemer() internal view { require(msg.sender == address(synthRedeemer()), "Issuer: Only the SynthRedeemer contract can perform this action"); } modifier onlySynthRedeemer() { _onlySynthRedeemer(); _; } modifier issuanceActive() { _issuanceActive(); _; } function _issuanceActive() private { systemStatus().requireIssuanceActive(); } modifier synthActive(bytes32 currencyKey) { _synthActive(currencyKey); _; } function _synthActive(bytes32 currencyKey) private { systemStatus().requireSynthActive(currencyKey); } /* ========== EVENTS ========== */ event SynthAdded(bytes32 currencyKey, address synth); event SynthRemoved(bytes32 currencyKey, address synth); }
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":false,"internalType":"address","name":"oldOwner","type":"address"},{"indexed":false,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerNominated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"currencyKey","type":"bytes32"},{"indexed":false,"internalType":"address","name":"synth","type":"address"}],"name":"SynthAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"currencyKey","type":"bytes32"},{"indexed":false,"internalType":"address","name":"synth","type":"address"}],"name":"SynthRemoved","type":"event"},{"constant":true,"inputs":[],"name":"CIRCUIT_BREAKER_SUSPENSION_REASON","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"CONTRACT_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"acceptOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"contract ISynth","name":"synth","type":"address"}],"name":"addSynth","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"contract ISynth[]","name":"synthsToAdd","type":"address[]"}],"name":"addSynths","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"allNetworksDebtInfo","outputs":[{"internalType":"uint256","name":"debt","type":"uint256"},{"internalType":"uint256","name":"sharesSupply","type":"uint256"},{"internalType":"bool","name":"isStale","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"anySynthOrSNXRateIsInvalid","outputs":[{"internalType":"bool","name":"anyRateInvalid","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"availableCurrencyKeys","outputs":[{"internalType":"bytes32[]","name":"","type":"bytes32[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"availableSynthCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"availableSynths","outputs":[{"internalType":"contract ISynth","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"deprecatedSynthProxy","type":"address"},{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"balance","type":"uint256"}],"name":"burnForRedemption","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burnSynths","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"burnForAddress","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burnSynthsOnBehalf","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"from","type":"address"}],"name":"burnSynthsToTarget","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"burnForAddress","type":"address"},{"internalType":"address","name":"from","type":"address"}],"name":"burnSynthsToTargetOnBehalf","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"currencyKey","type":"bytes32"},{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burnSynthsWithoutDebt","outputs":[{"internalType":"bool","name":"rateInvalid","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"canBurnSynths","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"collateral","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"_issuer","type":"address"}],"name":"collateralisationRatio","outputs":[{"internalType":"uint256","name":"cratio","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"_issuer","type":"address"}],"name":"collateralisationRatioAndAnyRatesInvalid","outputs":[{"internalType":"uint256","name":"cratio","type":"uint256"},{"internalType":"bool","name":"anyRateIsInvalid","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"_issuer","type":"address"},{"internalType":"bytes32","name":"currencyKey","type":"bytes32"}],"name":"debtBalanceOf","outputs":[{"internalType":"uint256","name":"debtBalance","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32[]","name":"currencyKeys","type":"bytes32[]"}],"name":"getSynths","outputs":[{"internalType":"contract ISynth[]","name":"","type":"address[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isResolverCached","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"issuanceRatio","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"from","type":"address"}],"name":"issueMaxSynths","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"issueForAddress","type":"address"},{"internalType":"address","name":"from","type":"address"}],"name":"issueMaxSynthsOnBehalf","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"issueSynths","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"issueForAddress","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"issueSynthsOnBehalf","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"currencyKey","type":"bytes32"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"issueSynthsWithoutDebt","outputs":[{"internalType":"bool","name":"rateInvalid","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"lastDebtRatio","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"lastIssueEvent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bool","name":"isSelfLiquidation","type":"bool"}],"name":"liquidateAccount","outputs":[{"internalType":"uint256","name":"totalRedeemed","type":"uint256"},{"internalType":"uint256","name":"amountToLiquidate","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"_issuer","type":"address"}],"name":"maxIssuableSynths","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"minimumStakeTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"nominateNewOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"nominatedOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"rebuildCache","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"_issuer","type":"address"}],"name":"remainingIssuableSynths","outputs":[{"internalType":"uint256","name":"maxIssuable","type":"uint256"},{"internalType":"uint256","name":"alreadyIssued","type":"uint256"},{"internalType":"uint256","name":"totalSystemDebt","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"currencyKey","type":"bytes32"}],"name":"removeSynth","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32[]","name":"currencyKeys","type":"bytes32[]"}],"name":"removeSynths","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":"uint128","name":"periodId","type":"uint128"}],"name":"setCurrentPeriodId","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"ratio","type":"uint256"}],"name":"setLastDebtRatio","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"synths","outputs":[{"internalType":"contract ISynth","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"synthsByAddress","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"currencyKey","type":"bytes32"},{"internalType":"bool","name":"excludeOtherCollateral","type":"bool"}],"name":"totalIssuedSynths","outputs":[{"internalType":"uint256","name":"totalIssued","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"balance","type":"uint256"}],"name":"transferableSynthetixAndAnyRateIsInvalid","outputs":[{"internalType":"uint256","name":"transferable","type":"uint256"},{"internalType":"bool","name":"anyRateIsInvalid","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"short","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"upgradeCollateralShort","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60806040523480156200001157600080fd5b506040516200619f3803806200619f8339810160408190526200003491620000fc565b8080836001600160a01b038116620000695760405162461bcd60e51b81526004016200006090620001b8565b60405180910390fd5b600080546001600160a01b0319166001600160a01b0383161781556040517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c91620000b691849062000192565b60405180910390a150600280546001600160a01b0319166001600160a01b03929092169190911790555062000213915050565b8051620000f681620001f9565b92915050565b600080604083850312156200011057600080fd5b60006200011e8585620000e9565b92505060206200013185828601620000e9565b9150509250929050565b6200014681620001e5565b82525050565b6200014681620001d3565b600062000166601983620001ca565b7f4f776e657220616464726573732063616e6e6f74206265203000000000000000815260200192915050565b60408101620001a282856200013b565b620001b160208301846200014c565b9392505050565b60208082528101620000f68162000157565b90815260200190565b60006001600160a01b038216620000f6565b6000620000f6826000620000f682620001d3565b6200020481620001d3565b81146200021057600080fd5b50565b615f7c80620002236000396000f3fe608060405234801561001057600080fd5b50600436106102d65760003560e01c80637168d2c211610182578063a311c7c2116100e9578063c81ff8fa116100a2578063d686c06c1161007c578063d686c06c14610633578063dbf6334014610646578063dd3d2b2e1461064e578063fd864ccf14610661576102d6565b8063c81ff8fa146105fa578063c89771321461060d578063d37c4d8b14610620576102d6565b8063a311c7c214610593578063a5fdc5de146105a6578063ae3bbbbb146105b9578063b06e8c65146105cc578063b410a034146105df578063bff4fdfc146105e7576102d6565b8063835e119c1161013b578063835e119c14610537578063849cf5881461054a578063890235d41461055d578063899ffef4146105705780638da5cb5b146105785780639a5154b414610580576102d6565b80637168d2c2146104cb57806372c65816146104de57806372cb051f146104ff578063741853601461051457806379ba50971461051c5780637b1001b714610524576102d6565b80632b3f41aa11610241578063461ee763116101fa5780634e99bda9116101d45780634e99bda91461048557806353a47bb71461048d578063614d08f8146104a25780636bed0415146104aa576102d6565b8063461ee7631461044c57806347a9b6db1461045f578063497d704a14610472576102d6565b80632b3f41aa146103d857806331e6da5a146103eb57806332608039146103fe5780633b6afe40146104115780633fa70f451461043157806344ec6b6214610439576102d6565b806314d494131161029357806314d494131461037a5780631627540c1461038257806316b2213f146103955780631b3ba4d0146103a8578063242df9e1146103bb5780632af64bd3146103c3576102d6565b8063042e0688146102db57806304f3bcec146102f057806305b3c1c91461030e5780630b887dae1461032e5780631137aedf146103415780631313e6ca14610363575b600080fd5b6102ee6102e9366004614d88565b610674565b005b6102f86106e5565b6040516103059190615b99565b60405180910390f35b61032161031c366004614c95565b6106f4565b6040516103059190615ae5565b6102ee61033c366004614e5f565b61070a565b61035461034f366004614c95565b6107e8565b60405161030593929190615b0f565b61036b610804565b60405161030593929190615daf565b610321610998565b6102ee610390366004614c95565b61099e565b6103216103a3366004614c95565b6109fc565b6102ee6103b6366004614d88565b610a0e565b610321610c65565b6103cb610c75565b6040516103059190615ad7565b6102ee6103e6366004614cd1565b610d8c565b6102ee6103f9366004614f17565b610ddb565b6102f861040c366004614e5f565b610ed5565b61042461041f366004614db8565b610ef0565b6040516103059190615ac6565b610321610f9e565b6102ee610447366004614d0b565b610fa3565b6102ee61045a366004614e5f565b610ff6565b6102ee61046d366004614db8565b611003565b6102ee610480366004614c95565b6110b4565b6103cb6110fc565b61049561118e565b60405161030591906159f2565b61032161119d565b6104bd6104b8366004614d88565b6111aa565b604051610305929190615da1565b6102ee6104d9366004614db8565b611290565b6104f16104ec366004614d58565b6113c5565b604051610305929190615b01565b610507611873565b6040516103059190615ab5565b6102ee61187f565b6102ee6119d1565b610321610532366004614ebc565b611a6d565b6102f8610545366004614e5f565b611a81565b6102ee610558366004614edb565b611aa8565b6103cb61056b366004614e9b565b611b22565b610507611eb6565b610495612185565b6102ee61058e366004614d0b565b612194565b6103216105a1366004614c95565b6121e2565b6103216105b4366004614c95565b6121f4565b6104bd6105c7366004614c95565b6121ff565b6102ee6105da366004614d88565b612215565b610321612259565b6103cb6105f5366004614c95565b612263565b6103cb610608366004614e9b565b61226e565b6102ee61061b366004614c95565b612643565b61032161062e366004614d88565b612688565b6102ee610641366004614d0b565b61273b565b6103216127e1565b61032161065c366004614c95565b6127e7565b6102ee61066f366004614cd1565b6127f2565b61067c612841565b6001600160a01b0316336001600160a01b0316146106b55760405162461bcd60e51b81526004016106ac90615c83565b60405180910390fd5b600081116106d55760405162461bcd60e51b81526004016106ac90615d33565b6106e182826000612858565b5050565b6002546001600160a01b031681565b600080610700836129ba565b509150505b919050565b610712612a86565b600061071c612ab2565b604051636b42ba1d60e11b81529091506001600160a01b0382169063d685743a9061074e908590600090600401615b37565b600060405180830381600087803b15801561076857600080fd5b505af115801561077c573d6000803e3d6000fd5b50506040516304bd11e560e01b81526001600160a01b03841692506304bd11e591506107ad90600190600401615ad7565b600060405180830381600087803b1580156107c757600080fd5b505af11580156107db573d6000803e3d6000fd5b505050506106e182612ac9565b60008060006107f684612f77565b509196909550909350915050565b60008060008060006108357f6578743a41676772656761746f7249737375656453796e746873000000000000613004565b6001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b15801561086d57600080fd5b505afa158015610881573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506108a59190810190615016565b509350509250506000806108d2766578743a41676772656761746f7244656274526174696f60481b613004565b6001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b15801561090a57600080fd5b505afa15801561091e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506109429190810190615016565b509350509250508396508160001461096957610964878363ffffffff61306116565b61096c565b60005b955082610977613081565b4203118061098d575080610989613081565b4203115b945050505050909192565b60075481565b6109a6612a86565b600180546001600160a01b0319166001600160a01b0383161790556040517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce22906109f19083906159f2565b60405180910390a150565b60066020526000908152604090205481565b610a16612a86565b6001600160a01b038216610a3c5760405162461bcd60e51b81526004016106ac90615cf3565b6002546040516321f8a72160e01b81526001600160a01b03909116906321f8a72190610a6a90600401615c36565b60206040518083038186803b158015610a8257600080fd5b505afa158015610a96573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610aba9190810190614cb3565b6001600160a01b0316826001600160a01b031614610aea5760405162461bcd60e51b81526004016106ac90615c06565b631cd554d160e21b6000526005602052600080516020615f1a833981519152546001600160a01b0316610b2f5760405162461bcd60e51b81526004016106ac90615d53565b60008111610b4f5760405162461bcd60e51b81526004016106ac90615bf6565b610b5761312b565b6001600160a01b0316631b16802c83631cd554d160e21b6040518363ffffffff1660e01b8152600401610b8b929190615a36565b606060405180830381600087803b158015610ba557600080fd5b505af1158015610bb9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610bdd9190810190614fd3565b5050631cd554d160e21b600052506005602052600080516020615f1a83398151915254604051632770a7eb60e21b81526001600160a01b0390911690639dc29fac90610c2f9085908590600401615a36565b600060405180830381600087803b158015610c4957600080fd5b505af1158015610c5d573d6000803e3d6000fd5b505050505050565b6000610c6f613142565b90505b90565b60006060610c81611eb6565b905060005b8151811015610d83576000828281518110610c9d57fe5b602090810291909101810151600081815260039092526040918290205460025492516321f8a72160e01b81529193506001600160a01b039081169216906321f8a72190610cee908590600401615ae5565b60206040518083038186803b158015610d0657600080fd5b505afa158015610d1a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610d3e9190810190614cb3565b6001600160a01b0316141580610d6957506000818152600360205260409020546001600160a01b0316155b15610d7a5760009350505050610c72565b50600101610c86565b50600191505090565b610d94612841565b6001600160a01b0316336001600160a01b031614610dc45760405162461bcd60e51b81526004016106ac90615c83565b610dce828261319d565b6106e1826000600161323e565b610de36134ae565b6001600160a01b0316336001600160a01b031614610e135760405162461bcd60e51b81526004016106ac90615c93565b6000610e1d6134c3565b9050816001600160801b0316816001600160a01b031663988e65956040518163ffffffff1660e01b815260040160206040518083038186803b158015610e6257600080fd5b505afa158015610e76573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610e9a9190810190614f35565b6001600160801b031610156106e15760405163abb6de9560e01b81526001600160a01b0382169063abb6de9590610c2f908590600401615d93565b6005602052600090815260409020546001600160a01b031681565b60408051828152602080840282010190915260609082908290828015610f20578160200160208202803883390190505b50905060005b82811015610f935760056000878784818110610f3e57fe5b90506020020135815260200190815260200160002060009054906101000a90046001600160a01b0316828281518110610f7357fe5b6001600160a01b0390921660209283029190910190910152600101610f26565b509150505b92915050565b60a581565b610fab612841565b6001600160a01b0316336001600160a01b031614610fdb5760405162461bcd60e51b81526004016106ac90615c83565b610fe583836134e3565b610ff183826000612858565b505050565b610ffe612a86565b600755565b61100b612a86565b8060005b818110156110485761104084848381811061102657fe5b905060200201602061103b9190810190614edb565b613518565b60010161100f565b50611051612ab2565b6001600160a01b03166304bd11e560016040518263ffffffff1660e01b815260040161107d9190615ad7565b600060405180830381600087803b15801561109757600080fd5b505af11580156110ab573d6000803e3d6000fd5b50505050505050565b6110bc612841565b6001600160a01b0316336001600160a01b0316146110ec5760405162461bcd60e51b81526004016106ac90615c83565b6110f9816000600161323e565b50565b60006111066136a9565b6001600160a01b031663c8e5bbd561111e60016136c4565b6040518263ffffffff1660e01b815260040161113a9190615ab5565b60006040518083038186803b15801561115257600080fd5b505afa158015611166573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610f989190810190614dfa565b6001546001600160a01b031681565b6524b9b9bab2b960d11b81565b60008060006112416111ba6134c3565b6001600160a01b03166370a08231876040518263ffffffff1660e01b81526004016111e591906159f2565b60206040518083038186803b1580156111fd57600080fd5b505afa158015611211573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506112359190810190614e7d565b620a69cb60eb1b6137a0565b93509091506000905061126261125561388a565b839063ffffffff6138e216565b90508481106112745760009350611287565b611284858263ffffffff6138f716565b93505b50509250929050565b611298612a86565b8060006112a3612ab2565b90506060826040519080825280602002602001820160405280156112d1578160200160208202803883390190505b506040516305ece36d60e21b81529091506001600160a01b038316906317b38db49061130590889088908690600401615a8f565b600060405180830381600087803b15801561131f57600080fd5b505af1158015611333573d6000803e3d6000fd5b50506040516304bd11e560e01b81526001600160a01b03851692506304bd11e5915061136490600190600401615ad7565b600060405180830381600087803b15801561137e57600080fd5b505af1158015611392573d6000803e3d6000fd5b506000925050505b83811015610c5d576113bd8686838181106113b157fe5b90506020020135612ac9565b60010161139a565b6000806113d0612841565b6001600160a01b0316336001600160a01b0316146114005760405162461bcd60e51b81526004016106ac90615c83565b61140861391f565b6001600160a01b031663952225f385856040518363ffffffff1660e01b8152600401611435929190615a1b565b60206040518083038186803b15801561144d57600080fd5b505afa158015611461573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506114859190810190614e41565b6114a15760405162461bcd60e51b81526004016106ac90615cd3565b6000836114b5576114b0613937565b6114bd565b6114bd613994565b90506000806115556114cd6134c3565b6001600160a01b03166370a08231896040518263ffffffff1660e01b81526004016114f891906159f2565b60206040518083038186803b15801561151057600080fd5b505afa158015611524573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506115489190810190614e7d565b631cd554d160e21b6137a0565b92505091506000806115656136a9565b6001600160a01b0316630c71cd23620a69cb60eb1b6040518263ffffffff1660e01b81526004016115969190615ae5565b604080518083038186803b1580156115ad57600080fd5b505afa1580156115c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506115e59190810190614f53565b915091506115fa83806115f55750815b6139f5565b60006116058a613a13565b905061160f61391f565b6001600160a01b031663f557f73c866116288487613bbc565b896040518463ffffffff1660e01b815260040161164793929190615b0f565b60206040518083038186803b15801561165f57600080fd5b505afa158015611673573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506116979190810190614e7d565b965061173e611728877384d626b2bb4d0f064067e4bf80fce7055d8f3e7b63907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b1580156116e457600080fd5b505af41580156116f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061171c9190810190614e7d565b9063ffffffff613bce16565b6117328986613bf3565b9063ffffffff613c0516565b9750600061174a612841565b6001600160a01b03166370a082318c6040518263ffffffff1660e01b815260040161177591906159f2565b60206040518083038186803b15801561178d57600080fd5b505afa1580156117a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506117c59190810190614e7d565b9050808911156117f5576117ef896117e38a8463ffffffff613c0516565b9063ffffffff613c2f16565b97508098505b6118008b8988613c59565b61180861391f565b6001600160a01b031663974e9e7f8c6040518263ffffffff1660e01b815260040161183391906159f2565b600060405180830381600087803b15801561184d57600080fd5b505af1158015611861573d6000803e3d6000fd5b50505050505050505050509250929050565b6060610c6f60006136c4565b6060611889611eb6565b905060005b81518110156106e15760008282815181106118a557fe5b602002602001015190506000600260009054906101000a90046001600160a01b03166001600160a01b031663dacb2d0183846040516020016118e791906159e7565b6040516020818303038152906040526040518363ffffffff1660e01b8152600401611913929190615b52565b60206040518083038186803b15801561192b57600080fd5b505afa15801561193f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506119639190810190614cb3565b6000838152600360205260409081902080546001600160a01b0319166001600160a01b038416179055519091507f88a93678a3692f6789d9546fc621bf7234b101ddb7d4fe479455112831b8aa68906119bf9084908490615af3565b60405180910390a1505060010161188e565b6001546001600160a01b031633146119fb5760405162461bcd60e51b81526004016106ac90615bd6565b6000546001546040517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c92611a3e926001600160a01b0391821692911690615a00565b60405180910390a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b6000611a798383613e3a565b509392505050565b60048181548110611a8e57fe5b6000918252602090912001546001600160a01b0316905081565b611ab0612a86565b611ab981613518565b611ac1612ab2565b6001600160a01b03166304bd11e560016040518263ffffffff1660e01b8152600401611aed9190615ad7565b600060405180830381600087803b158015611b0757600080fd5b505af1158015611b1b573d6000803e3d6000fd5b5050505050565b6002546040516321f8a72160e01b815260009182916001600160a01b03909116906321f8a72190611b73907853796e746865746978427269646765546f4f7074696d69736d60381b90600401615ae5565b60206040518083038186803b158015611b8b57600080fd5b505afa158015611b9f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611bc39190810190614cb3565b6002546040516321f8a72160e01b81529192506000916001600160a01b03909116906321f8a72190611c11907453796e746865746978427269646765546f4261736560581b90600401615ae5565b60206040518083038186803b158015611c2957600080fd5b505afa158015611c3d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611c619190810190614cb3565b9050336001600160a01b0383161480611c825750336001600160a01b038216145b611c9e5760405162461bcd60e51b81526004016106ac90615d83565b6001600160a01b0382161580611cbb57506001600160a01b038116155b611cd75760405162461bcd60e51b81526004016106ac90615bc6565b6000868152600560205260409020546001600160a01b0316611d0b5760405162461bcd60e51b81526004016106ac90615d53565b60008411611d2b5760405162461bcd60e51b81526004016106ac90615d33565b611d3485614045565b6000868152600560205260409081902054905163219e412d60e21b81526001600160a01b039091169063867904b490611d739088908890600401615a36565b600060405180830381600087803b158015611d8d57600080fd5b505af1158015611da1573d6000803e3d6000fd5b50505050600080611db06136a9565b6001600160a01b0316630c71cd23896040518263ffffffff1660e01b8152600401611ddb9190615ae5565b604080518083038186803b158015611df257600080fd5b505afa158015611e06573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611e2a9190810190614f53565b91509150611e36612ab2565b6001600160a01b03166342c7b819611e5c611e57898663ffffffff613c0516565b6140be565b6040518263ffffffff1660e01b8152600401611e789190615ae5565b600060405180830381600087803b158015611e9257600080fd5b505af1158015611ea6573d6000803e3d6000fd5b50929a9950505050505050505050565b606080611ec16140e7565b60408051600f808252610200820190925291925060609190602082016101e080388339019050509050680a6f2dce8d0cae8d2f60bb1b81600081518110611f0457fe5b6020026020010181815250506822bc31b430b733b2b960b91b81600181518110611f2a57fe5b6020026020010181815250506c45786368616e6765526174657360981b81600281518110611f5457fe5b6020026020010181815250507153796e74686574697844656274536861726560701b81600381518110611f8357fe5b60200260200101818152505066119959541bdbdb60ca1b81600481518110611fa757fe5b6020026020010181815250507044656c6567617465417070726f76616c7360781b81600581518110611fd557fe5b6020026020010181815250506d2932bbb0b93222b9b1b937bbab1960911b8160068151811061200057fe5b6020026020010181815250506e53796e746865746978457363726f7760881b8160078151811061202c57fe5b602002602001018181525050692634b8bab4b230ba37b960b11b8160088151811061205357fe5b602002602001018181525050704c697175696461746f725265776172647360781b8160098151811061208157fe5b6020026020010181815250506844656274436163686560b81b81600a815181106120a757fe5b6020026020010181815250506c29bcb73a342932b232b2b6b2b960991b81600b815181106120d157fe5b6020026020010181815250506b53797374656d53746174757360a01b81600c815181106120fa57fe5b6020026020010181815250507f6578743a41676772656761746f7249737375656453796e74687300000000000081600d8151811061213457fe5b602002602001018181525050766578743a41676772656761746f7244656274526174696f60481b81600e8151811061216857fe5b60200260200101818152505061217e8282614138565b9250505090565b6000546001600160a01b031681565b61219c612841565b6001600160a01b0316336001600160a01b0316146121cc5760405162461bcd60e51b81526004016106ac90615c83565b6121d6838361319d565b610ff18382600061323e565b60006121ed826141ed565b5092915050565b6000610f9882613a13565b60008061220b836141ed565b915091505b915091565b61221d612841565b6001600160a01b0316336001600160a01b03161461224d5760405162461bcd60e51b81526004016106ac90615c83565b6106e18282600061323e565b6000610c6f61388a565b6000610f988261426d565b6002546040516321f8a72160e01b815260009182916001600160a01b03909116906321f8a721906122bf907853796e746865746978427269646765546f4f7074696d69736d60381b90600401615ae5565b60206040518083038186803b1580156122d757600080fd5b505afa1580156122eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061230f9190810190614cb3565b6002546040516321f8a72160e01b81529192506000916001600160a01b03909116906321f8a7219061235d907453796e746865746978427269646765546f4261736560581b90600401615ae5565b60206040518083038186803b15801561237557600080fd5b505afa158015612389573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506123ad9190810190614cb3565b9050336001600160a01b03831614806123ce5750336001600160a01b038216145b6123ea5760405162461bcd60e51b81526004016106ac90615d83565b6001600160a01b038216158061240757506001600160a01b038116155b6124235760405162461bcd60e51b81526004016106ac90615bc6565b6000868152600560205260409020546001600160a01b03166124575760405162461bcd60e51b81526004016106ac90615d53565b600084116124775760405162461bcd60e51b81526004016106ac90615d33565b61247f61312b565b6001600160a01b0316631b16802c86886040518363ffffffff1660e01b81526004016124ac929190615a36565b606060405180830381600087803b1580156124c657600080fd5b505af11580156124da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506124fe9190810190614fd3565b50505060008681526005602052604090819020549051632770a7eb60e21b81526001600160a01b0390911690639dc29fac906125409088908890600401615a36565b600060405180830381600087803b15801561255a57600080fd5b505af115801561256e573d6000803e3d6000fd5b5050505060008061257d6136a9565b6001600160a01b0316630c71cd23896040518263ffffffff1660e01b81526004016125a89190615ae5565b604080518083038186803b1580156125bf57600080fd5b505afa1580156125d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506125f79190810190614f53565b91509150612603612ab2565b6001600160a01b03166342c7b819612624611e57898663ffffffff613c0516565b6000036040518263ffffffff1660e01b8152600401611e789190615ae5565b61264b612841565b6001600160a01b0316336001600160a01b03161461267b5760405162461bcd60e51b81526004016106ac90615c83565b6110f98160006001612858565b6000806126936134c3565b90506000816001600160a01b03166370a08231866040518263ffffffff1660e01b81526004016126c391906159f2565b60206040518083038186803b1580156126db57600080fd5b505afa1580156126ef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506127139190810190614e7d565b90508061272557600092505050610f98565b61272f81856137a0565b50909695505050505050565b61274361428c565b826001600160a01b031663d4b839926040518163ffffffff1660e01b815260040160206040518083038186803b15801561277c57600080fd5b505afa158015612790573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506127b49190810190614cb3565b6001600160a01b0316639dc29fac83836040518363ffffffff1660e01b815260040161107d929190615a36565b60045490565b6000610f98826142c4565b6127fa612841565b6001600160a01b0316336001600160a01b03161461282a5760405162461bcd60e51b81526004016106ac90615c83565b61283482826134e3565b6106e18260006001612858565b6000610c6f680a6f2dce8d0cae8d2f60bb1b613004565b61286061438d565b61286957610ff1565b60008061287585612f77565b935050509150612884816139f5565b826128ae57818411156128a95760405162461bcd60e51b81526004016106ac90615c53565b6128b2565b8193505b6128bc85856144c2565b6128c585614045565b631cd554d160e21b6000526005602052600080516020615f1a8339815191525460405163219e412d60e21b81526001600160a01b039091169063867904b4906129149088908890600401615a36565b600060405180830381600087803b15801561292e57600080fd5b505af1158015612942573d6000803e3d6000fd5b5050505061294e612ab2565b6001600160a01b03166342c7b819612965866140be565b6040518263ffffffff1660e01b81526004016129819190615ae5565b600060405180830381600087803b15801561299b57600080fd5b505af11580156129af573d6000803e3d6000fd5b505050505050505050565b6000806000806129c86136a9565b6001600160a01b0316630c71cd23620a69cb60eb1b6040518263ffffffff1660e01b81526004016129f99190615ae5565b604080518083038186803b158015612a1057600080fd5b505afa158015612a24573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250612a489190810190614f53565b915091506000612a60612a5a87613a13565b84613bbc565b9050612a7a612a6d61388a565b829063ffffffff613c0516565b94509092505050915091565b6000546001600160a01b03163314612ab05760405162461bcd60e51b81526004016106ac90615ce3565b565b6000610c6f6844656274436163686560b81b613004565b6000818152600560205260409020546001600160a01b031680612afe5760405162461bcd60e51b81526004016106ac90615cb3565b631cd554d160e21b821415612b255760405162461bcd60e51b81526004016106ac90615d23565b6000816001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015612b6057600080fd5b505afa158015612b74573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250612b989190810190614e7d565b90508015612e1a57600080612bab6136a9565b6001600160a01b0316638295016a86856040518363ffffffff1660e01b8152600401612bd8929190615b72565b60606040518083038186803b158015612bf057600080fd5b505afa158015612c04573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250612c289190810190614fd3565b509150915060008111612c4d5760405162461bcd60e51b81526004016106ac90615cc3565b6000612c5761460c565b631cd554d160e21b6000526005602052600080516020615f1a8339815191525460405163219e412d60e21b81529192506001600160a01b03169063867904b490612ca79084908790600401615a36565b600060405180830381600087803b158015612cc157600080fd5b505af1158015612cd5573d6000803e3d6000fd5b50505050612ce1612ab2565b6001600160a01b03166342c7b819612cf8856140be565b6040518263ffffffff1660e01b8152600401612d149190615ae5565b600060405180830381600087803b158015612d2e57600080fd5b505af1158015612d42573d6000803e3d6000fd5b50505050806001600160a01b0316633a70599c866001600160a01b031663ec5568896040518163ffffffff1660e01b815260040160206040518083038186803b158015612d8e57600080fd5b505afa158015612da2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250612dc69190810190614ef9565b846040518363ffffffff1660e01b8152600401612de4929190615ba7565b600060405180830381600087803b158015612dfe57600080fd5b505af1158015612e12573d6000803e3d6000fd5b505050505050505b60005b600454811015612f0157826001600160a01b031660048281548110612e3e57fe5b6000918252602090912001546001600160a01b03161415612ef95760048181548110612e6657fe5b600091825260209091200180546001600160a01b0319169055600480546000198101908110612e9157fe5b600091825260209091200154600480546001600160a01b039092169183908110612eb757fe5b600091825260209091200180546001600160a01b0319166001600160a01b03929092169190911790556004805490612ef3906000198301614b22565b50612f01565b600101612e1d565b506001600160a01b038216600090815260066020908152604080832083905585835260059091529081902080546001600160a01b0319169055517f6166f5c475cc1cd535c6cdf14a6d5edb811e34117031fc2863392a136eb655d090612f6a9085908590615af3565b60405180910390a1505050565b600080600080612fb3612f886134c3565b6001600160a01b03166370a08231876040518263ffffffff1660e01b81526004016114f891906159f2565b91945092509050600080612fc6876129ba565b915091508195508280612fd65750805b9250858510612fe85760009550612ffb565b612ff8868663ffffffff6138f716565b95505b50509193509193565b60008181526003602090815260408083205490516001600160a01b039091169182151591613034918691016159c7565b604051602081830303815290604052906121ed5760405162461bcd60e51b81526004016106ac9190615bb5565b600061307a83836b033b2e3c9fd0803ce8000000614627565b9392505050565b600061308b61465f565b6001600160a01b03166323257c2b6d53797374656d53657474696e677360901b6e1c985d1954dd185b1954195c9a5bd9608a1b6040518363ffffffff1660e01b81526004016130db929190615b01565b60206040518083038186803b1580156130f357600080fd5b505afa158015613107573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610c6f9190810190614e7d565b6000610c6f6822bc31b430b733b2b960b91b613004565b600061314c61465f565b6001600160a01b03166323257c2b6d53797374656d53657474696e677360901b6f6d696e696d756d5374616b6554696d6560801b6040518363ffffffff1660e01b81526004016130db929190615b01565b6131a561467c565b6001600160a01b0316637d3f0ba283836040518363ffffffff1660e01b81526004016131d2929190615a00565b60206040518083038186803b1580156131ea57600080fd5b505afa1580156131fe573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506132229190810190614e41565b6106e15760405162461bcd60e51b81526004016106ac90615be6565b61324661438d565b61324f57610ff1565b806133ac5761325d8361426d565b6132795760405162461bcd60e51b81526004016106ac90615d63565b60008061328461312b565b6001600160a01b0316631b16802c86631cd554d160e21b6040518363ffffffff1660e01b81526004016132b8929190615a36565b606060405180830381600087803b1580156132d257600080fd5b505af11580156132e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061330a9190810190614fd3565b90935091505080156133a95761331e61312b565b6001600160a01b0316634c268fc886631cd554d160e21b87866040518563ffffffff1660e01b81526004016133569493929190615a51565b60206040518083038186803b15801561336e57600080fd5b505afa158015613382573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506133a69190810190614e7d565b93505b50505b6000806133ba612f886134c3565b92505091506000806133cb876129ba565b915091506133df83806115f55750816139f5565b600084116133ff5760405162461bcd60e51b81526004016106ac90615c43565b841561341857613415848363ffffffff6138f716565b95505b60006134268889898861469b565b905082613439868363ffffffff6138f716565b116134a45761344661391f565b6001600160a01b031663974e9e7f896040518263ffffffff1660e01b815260040161347191906159f2565b600060405180830381600087803b15801561348b57600080fd5b505af115801561349f573d6000803e3d6000fd5b505050505b5050505050505050565b6000610c6f66119959541bdbdb60ca1b613004565b6000610c6f7153796e74686574697844656274536861726560701b613004565b6134eb61467c565b6001600160a01b0316630487261783836040518363ffffffff1660e01b81526004016131d2929190615a00565b6000816001600160a01b031663dbd06c856040518163ffffffff1660e01b815260040160206040518083038186803b15801561355357600080fd5b505afa158015613567573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061358b9190810190614e7d565b6000818152600560205260409020549091506001600160a01b0316156135c35760405162461bcd60e51b81526004016106ac90615d43565b6001600160a01b038216600090815260066020526040902054156135f95760405162461bcd60e51b81526004016106ac90615d03565b60048054600181019091557f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b0180546001600160a01b0384166001600160a01b03199182168117909255600083815260056020908152604080832080549094168517909355928152600690925290819020829055517f0a2b6ebf143b3e9fcd67e17748ad315174746100c27228468b2c98c302c628849061369d9083908590615af3565b60405180910390a15050565b6000610c6f6c45786368616e6765526174657360981b613004565b606080826136d35760006136d6565b60015b60ff1660048054905001604051908082528060200260200182016040528015613709578160200160208202803883390190505b50905060005b60045481101561377057600660006004838154811061372a57fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902054825183908390811061375d57fe5b602090810291909101015260010161370f565b508215610f98576004548151620a69cb60eb1b918391811061378e57fe5b60200260200101818152505092915050565b60008060008060006137b0610804565b925050915086600014156137cc57600094509092509050613883565b6000806137d76136a9565b6001600160a01b0316630c71cd23896040518263ffffffff1660e01b81526004016138029190615ae5565b604080518083038186803b15801561381957600080fd5b505afa15801561382d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506138519190810190614f53565b9150915061386e826138628b6147c7565b9063ffffffff6138e216565b9650839550808061387c5750825b9450505050505b9250925092565b600061389461465f565b6001600160a01b03166323257c2b6d53797374656d53657474696e677360901b6c69737375616e6365526174696f60981b6040518363ffffffff1660e01b81526004016130db929190615b01565b600061307a8383670de0b6b3a7640000614627565b6000828211156139195760405162461bcd60e51b81526004016106ac90615c63565b50900390565b6000610c6f692634b8bab4b230ba37b960b11b613004565b600061394161465f565b6001600160a01b03166323257c2b6d53797374656d53657474696e677360901b716c69717569646174696f6e50656e616c747960701b6040518363ffffffff1660e01b81526004016130db929190615b01565b600061399e61465f565b6001600160a01b03166323257c2b6d53797374656d53657474696e677360901b7573656c664c69717569646174696f6e50656e616c747960501b6040518363ffffffff1660e01b81526004016130db929190615b01565b80156110f95760405162461bcd60e51b81526004016106ac90615ca3565b600080613a1e612841565b6001600160a01b03166370a08231846040518263ffffffff1660e01b8152600401613a4991906159f2565b60206040518083038186803b158015613a6157600080fd5b505afa158015613a75573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250613a999190810190614e7d565b90506000613aa5614876565b6001600160a01b031614613b4957613b46613abe614876565b6001600160a01b03166370a08231856040518263ffffffff1660e01b8152600401613ae991906159f2565b60206040518083038186803b158015613b0157600080fd5b505afa158015613b15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250613b399190810190614e7d565b829063ffffffff613bce16565b90505b6000613b53614893565b6001600160a01b031614613b6f57613b6c613abe614893565b90505b6000613b796148af565b6001600160a01b031614610f985761307a613b926148af565b6001600160a01b0316628cc262856040518263ffffffff1660e01b8152600401613ae991906159f2565b600061307a838363ffffffff6148ce16565b60008282018381101561307a5760405162461bcd60e51b81526004016106ac90615c16565b600061307a838363ffffffff6138e216565b6000670de0b6b3a7640000613c20848463ffffffff6148e316565b81613c2757fe5b049392505050565b600061307a82613c4d85670de0b6b3a764000063ffffffff6148e316565b9063ffffffff61491d16565b613c616148af565b6001600160a01b031663270fb338846040518263ffffffff1660e01b8152600401613c8c91906159f2565b600060405180830381600087803b158015613ca657600080fd5b505af1158015613cba573d6000803e3d6000fd5b505050506000613cc86134c3565b90506000816001600160a01b03166370a08231866040518263ffffffff1660e01b8152600401613cf891906159f2565b60206040518083038186803b158015613d1057600080fd5b505afa158015613d24573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250613d489190810190614e7d565b905082841415613db757604051631a378f0d60e01b81526001600160a01b03831690631a378f0d90613d809088908590600401615a36565b600060405180830381600087803b158015613d9a57600080fd5b505af1158015613dae573d6000803e3d6000fd5b50505050611b1b565b6000613dc285614952565b9050826001600160a01b0316631a378f0d87848410613de15784613de3565b835b6040518363ffffffff1660e01b8152600401613e00929190615a36565b600060405180830381600087803b158015613e1a57600080fd5b505af1158015613e2e573d6000803e3d6000fd5b50505050505050505050565b6000806000806000613e4a612ab2565b6001600160a01b0316633a900a2e6040518163ffffffff1660e01b815260040160806040518083038186803b158015613e8257600080fd5b505afa158015613e96573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250613eba9190810190614f72565b935093505092508180613eca5750805b93506000613ed66136a9565b905086613f7c57600080613ee8612ab2565b6001600160a01b0316632992dba26040518163ffffffff1660e01b8152600401604080518083038186803b158015613f1f57600080fd5b505afa158015613f33573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250613f579190810190614f53565b9092509050613f6c868363ffffffff613bce16565b95508680613f775750805b965050505b631cd554d160e21b881415613f97575091935061403e915050565b600080826001600160a01b0316630c71cd238b6040518263ffffffff1660e01b8152600401613fc69190615ae5565b604080518083038186803b158015613fdd57600080fd5b505afa158015613ff1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506140159190810190614f53565b909250905061402a868363ffffffff6138e216565b87806140335750815b975097505050505050505b9250929050565b61404d61465f565b6001600160a01b0316631d5b277f6524b9b9bab2b960d11b6d1b185cdd125cdcdd59515d995b9d60921b846040516020016140899291906159a1565b60405160208183030381529060405280519060200120426040518463ffffffff1660e01b8152600401611aed93929190615b0f565b6000600160ff1b82106140e35760405162461bcd60e51b81526004016106ac90615d73565b5090565b604080516001808252818301909252606091602080830190803883390190505090506e466c657869626c6553746f7261676560881b8160008151811061412957fe5b60200260200101818152505090565b60608151835101604051908082528060200260200182016040528015614168578160200160208202803883390190505b50905060005b83518110156141aa5783818151811061418357fe5b602002602001015182828151811061419757fe5b602090810291909101015260010161416e565b5060005b82518110156121ed578281815181106141c357fe5b60200260200101518282865101815181106141da57fe5b60209081029190910101526001016141ae565b60008060006141fb84613a13565b905060008061423661420b6134c3565b6001600160a01b03166370a08231886040518263ffffffff1660e01b81526004016111e591906159f2565b9250509150826000141561425257600094509250612210915050565b614262828463ffffffff6138e216565b945092505050915091565b600061428361427a613142565b61171c846142c4565b42101592915050565b61429461460c565b6001600160a01b0316336001600160a01b031614612ab05760405162461bcd60e51b81526004016106ac90615c26565b60006142ce61465f565b6001600160a01b03166323257c2b6524b9b9bab2b960d11b6d1b185cdd125cdcdd59515d995b9d60921b8560405160200161430a9291906159a1565b604051602081830303815290604052805190602001206040518363ffffffff1660e01b815260040161433d929190615b01565b60206040518083038186803b15801561435557600080fd5b505afa158015614369573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610f989190810190614e7d565b6000806143b3766578743a41676772656761746f7244656274526174696f60481b613004565b6001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b1580156143eb57600080fd5b505afa1580156143ff573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506144239190810190615016565b505050915050600061443760075483614a14565b9050614441614a60565b81106144b85761444f614ac8565b6001600160a01b031663396e258e60a56040518263ffffffff1660e01b815260040161447b9190615ae5565b600060405180830381600087803b15801561449557600080fd5b505af11580156144a9573d6000803e3d6000fd5b50505050600092505050610c72565b5060075550600190565b6144ca6148af565b6001600160a01b031663270fb338836040518263ffffffff1660e01b81526004016144f591906159f2565b600060405180830381600087803b15801561450f57600080fd5b505af1158015614523573d6000803e3d6000fd5b5050505060006145316134c3565b9050600061453e83614952565b9050806145aa57604051636178258560e11b81526001600160a01b0383169063c2f04b0a906145739087908790600401615a36565b600060405180830381600087803b15801561458d57600080fd5b505af11580156145a1573d6000803e3d6000fd5b50505050614606565b604051636178258560e11b81526001600160a01b0383169063c2f04b0a906145d89087908590600401615a36565b600060405180830381600087803b1580156145f257600080fd5b505af11580156134a4573d6000803e3d6000fd5b50505050565b6000610c6f6c29bcb73a342932b232b2b6b2b960991b613004565b60008061464184613c4d87600a870263ffffffff6148e316565b90506005600a825b061061465357600a015b600a9004949350505050565b6000610c6f6e466c657869626c6553746f7261676560881b613004565b6000610c6f7044656c6567617465417070726f76616c7360781b613004565b60006146a561438d565b6146b1575060006147bf565b8282106146be57826146c0565b815b90506146cd858284613c59565b631cd554d160e21b6000526005602052600080516020615f1a83398151915254604051632770a7eb60e21b81526001600160a01b0390911690639dc29fac9061471c9087908590600401615a36565b600060405180830381600087803b15801561473657600080fd5b505af115801561474a573d6000803e3d6000fd5b50505050614756612ab2565b6001600160a01b03166342c7b81961476d836140be565b6000036040518263ffffffff1660e01b815260040161478c9190615ae5565b600060405180830381600087803b1580156147a657600080fd5b505af11580156147ba573d6000803e3d6000fd5b505050505b949350505050565b6000806147ed766578743a41676772656761746f7244656274526174696f60481b613004565b6001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b15801561482557600080fd5b505afa158015614839573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061485d9190810190615016565b50505091505061307a8184614ae290919063ffffffff16565b6000610c6f6e53796e746865746978457363726f7760881b613004565b6000610c6f6d2932bbb0b93222b9b1b937bbab1960911b613004565b6000610c6f704c697175696461746f725265776172647360781b613004565b600061307a8383670de0b6b3a7640000614af7565b6000826148f257506000610f98565b828202828482816148ff57fe5b041461307a5760405162461bcd60e51b81526004016106ac90615d13565b600080821161493e5760405162461bcd60e51b81526004016106ac90615c73565b600082848161494957fe5b04949350505050565b600080614978766578743a41676772656761746f7244656274526174696f60481b613004565b6001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b1580156149b057600080fd5b505afa1580156149c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506149e89190810190615016565b50505091505080600014614a0b57614a06838263ffffffff61306116565b61307a565b50600092915050565b600082614a2357506001610f98565b81614a315750600019610f98565b81831115614a5057614a49838363ffffffff613c2f16565b9050610f98565b61307a828463ffffffff613c2f16565b6000614a6a61465f565b6001600160a01b03166323257c2b6d53797374656d53657474696e677360901b7f7072696365446576696174696f6e5468726573686f6c64466163746f720000006040518363ffffffff1660e01b81526004016130db929190615b01565b6000610c6f6b53797374656d53746174757360a01b613004565b600061307a83836b033b2e3c9fd0803ce80000005b600080600a8304614b0e868663ffffffff6148e316565b81614b1557fe5b0490506005600a82614649565b815481835581811115610ff157600083815260209020610ff1918101908301610c7291905b808211156140e35760008155600101614b47565b8035610f9881615ed8565b8051610f9881615ed8565b60008083601f840112614b8357600080fd5b50813567ffffffffffffffff811115614b9b57600080fd5b60208301915083602082028301111561403e57600080fd5b600082601f830112614bc457600080fd5b8151614bd7614bd282615dfe565b615dd7565b91508181835260208401935060208101905083856020840282011115614bfc57600080fd5b60005b83811015614c285781614c128882614c53565b8452506020928301929190910190600101614bff565b5050505092915050565b8035610f9881615eec565b8051610f9881615eec565b8035610f9881615ef5565b8051610f9881615ef5565b8035610f9881615efe565b8051610f9881615efe565b8035610f9881615f07565b8051610f9881615f07565b8051610f9881615f10565b600060208284031215614ca757600080fd5b60006147bf8484614b5b565b600060208284031215614cc557600080fd5b60006147bf8484614b66565b60008060408385031215614ce457600080fd5b6000614cf08585614b5b565b9250506020614d0185828601614b5b565b9150509250929050565b600080600060608486031215614d2057600080fd5b6000614d2c8686614b5b565b9350506020614d3d86828701614b5b565b9250506040614d4e86828701614c48565b9150509250925092565b60008060408385031215614d6b57600080fd5b6000614d778585614b5b565b9250506020614d0185828601614c32565b60008060408385031215614d9b57600080fd5b6000614da78585614b5b565b9250506020614d0185828601614c48565b60008060208385031215614dcb57600080fd5b823567ffffffffffffffff811115614de257600080fd5b614dee85828601614b71565b92509250509250929050565b60008060408385031215614e0d57600080fd5b825167ffffffffffffffff811115614e2457600080fd5b614e3085828601614bb3565b9250506020614d0185828601614c3d565b600060208284031215614e5357600080fd5b60006147bf8484614c3d565b600060208284031215614e7157600080fd5b60006147bf8484614c48565b600060208284031215614e8f57600080fd5b60006147bf8484614c53565b600080600060608486031215614eb057600080fd5b6000614d2c8686614c48565b60008060408385031215614ecf57600080fd5b6000614d778585614c48565b600060208284031215614eed57600080fd5b60006147bf8484614c5e565b600060208284031215614f0b57600080fd5b60006147bf8484614c69565b600060208284031215614f2957600080fd5b60006147bf8484614c74565b600060208284031215614f4757600080fd5b60006147bf8484614c7f565b60008060408385031215614f6657600080fd5b6000614e308585614c53565b60008060008060808587031215614f8857600080fd5b6000614f948787614c53565b9450506020614fa587828801614c53565b9350506040614fb687828801614c3d565b9250506060614fc787828801614c3d565b91505092959194509250565b600080600060608486031215614fe857600080fd5b6000614ff48686614c53565b935050602061500586828701614c53565b9250506040614d4e86828701614c53565b600080600080600060a0868803121561502e57600080fd5b600061503a8888614c8a565b955050602061504b88828901614c53565b945050604061505c88828901614c53565b935050606061506d88828901614c53565b925050608061507e88828901614c8a565b9150509295509295909350565b60006150978383615202565b505060200190565b6000615097838361521c565b6150b481615e32565b82525050565b6150b46150c682615e32565b615eb7565b60006150d78385615e29565b93506001600160fb1b038311156150ed57600080fd5b6020830292506150fe838584615e7f565b50500190565b600061510f82615e25565b6151198185615e29565b935061512483615e1f565b8060005b8381101561515257815161513c888261508b565b975061514783615e1f565b925050600101615128565b509495945050505050565b600061516882615e25565b6151728185615e29565b935061517d83615e1f565b8060005b83811015615152578151615195888261509f565b97506151a083615e1f565b925050600101615181565b60006151b682615e25565b6151c08185615e29565b93506151cb83615e1f565b8060005b838110156151525781516151e3888261508b565b97506151ee83615e1f565b9250506001016151cf565b6150b481615e3d565b6150b481610c72565b6150b461521782610c72565b610c72565b6150b481615e42565b6150b481615e74565b600061523982615e25565b6152438185615e29565b9350615253818560208601615e8b565b61525c81615ec8565b9093019392505050565b6000615273601e83615e29565b7f4973737565723a206f6e65206d696e746572206d757374206265203078300000815260200192915050565b60006152ac603583615e29565b7f596f75206d757374206265206e6f6d696e61746564206265666f726520796f7581527402063616e20616363657074206f776e65727368697605c1b602082015260400192915050565b6000615303601d83615e29565b7f4e6f7420617070726f76656420746f20616374206f6e20626568616c66000000815260200192915050565b600061533c601c83615e29565b7f4973737565723a2063616e6e6f74206275726e20302073796e74687300000000815260200192915050565b6000615375601b83615e29565b7f4973737565723a2077726f6e672073686f727420616464726573730000000000815260200192915050565b60006153ae601b83615e29565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000815260200192915050565b60006153e7603f83615e29565b7f4973737565723a204f6e6c79207468652053796e746852656465656d6572206381527f6f6e74726163742063616e20706572666f726d207468697320616374696f6e00602082015260400192915050565b74436f6c6c61746572616c53686f72744c656761637960581b9052565b6000615463601283615e29565b714e6f206465627420746f20666f726769766560701b815260200192915050565b6000615491601083615e29565b6f416d6f756e7420746f6f206c6172676560801b815260200192915050565b60006154bd601e83615e29565b7f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815260200192915050565b60006154f6601a83615e29565b7f536166654d6174683a206469766973696f6e206279207a65726f000000000000815260200192915050565b600061552f601183610705565b70026b4b9b9b4b7339030b2323932b9b99d1607d1b815260110192915050565b600061555c603b83615e29565b7f4973737565723a204f6e6c79207468652073796e74686574697820636f6e747281527f6163742063616e20706572666f726d207468697320616374696f6e0000000000602082015260400192915050565b60006155bb601083615e29565b6f135d5cdd08189948199959481c1bdbdb60821b815260200192915050565b60006155e7601e83615e29565b7f412073796e7468206f7220534e58207261746520697320696e76616c69640000815260200192915050565b6000615620601483615e29565b7314de5b9d1a08191bd95cc81b9bdd08195e1a5cdd60621b815260200192915050565b6000615650602a83615e29565b7f43616e6e6f742072656d6f76652073796e746820746f2072656465656d20776981526974686f7574207261746560b01b602082015260400192915050565b600061569c601883615e29565b7f4e6f74206f70656e20666f72206c69717569646174696f6e0000000000000000815260200192915050565b60006156d5602f83615e29565b7f4f6e6c792074686520636f6e7472616374206f776e6572206d6179207065726681526e37b936903a3434b99030b1ba34b7b760891b602082015260400192915050565b631cd554d160e21b9052565b6000615732601783615e29565b7f4973737565723a20696e76616c69642061646472657373000000000000000000815260200192915050565b600061576b601c83615e29565b7f53796e7468206164647265737320616c72656164792065786973747300000000815260200192915050565b60006157a4602183615e29565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f8152607760f81b602082015260400192915050565b60006157e7601383615e29565b72086c2dcdcdee840e4cadadeecca40e6f2dce8d606b1b815260200192915050565b6000615816601d83615e29565b7f4973737565723a2063616e6e6f7420697373756520302073796e746873000000815260200192915050565b600061584f601983610705565b7f5265736f6c766572206d697373696e67207461726765743a2000000000000000815260190192915050565b6000615888600c83615e29565b6b53796e74682065786973747360a01b815260200192915050565b60006158b0601b83615e29565b7f4973737565723a2073796e746820646f65736e27742065786973740000000000815260200192915050565b60006158e9601e83615e29565b7f4d696e696d756d207374616b652074696d65206e6f7420726561636865640000815260200192915050565b6000615922602883615e29565b7f53616665436173743a2076616c756520646f65736e27742066697420696e2061815267371034b73a191a9b60c11b602082015260400192915050565b600061596c601c83615e29565b7f4973737565723a206f6e6c792074727573746564206d696e7465727300000000815260200192915050565b6150b481615e4d565b60006159ad828561520b565b6020820191506159bd82846150ba565b5060140192915050565b60006159d282615522565b91506159de828461520b565b50602001919050565b60006159d282615842565b60208101610f9882846150ab565b60408101615a0e82856150ab565b61307a60208301846150ab565b60408101615a2982856150ab565b61307a60208301846151f9565b60408101615a4482856150ab565b61307a6020830184615202565b60808101615a5f82876150ab565b615a6c6020830186615202565b615a796040830185615202565b615a866060830184615202565b95945050505050565b60408082528101615aa18185876150cb565b90508181036020830152615a8681846151ab565b6020808252810161307a8184615104565b6020808252810161307a818461515d565b60208101610f9882846151f9565b60208101610f988284615202565b60408101615a0e8285615202565b60408101615a448285615202565b60608101615b1d8286615202565b615b2a6020830185615202565b6147bf6040830184615202565b60408101615b458285615202565b61307a6020830184615225565b60408101615b608285615202565b81810360208301526147bf818461522e565b60608101615b808285615202565b615b8d6020830184615202565b61307a60408301615719565b60208101610f98828461521c565b60408101615a44828561521c565b6020808252810161307a818461522e565b60208082528101610f9881615266565b60208082528101610f988161529f565b60208082528101610f98816152f6565b60208082528101610f988161532f565b60208082528101610f9881615368565b60208082528101610f98816153a1565b60208082528101610f98816153da565b6020810161070582615439565b60208082528101610f9881615456565b60208082528101610f9881615484565b60208082528101610f98816154b0565b60208082528101610f98816154e9565b60208082528101610f988161554f565b60208082528101610f98816155ae565b60208082528101610f98816155da565b60208082528101610f9881615613565b60208082528101610f9881615643565b60208082528101610f988161568f565b60208082528101610f98816156c8565b60208082528101610f9881615725565b60208082528101610f988161575e565b60208082528101610f9881615797565b60208082528101610f98816157da565b60208082528101610f9881615809565b60208082528101610f988161587b565b60208082528101610f98816158a3565b60208082528101610f98816158dc565b60208082528101610f9881615915565b60208082528101610f988161595f565b60208101610f988284615998565b60408101615a298285615202565b60608101615dbd8286615202565b615dca6020830185615202565b6147bf60408301846151f9565b60405181810167ffffffffffffffff81118282101715615df657600080fd5b604052919050565b600067ffffffffffffffff821115615e1557600080fd5b5060209081020190565b60200190565b5190565b90815260200190565b6000610f9882615e59565b151590565b6000610f9882615e32565b6001600160801b031690565b6001600160a01b031690565b69ffffffffffffffffffff1690565b6000610f9882610c72565b82818337506000910152565b60005b83811015615ea6578181015183820152602001615e8e565b838111156146065750506000910152565b6000610f98826000610f9882615ed2565b601f01601f191690565b60601b90565b615ee181615e32565b81146110f957600080fd5b615ee181615e3d565b615ee181610c72565b615ee181615e42565b615ee181615e4d565b615ee181615e6556fe74c62d09fbc50aefae0794a9a068f786a692826fbdfe63828ec23a875865823fa365627a7a72315820e660e36712f8816be253d1bd96bd20e56cd9401aa5603a1e525ebe560b5951076c6578706572696d656e74616cf564736f6c63430005100040000000000000000000000000de910777c787903f78c89e7a0bf7f4c435cbb1fe0000000000000000000000004e3b31eb0e5cb73641ee1e65e7dcefe520ba3ef2
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106102d65760003560e01c80637168d2c211610182578063a311c7c2116100e9578063c81ff8fa116100a2578063d686c06c1161007c578063d686c06c14610633578063dbf6334014610646578063dd3d2b2e1461064e578063fd864ccf14610661576102d6565b8063c81ff8fa146105fa578063c89771321461060d578063d37c4d8b14610620576102d6565b8063a311c7c214610593578063a5fdc5de146105a6578063ae3bbbbb146105b9578063b06e8c65146105cc578063b410a034146105df578063bff4fdfc146105e7576102d6565b8063835e119c1161013b578063835e119c14610537578063849cf5881461054a578063890235d41461055d578063899ffef4146105705780638da5cb5b146105785780639a5154b414610580576102d6565b80637168d2c2146104cb57806372c65816146104de57806372cb051f146104ff578063741853601461051457806379ba50971461051c5780637b1001b714610524576102d6565b80632b3f41aa11610241578063461ee763116101fa5780634e99bda9116101d45780634e99bda91461048557806353a47bb71461048d578063614d08f8146104a25780636bed0415146104aa576102d6565b8063461ee7631461044c57806347a9b6db1461045f578063497d704a14610472576102d6565b80632b3f41aa146103d857806331e6da5a146103eb57806332608039146103fe5780633b6afe40146104115780633fa70f451461043157806344ec6b6214610439576102d6565b806314d494131161029357806314d494131461037a5780631627540c1461038257806316b2213f146103955780631b3ba4d0146103a8578063242df9e1146103bb5780632af64bd3146103c3576102d6565b8063042e0688146102db57806304f3bcec146102f057806305b3c1c91461030e5780630b887dae1461032e5780631137aedf146103415780631313e6ca14610363575b600080fd5b6102ee6102e9366004614d88565b610674565b005b6102f86106e5565b6040516103059190615b99565b60405180910390f35b61032161031c366004614c95565b6106f4565b6040516103059190615ae5565b6102ee61033c366004614e5f565b61070a565b61035461034f366004614c95565b6107e8565b60405161030593929190615b0f565b61036b610804565b60405161030593929190615daf565b610321610998565b6102ee610390366004614c95565b61099e565b6103216103a3366004614c95565b6109fc565b6102ee6103b6366004614d88565b610a0e565b610321610c65565b6103cb610c75565b6040516103059190615ad7565b6102ee6103e6366004614cd1565b610d8c565b6102ee6103f9366004614f17565b610ddb565b6102f861040c366004614e5f565b610ed5565b61042461041f366004614db8565b610ef0565b6040516103059190615ac6565b610321610f9e565b6102ee610447366004614d0b565b610fa3565b6102ee61045a366004614e5f565b610ff6565b6102ee61046d366004614db8565b611003565b6102ee610480366004614c95565b6110b4565b6103cb6110fc565b61049561118e565b60405161030591906159f2565b61032161119d565b6104bd6104b8366004614d88565b6111aa565b604051610305929190615da1565b6102ee6104d9366004614db8565b611290565b6104f16104ec366004614d58565b6113c5565b604051610305929190615b01565b610507611873565b6040516103059190615ab5565b6102ee61187f565b6102ee6119d1565b610321610532366004614ebc565b611a6d565b6102f8610545366004614e5f565b611a81565b6102ee610558366004614edb565b611aa8565b6103cb61056b366004614e9b565b611b22565b610507611eb6565b610495612185565b6102ee61058e366004614d0b565b612194565b6103216105a1366004614c95565b6121e2565b6103216105b4366004614c95565b6121f4565b6104bd6105c7366004614c95565b6121ff565b6102ee6105da366004614d88565b612215565b610321612259565b6103cb6105f5366004614c95565b612263565b6103cb610608366004614e9b565b61226e565b6102ee61061b366004614c95565b612643565b61032161062e366004614d88565b612688565b6102ee610641366004614d0b565b61273b565b6103216127e1565b61032161065c366004614c95565b6127e7565b6102ee61066f366004614cd1565b6127f2565b61067c612841565b6001600160a01b0316336001600160a01b0316146106b55760405162461bcd60e51b81526004016106ac90615c83565b60405180910390fd5b600081116106d55760405162461bcd60e51b81526004016106ac90615d33565b6106e182826000612858565b5050565b6002546001600160a01b031681565b600080610700836129ba565b509150505b919050565b610712612a86565b600061071c612ab2565b604051636b42ba1d60e11b81529091506001600160a01b0382169063d685743a9061074e908590600090600401615b37565b600060405180830381600087803b15801561076857600080fd5b505af115801561077c573d6000803e3d6000fd5b50506040516304bd11e560e01b81526001600160a01b03841692506304bd11e591506107ad90600190600401615ad7565b600060405180830381600087803b1580156107c757600080fd5b505af11580156107db573d6000803e3d6000fd5b505050506106e182612ac9565b60008060006107f684612f77565b509196909550909350915050565b60008060008060006108357f6578743a41676772656761746f7249737375656453796e746873000000000000613004565b6001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b15801561086d57600080fd5b505afa158015610881573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506108a59190810190615016565b509350509250506000806108d2766578743a41676772656761746f7244656274526174696f60481b613004565b6001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b15801561090a57600080fd5b505afa15801561091e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506109429190810190615016565b509350509250508396508160001461096957610964878363ffffffff61306116565b61096c565b60005b955082610977613081565b4203118061098d575080610989613081565b4203115b945050505050909192565b60075481565b6109a6612a86565b600180546001600160a01b0319166001600160a01b0383161790556040517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce22906109f19083906159f2565b60405180910390a150565b60066020526000908152604090205481565b610a16612a86565b6001600160a01b038216610a3c5760405162461bcd60e51b81526004016106ac90615cf3565b6002546040516321f8a72160e01b81526001600160a01b03909116906321f8a72190610a6a90600401615c36565b60206040518083038186803b158015610a8257600080fd5b505afa158015610a96573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610aba9190810190614cb3565b6001600160a01b0316826001600160a01b031614610aea5760405162461bcd60e51b81526004016106ac90615c06565b631cd554d160e21b6000526005602052600080516020615f1a833981519152546001600160a01b0316610b2f5760405162461bcd60e51b81526004016106ac90615d53565b60008111610b4f5760405162461bcd60e51b81526004016106ac90615bf6565b610b5761312b565b6001600160a01b0316631b16802c83631cd554d160e21b6040518363ffffffff1660e01b8152600401610b8b929190615a36565b606060405180830381600087803b158015610ba557600080fd5b505af1158015610bb9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610bdd9190810190614fd3565b5050631cd554d160e21b600052506005602052600080516020615f1a83398151915254604051632770a7eb60e21b81526001600160a01b0390911690639dc29fac90610c2f9085908590600401615a36565b600060405180830381600087803b158015610c4957600080fd5b505af1158015610c5d573d6000803e3d6000fd5b505050505050565b6000610c6f613142565b90505b90565b60006060610c81611eb6565b905060005b8151811015610d83576000828281518110610c9d57fe5b602090810291909101810151600081815260039092526040918290205460025492516321f8a72160e01b81529193506001600160a01b039081169216906321f8a72190610cee908590600401615ae5565b60206040518083038186803b158015610d0657600080fd5b505afa158015610d1a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610d3e9190810190614cb3565b6001600160a01b0316141580610d6957506000818152600360205260409020546001600160a01b0316155b15610d7a5760009350505050610c72565b50600101610c86565b50600191505090565b610d94612841565b6001600160a01b0316336001600160a01b031614610dc45760405162461bcd60e51b81526004016106ac90615c83565b610dce828261319d565b6106e1826000600161323e565b610de36134ae565b6001600160a01b0316336001600160a01b031614610e135760405162461bcd60e51b81526004016106ac90615c93565b6000610e1d6134c3565b9050816001600160801b0316816001600160a01b031663988e65956040518163ffffffff1660e01b815260040160206040518083038186803b158015610e6257600080fd5b505afa158015610e76573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610e9a9190810190614f35565b6001600160801b031610156106e15760405163abb6de9560e01b81526001600160a01b0382169063abb6de9590610c2f908590600401615d93565b6005602052600090815260409020546001600160a01b031681565b60408051828152602080840282010190915260609082908290828015610f20578160200160208202803883390190505b50905060005b82811015610f935760056000878784818110610f3e57fe5b90506020020135815260200190815260200160002060009054906101000a90046001600160a01b0316828281518110610f7357fe5b6001600160a01b0390921660209283029190910190910152600101610f26565b509150505b92915050565b60a581565b610fab612841565b6001600160a01b0316336001600160a01b031614610fdb5760405162461bcd60e51b81526004016106ac90615c83565b610fe583836134e3565b610ff183826000612858565b505050565b610ffe612a86565b600755565b61100b612a86565b8060005b818110156110485761104084848381811061102657fe5b905060200201602061103b9190810190614edb565b613518565b60010161100f565b50611051612ab2565b6001600160a01b03166304bd11e560016040518263ffffffff1660e01b815260040161107d9190615ad7565b600060405180830381600087803b15801561109757600080fd5b505af11580156110ab573d6000803e3d6000fd5b50505050505050565b6110bc612841565b6001600160a01b0316336001600160a01b0316146110ec5760405162461bcd60e51b81526004016106ac90615c83565b6110f9816000600161323e565b50565b60006111066136a9565b6001600160a01b031663c8e5bbd561111e60016136c4565b6040518263ffffffff1660e01b815260040161113a9190615ab5565b60006040518083038186803b15801561115257600080fd5b505afa158015611166573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610f989190810190614dfa565b6001546001600160a01b031681565b6524b9b9bab2b960d11b81565b60008060006112416111ba6134c3565b6001600160a01b03166370a08231876040518263ffffffff1660e01b81526004016111e591906159f2565b60206040518083038186803b1580156111fd57600080fd5b505afa158015611211573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506112359190810190614e7d565b620a69cb60eb1b6137a0565b93509091506000905061126261125561388a565b839063ffffffff6138e216565b90508481106112745760009350611287565b611284858263ffffffff6138f716565b93505b50509250929050565b611298612a86565b8060006112a3612ab2565b90506060826040519080825280602002602001820160405280156112d1578160200160208202803883390190505b506040516305ece36d60e21b81529091506001600160a01b038316906317b38db49061130590889088908690600401615a8f565b600060405180830381600087803b15801561131f57600080fd5b505af1158015611333573d6000803e3d6000fd5b50506040516304bd11e560e01b81526001600160a01b03851692506304bd11e5915061136490600190600401615ad7565b600060405180830381600087803b15801561137e57600080fd5b505af1158015611392573d6000803e3d6000fd5b506000925050505b83811015610c5d576113bd8686838181106113b157fe5b90506020020135612ac9565b60010161139a565b6000806113d0612841565b6001600160a01b0316336001600160a01b0316146114005760405162461bcd60e51b81526004016106ac90615c83565b61140861391f565b6001600160a01b031663952225f385856040518363ffffffff1660e01b8152600401611435929190615a1b565b60206040518083038186803b15801561144d57600080fd5b505afa158015611461573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506114859190810190614e41565b6114a15760405162461bcd60e51b81526004016106ac90615cd3565b6000836114b5576114b0613937565b6114bd565b6114bd613994565b90506000806115556114cd6134c3565b6001600160a01b03166370a08231896040518263ffffffff1660e01b81526004016114f891906159f2565b60206040518083038186803b15801561151057600080fd5b505afa158015611524573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506115489190810190614e7d565b631cd554d160e21b6137a0565b92505091506000806115656136a9565b6001600160a01b0316630c71cd23620a69cb60eb1b6040518263ffffffff1660e01b81526004016115969190615ae5565b604080518083038186803b1580156115ad57600080fd5b505afa1580156115c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506115e59190810190614f53565b915091506115fa83806115f55750815b6139f5565b60006116058a613a13565b905061160f61391f565b6001600160a01b031663f557f73c866116288487613bbc565b896040518463ffffffff1660e01b815260040161164793929190615b0f565b60206040518083038186803b15801561165f57600080fd5b505afa158015611673573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506116979190810190614e7d565b965061173e611728877384d626b2bb4d0f064067e4bf80fce7055d8f3e7b63907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b1580156116e457600080fd5b505af41580156116f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061171c9190810190614e7d565b9063ffffffff613bce16565b6117328986613bf3565b9063ffffffff613c0516565b9750600061174a612841565b6001600160a01b03166370a082318c6040518263ffffffff1660e01b815260040161177591906159f2565b60206040518083038186803b15801561178d57600080fd5b505afa1580156117a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506117c59190810190614e7d565b9050808911156117f5576117ef896117e38a8463ffffffff613c0516565b9063ffffffff613c2f16565b97508098505b6118008b8988613c59565b61180861391f565b6001600160a01b031663974e9e7f8c6040518263ffffffff1660e01b815260040161183391906159f2565b600060405180830381600087803b15801561184d57600080fd5b505af1158015611861573d6000803e3d6000fd5b50505050505050505050509250929050565b6060610c6f60006136c4565b6060611889611eb6565b905060005b81518110156106e15760008282815181106118a557fe5b602002602001015190506000600260009054906101000a90046001600160a01b03166001600160a01b031663dacb2d0183846040516020016118e791906159e7565b6040516020818303038152906040526040518363ffffffff1660e01b8152600401611913929190615b52565b60206040518083038186803b15801561192b57600080fd5b505afa15801561193f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506119639190810190614cb3565b6000838152600360205260409081902080546001600160a01b0319166001600160a01b038416179055519091507f88a93678a3692f6789d9546fc621bf7234b101ddb7d4fe479455112831b8aa68906119bf9084908490615af3565b60405180910390a1505060010161188e565b6001546001600160a01b031633146119fb5760405162461bcd60e51b81526004016106ac90615bd6565b6000546001546040517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c92611a3e926001600160a01b0391821692911690615a00565b60405180910390a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b6000611a798383613e3a565b509392505050565b60048181548110611a8e57fe5b6000918252602090912001546001600160a01b0316905081565b611ab0612a86565b611ab981613518565b611ac1612ab2565b6001600160a01b03166304bd11e560016040518263ffffffff1660e01b8152600401611aed9190615ad7565b600060405180830381600087803b158015611b0757600080fd5b505af1158015611b1b573d6000803e3d6000fd5b5050505050565b6002546040516321f8a72160e01b815260009182916001600160a01b03909116906321f8a72190611b73907853796e746865746978427269646765546f4f7074696d69736d60381b90600401615ae5565b60206040518083038186803b158015611b8b57600080fd5b505afa158015611b9f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611bc39190810190614cb3565b6002546040516321f8a72160e01b81529192506000916001600160a01b03909116906321f8a72190611c11907453796e746865746978427269646765546f4261736560581b90600401615ae5565b60206040518083038186803b158015611c2957600080fd5b505afa158015611c3d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611c619190810190614cb3565b9050336001600160a01b0383161480611c825750336001600160a01b038216145b611c9e5760405162461bcd60e51b81526004016106ac90615d83565b6001600160a01b0382161580611cbb57506001600160a01b038116155b611cd75760405162461bcd60e51b81526004016106ac90615bc6565b6000868152600560205260409020546001600160a01b0316611d0b5760405162461bcd60e51b81526004016106ac90615d53565b60008411611d2b5760405162461bcd60e51b81526004016106ac90615d33565b611d3485614045565b6000868152600560205260409081902054905163219e412d60e21b81526001600160a01b039091169063867904b490611d739088908890600401615a36565b600060405180830381600087803b158015611d8d57600080fd5b505af1158015611da1573d6000803e3d6000fd5b50505050600080611db06136a9565b6001600160a01b0316630c71cd23896040518263ffffffff1660e01b8152600401611ddb9190615ae5565b604080518083038186803b158015611df257600080fd5b505afa158015611e06573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611e2a9190810190614f53565b91509150611e36612ab2565b6001600160a01b03166342c7b819611e5c611e57898663ffffffff613c0516565b6140be565b6040518263ffffffff1660e01b8152600401611e789190615ae5565b600060405180830381600087803b158015611e9257600080fd5b505af1158015611ea6573d6000803e3d6000fd5b50929a9950505050505050505050565b606080611ec16140e7565b60408051600f808252610200820190925291925060609190602082016101e080388339019050509050680a6f2dce8d0cae8d2f60bb1b81600081518110611f0457fe5b6020026020010181815250506822bc31b430b733b2b960b91b81600181518110611f2a57fe5b6020026020010181815250506c45786368616e6765526174657360981b81600281518110611f5457fe5b6020026020010181815250507153796e74686574697844656274536861726560701b81600381518110611f8357fe5b60200260200101818152505066119959541bdbdb60ca1b81600481518110611fa757fe5b6020026020010181815250507044656c6567617465417070726f76616c7360781b81600581518110611fd557fe5b6020026020010181815250506d2932bbb0b93222b9b1b937bbab1960911b8160068151811061200057fe5b6020026020010181815250506e53796e746865746978457363726f7760881b8160078151811061202c57fe5b602002602001018181525050692634b8bab4b230ba37b960b11b8160088151811061205357fe5b602002602001018181525050704c697175696461746f725265776172647360781b8160098151811061208157fe5b6020026020010181815250506844656274436163686560b81b81600a815181106120a757fe5b6020026020010181815250506c29bcb73a342932b232b2b6b2b960991b81600b815181106120d157fe5b6020026020010181815250506b53797374656d53746174757360a01b81600c815181106120fa57fe5b6020026020010181815250507f6578743a41676772656761746f7249737375656453796e74687300000000000081600d8151811061213457fe5b602002602001018181525050766578743a41676772656761746f7244656274526174696f60481b81600e8151811061216857fe5b60200260200101818152505061217e8282614138565b9250505090565b6000546001600160a01b031681565b61219c612841565b6001600160a01b0316336001600160a01b0316146121cc5760405162461bcd60e51b81526004016106ac90615c83565b6121d6838361319d565b610ff18382600061323e565b60006121ed826141ed565b5092915050565b6000610f9882613a13565b60008061220b836141ed565b915091505b915091565b61221d612841565b6001600160a01b0316336001600160a01b03161461224d5760405162461bcd60e51b81526004016106ac90615c83565b6106e18282600061323e565b6000610c6f61388a565b6000610f988261426d565b6002546040516321f8a72160e01b815260009182916001600160a01b03909116906321f8a721906122bf907853796e746865746978427269646765546f4f7074696d69736d60381b90600401615ae5565b60206040518083038186803b1580156122d757600080fd5b505afa1580156122eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061230f9190810190614cb3565b6002546040516321f8a72160e01b81529192506000916001600160a01b03909116906321f8a7219061235d907453796e746865746978427269646765546f4261736560581b90600401615ae5565b60206040518083038186803b15801561237557600080fd5b505afa158015612389573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506123ad9190810190614cb3565b9050336001600160a01b03831614806123ce5750336001600160a01b038216145b6123ea5760405162461bcd60e51b81526004016106ac90615d83565b6001600160a01b038216158061240757506001600160a01b038116155b6124235760405162461bcd60e51b81526004016106ac90615bc6565b6000868152600560205260409020546001600160a01b03166124575760405162461bcd60e51b81526004016106ac90615d53565b600084116124775760405162461bcd60e51b81526004016106ac90615d33565b61247f61312b565b6001600160a01b0316631b16802c86886040518363ffffffff1660e01b81526004016124ac929190615a36565b606060405180830381600087803b1580156124c657600080fd5b505af11580156124da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506124fe9190810190614fd3565b50505060008681526005602052604090819020549051632770a7eb60e21b81526001600160a01b0390911690639dc29fac906125409088908890600401615a36565b600060405180830381600087803b15801561255a57600080fd5b505af115801561256e573d6000803e3d6000fd5b5050505060008061257d6136a9565b6001600160a01b0316630c71cd23896040518263ffffffff1660e01b81526004016125a89190615ae5565b604080518083038186803b1580156125bf57600080fd5b505afa1580156125d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506125f79190810190614f53565b91509150612603612ab2565b6001600160a01b03166342c7b819612624611e57898663ffffffff613c0516565b6000036040518263ffffffff1660e01b8152600401611e789190615ae5565b61264b612841565b6001600160a01b0316336001600160a01b03161461267b5760405162461bcd60e51b81526004016106ac90615c83565b6110f98160006001612858565b6000806126936134c3565b90506000816001600160a01b03166370a08231866040518263ffffffff1660e01b81526004016126c391906159f2565b60206040518083038186803b1580156126db57600080fd5b505afa1580156126ef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506127139190810190614e7d565b90508061272557600092505050610f98565b61272f81856137a0565b50909695505050505050565b61274361428c565b826001600160a01b031663d4b839926040518163ffffffff1660e01b815260040160206040518083038186803b15801561277c57600080fd5b505afa158015612790573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506127b49190810190614cb3565b6001600160a01b0316639dc29fac83836040518363ffffffff1660e01b815260040161107d929190615a36565b60045490565b6000610f98826142c4565b6127fa612841565b6001600160a01b0316336001600160a01b03161461282a5760405162461bcd60e51b81526004016106ac90615c83565b61283482826134e3565b6106e18260006001612858565b6000610c6f680a6f2dce8d0cae8d2f60bb1b613004565b61286061438d565b61286957610ff1565b60008061287585612f77565b935050509150612884816139f5565b826128ae57818411156128a95760405162461bcd60e51b81526004016106ac90615c53565b6128b2565b8193505b6128bc85856144c2565b6128c585614045565b631cd554d160e21b6000526005602052600080516020615f1a8339815191525460405163219e412d60e21b81526001600160a01b039091169063867904b4906129149088908890600401615a36565b600060405180830381600087803b15801561292e57600080fd5b505af1158015612942573d6000803e3d6000fd5b5050505061294e612ab2565b6001600160a01b03166342c7b819612965866140be565b6040518263ffffffff1660e01b81526004016129819190615ae5565b600060405180830381600087803b15801561299b57600080fd5b505af11580156129af573d6000803e3d6000fd5b505050505050505050565b6000806000806129c86136a9565b6001600160a01b0316630c71cd23620a69cb60eb1b6040518263ffffffff1660e01b81526004016129f99190615ae5565b604080518083038186803b158015612a1057600080fd5b505afa158015612a24573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250612a489190810190614f53565b915091506000612a60612a5a87613a13565b84613bbc565b9050612a7a612a6d61388a565b829063ffffffff613c0516565b94509092505050915091565b6000546001600160a01b03163314612ab05760405162461bcd60e51b81526004016106ac90615ce3565b565b6000610c6f6844656274436163686560b81b613004565b6000818152600560205260409020546001600160a01b031680612afe5760405162461bcd60e51b81526004016106ac90615cb3565b631cd554d160e21b821415612b255760405162461bcd60e51b81526004016106ac90615d23565b6000816001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015612b6057600080fd5b505afa158015612b74573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250612b989190810190614e7d565b90508015612e1a57600080612bab6136a9565b6001600160a01b0316638295016a86856040518363ffffffff1660e01b8152600401612bd8929190615b72565b60606040518083038186803b158015612bf057600080fd5b505afa158015612c04573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250612c289190810190614fd3565b509150915060008111612c4d5760405162461bcd60e51b81526004016106ac90615cc3565b6000612c5761460c565b631cd554d160e21b6000526005602052600080516020615f1a8339815191525460405163219e412d60e21b81529192506001600160a01b03169063867904b490612ca79084908790600401615a36565b600060405180830381600087803b158015612cc157600080fd5b505af1158015612cd5573d6000803e3d6000fd5b50505050612ce1612ab2565b6001600160a01b03166342c7b819612cf8856140be565b6040518263ffffffff1660e01b8152600401612d149190615ae5565b600060405180830381600087803b158015612d2e57600080fd5b505af1158015612d42573d6000803e3d6000fd5b50505050806001600160a01b0316633a70599c866001600160a01b031663ec5568896040518163ffffffff1660e01b815260040160206040518083038186803b158015612d8e57600080fd5b505afa158015612da2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250612dc69190810190614ef9565b846040518363ffffffff1660e01b8152600401612de4929190615ba7565b600060405180830381600087803b158015612dfe57600080fd5b505af1158015612e12573d6000803e3d6000fd5b505050505050505b60005b600454811015612f0157826001600160a01b031660048281548110612e3e57fe5b6000918252602090912001546001600160a01b03161415612ef95760048181548110612e6657fe5b600091825260209091200180546001600160a01b0319169055600480546000198101908110612e9157fe5b600091825260209091200154600480546001600160a01b039092169183908110612eb757fe5b600091825260209091200180546001600160a01b0319166001600160a01b03929092169190911790556004805490612ef3906000198301614b22565b50612f01565b600101612e1d565b506001600160a01b038216600090815260066020908152604080832083905585835260059091529081902080546001600160a01b0319169055517f6166f5c475cc1cd535c6cdf14a6d5edb811e34117031fc2863392a136eb655d090612f6a9085908590615af3565b60405180910390a1505050565b600080600080612fb3612f886134c3565b6001600160a01b03166370a08231876040518263ffffffff1660e01b81526004016114f891906159f2565b91945092509050600080612fc6876129ba565b915091508195508280612fd65750805b9250858510612fe85760009550612ffb565b612ff8868663ffffffff6138f716565b95505b50509193509193565b60008181526003602090815260408083205490516001600160a01b039091169182151591613034918691016159c7565b604051602081830303815290604052906121ed5760405162461bcd60e51b81526004016106ac9190615bb5565b600061307a83836b033b2e3c9fd0803ce8000000614627565b9392505050565b600061308b61465f565b6001600160a01b03166323257c2b6d53797374656d53657474696e677360901b6e1c985d1954dd185b1954195c9a5bd9608a1b6040518363ffffffff1660e01b81526004016130db929190615b01565b60206040518083038186803b1580156130f357600080fd5b505afa158015613107573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610c6f9190810190614e7d565b6000610c6f6822bc31b430b733b2b960b91b613004565b600061314c61465f565b6001600160a01b03166323257c2b6d53797374656d53657474696e677360901b6f6d696e696d756d5374616b6554696d6560801b6040518363ffffffff1660e01b81526004016130db929190615b01565b6131a561467c565b6001600160a01b0316637d3f0ba283836040518363ffffffff1660e01b81526004016131d2929190615a00565b60206040518083038186803b1580156131ea57600080fd5b505afa1580156131fe573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506132229190810190614e41565b6106e15760405162461bcd60e51b81526004016106ac90615be6565b61324661438d565b61324f57610ff1565b806133ac5761325d8361426d565b6132795760405162461bcd60e51b81526004016106ac90615d63565b60008061328461312b565b6001600160a01b0316631b16802c86631cd554d160e21b6040518363ffffffff1660e01b81526004016132b8929190615a36565b606060405180830381600087803b1580156132d257600080fd5b505af11580156132e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061330a9190810190614fd3565b90935091505080156133a95761331e61312b565b6001600160a01b0316634c268fc886631cd554d160e21b87866040518563ffffffff1660e01b81526004016133569493929190615a51565b60206040518083038186803b15801561336e57600080fd5b505afa158015613382573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506133a69190810190614e7d565b93505b50505b6000806133ba612f886134c3565b92505091506000806133cb876129ba565b915091506133df83806115f55750816139f5565b600084116133ff5760405162461bcd60e51b81526004016106ac90615c43565b841561341857613415848363ffffffff6138f716565b95505b60006134268889898861469b565b905082613439868363ffffffff6138f716565b116134a45761344661391f565b6001600160a01b031663974e9e7f896040518263ffffffff1660e01b815260040161347191906159f2565b600060405180830381600087803b15801561348b57600080fd5b505af115801561349f573d6000803e3d6000fd5b505050505b5050505050505050565b6000610c6f66119959541bdbdb60ca1b613004565b6000610c6f7153796e74686574697844656274536861726560701b613004565b6134eb61467c565b6001600160a01b0316630487261783836040518363ffffffff1660e01b81526004016131d2929190615a00565b6000816001600160a01b031663dbd06c856040518163ffffffff1660e01b815260040160206040518083038186803b15801561355357600080fd5b505afa158015613567573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061358b9190810190614e7d565b6000818152600560205260409020549091506001600160a01b0316156135c35760405162461bcd60e51b81526004016106ac90615d43565b6001600160a01b038216600090815260066020526040902054156135f95760405162461bcd60e51b81526004016106ac90615d03565b60048054600181019091557f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b0180546001600160a01b0384166001600160a01b03199182168117909255600083815260056020908152604080832080549094168517909355928152600690925290819020829055517f0a2b6ebf143b3e9fcd67e17748ad315174746100c27228468b2c98c302c628849061369d9083908590615af3565b60405180910390a15050565b6000610c6f6c45786368616e6765526174657360981b613004565b606080826136d35760006136d6565b60015b60ff1660048054905001604051908082528060200260200182016040528015613709578160200160208202803883390190505b50905060005b60045481101561377057600660006004838154811061372a57fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902054825183908390811061375d57fe5b602090810291909101015260010161370f565b508215610f98576004548151620a69cb60eb1b918391811061378e57fe5b60200260200101818152505092915050565b60008060008060006137b0610804565b925050915086600014156137cc57600094509092509050613883565b6000806137d76136a9565b6001600160a01b0316630c71cd23896040518263ffffffff1660e01b81526004016138029190615ae5565b604080518083038186803b15801561381957600080fd5b505afa15801561382d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506138519190810190614f53565b9150915061386e826138628b6147c7565b9063ffffffff6138e216565b9650839550808061387c5750825b9450505050505b9250925092565b600061389461465f565b6001600160a01b03166323257c2b6d53797374656d53657474696e677360901b6c69737375616e6365526174696f60981b6040518363ffffffff1660e01b81526004016130db929190615b01565b600061307a8383670de0b6b3a7640000614627565b6000828211156139195760405162461bcd60e51b81526004016106ac90615c63565b50900390565b6000610c6f692634b8bab4b230ba37b960b11b613004565b600061394161465f565b6001600160a01b03166323257c2b6d53797374656d53657474696e677360901b716c69717569646174696f6e50656e616c747960701b6040518363ffffffff1660e01b81526004016130db929190615b01565b600061399e61465f565b6001600160a01b03166323257c2b6d53797374656d53657474696e677360901b7573656c664c69717569646174696f6e50656e616c747960501b6040518363ffffffff1660e01b81526004016130db929190615b01565b80156110f95760405162461bcd60e51b81526004016106ac90615ca3565b600080613a1e612841565b6001600160a01b03166370a08231846040518263ffffffff1660e01b8152600401613a4991906159f2565b60206040518083038186803b158015613a6157600080fd5b505afa158015613a75573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250613a999190810190614e7d565b90506000613aa5614876565b6001600160a01b031614613b4957613b46613abe614876565b6001600160a01b03166370a08231856040518263ffffffff1660e01b8152600401613ae991906159f2565b60206040518083038186803b158015613b0157600080fd5b505afa158015613b15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250613b399190810190614e7d565b829063ffffffff613bce16565b90505b6000613b53614893565b6001600160a01b031614613b6f57613b6c613abe614893565b90505b6000613b796148af565b6001600160a01b031614610f985761307a613b926148af565b6001600160a01b0316628cc262856040518263ffffffff1660e01b8152600401613ae991906159f2565b600061307a838363ffffffff6148ce16565b60008282018381101561307a5760405162461bcd60e51b81526004016106ac90615c16565b600061307a838363ffffffff6138e216565b6000670de0b6b3a7640000613c20848463ffffffff6148e316565b81613c2757fe5b049392505050565b600061307a82613c4d85670de0b6b3a764000063ffffffff6148e316565b9063ffffffff61491d16565b613c616148af565b6001600160a01b031663270fb338846040518263ffffffff1660e01b8152600401613c8c91906159f2565b600060405180830381600087803b158015613ca657600080fd5b505af1158015613cba573d6000803e3d6000fd5b505050506000613cc86134c3565b90506000816001600160a01b03166370a08231866040518263ffffffff1660e01b8152600401613cf891906159f2565b60206040518083038186803b158015613d1057600080fd5b505afa158015613d24573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250613d489190810190614e7d565b905082841415613db757604051631a378f0d60e01b81526001600160a01b03831690631a378f0d90613d809088908590600401615a36565b600060405180830381600087803b158015613d9a57600080fd5b505af1158015613dae573d6000803e3d6000fd5b50505050611b1b565b6000613dc285614952565b9050826001600160a01b0316631a378f0d87848410613de15784613de3565b835b6040518363ffffffff1660e01b8152600401613e00929190615a36565b600060405180830381600087803b158015613e1a57600080fd5b505af1158015613e2e573d6000803e3d6000fd5b50505050505050505050565b6000806000806000613e4a612ab2565b6001600160a01b0316633a900a2e6040518163ffffffff1660e01b815260040160806040518083038186803b158015613e8257600080fd5b505afa158015613e96573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250613eba9190810190614f72565b935093505092508180613eca5750805b93506000613ed66136a9565b905086613f7c57600080613ee8612ab2565b6001600160a01b0316632992dba26040518163ffffffff1660e01b8152600401604080518083038186803b158015613f1f57600080fd5b505afa158015613f33573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250613f579190810190614f53565b9092509050613f6c868363ffffffff613bce16565b95508680613f775750805b965050505b631cd554d160e21b881415613f97575091935061403e915050565b600080826001600160a01b0316630c71cd238b6040518263ffffffff1660e01b8152600401613fc69190615ae5565b604080518083038186803b158015613fdd57600080fd5b505afa158015613ff1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506140159190810190614f53565b909250905061402a868363ffffffff6138e216565b87806140335750815b975097505050505050505b9250929050565b61404d61465f565b6001600160a01b0316631d5b277f6524b9b9bab2b960d11b6d1b185cdd125cdcdd59515d995b9d60921b846040516020016140899291906159a1565b60405160208183030381529060405280519060200120426040518463ffffffff1660e01b8152600401611aed93929190615b0f565b6000600160ff1b82106140e35760405162461bcd60e51b81526004016106ac90615d73565b5090565b604080516001808252818301909252606091602080830190803883390190505090506e466c657869626c6553746f7261676560881b8160008151811061412957fe5b60200260200101818152505090565b60608151835101604051908082528060200260200182016040528015614168578160200160208202803883390190505b50905060005b83518110156141aa5783818151811061418357fe5b602002602001015182828151811061419757fe5b602090810291909101015260010161416e565b5060005b82518110156121ed578281815181106141c357fe5b60200260200101518282865101815181106141da57fe5b60209081029190910101526001016141ae565b60008060006141fb84613a13565b905060008061423661420b6134c3565b6001600160a01b03166370a08231886040518263ffffffff1660e01b81526004016111e591906159f2565b9250509150826000141561425257600094509250612210915050565b614262828463ffffffff6138e216565b945092505050915091565b600061428361427a613142565b61171c846142c4565b42101592915050565b61429461460c565b6001600160a01b0316336001600160a01b031614612ab05760405162461bcd60e51b81526004016106ac90615c26565b60006142ce61465f565b6001600160a01b03166323257c2b6524b9b9bab2b960d11b6d1b185cdd125cdcdd59515d995b9d60921b8560405160200161430a9291906159a1565b604051602081830303815290604052805190602001206040518363ffffffff1660e01b815260040161433d929190615b01565b60206040518083038186803b15801561435557600080fd5b505afa158015614369573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610f989190810190614e7d565b6000806143b3766578743a41676772656761746f7244656274526174696f60481b613004565b6001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b1580156143eb57600080fd5b505afa1580156143ff573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506144239190810190615016565b505050915050600061443760075483614a14565b9050614441614a60565b81106144b85761444f614ac8565b6001600160a01b031663396e258e60a56040518263ffffffff1660e01b815260040161447b9190615ae5565b600060405180830381600087803b15801561449557600080fd5b505af11580156144a9573d6000803e3d6000fd5b50505050600092505050610c72565b5060075550600190565b6144ca6148af565b6001600160a01b031663270fb338836040518263ffffffff1660e01b81526004016144f591906159f2565b600060405180830381600087803b15801561450f57600080fd5b505af1158015614523573d6000803e3d6000fd5b5050505060006145316134c3565b9050600061453e83614952565b9050806145aa57604051636178258560e11b81526001600160a01b0383169063c2f04b0a906145739087908790600401615a36565b600060405180830381600087803b15801561458d57600080fd5b505af11580156145a1573d6000803e3d6000fd5b50505050614606565b604051636178258560e11b81526001600160a01b0383169063c2f04b0a906145d89087908590600401615a36565b600060405180830381600087803b1580156145f257600080fd5b505af11580156134a4573d6000803e3d6000fd5b50505050565b6000610c6f6c29bcb73a342932b232b2b6b2b960991b613004565b60008061464184613c4d87600a870263ffffffff6148e316565b90506005600a825b061061465357600a015b600a9004949350505050565b6000610c6f6e466c657869626c6553746f7261676560881b613004565b6000610c6f7044656c6567617465417070726f76616c7360781b613004565b60006146a561438d565b6146b1575060006147bf565b8282106146be57826146c0565b815b90506146cd858284613c59565b631cd554d160e21b6000526005602052600080516020615f1a83398151915254604051632770a7eb60e21b81526001600160a01b0390911690639dc29fac9061471c9087908590600401615a36565b600060405180830381600087803b15801561473657600080fd5b505af115801561474a573d6000803e3d6000fd5b50505050614756612ab2565b6001600160a01b03166342c7b81961476d836140be565b6000036040518263ffffffff1660e01b815260040161478c9190615ae5565b600060405180830381600087803b1580156147a657600080fd5b505af11580156147ba573d6000803e3d6000fd5b505050505b949350505050565b6000806147ed766578743a41676772656761746f7244656274526174696f60481b613004565b6001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b15801561482557600080fd5b505afa158015614839573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061485d9190810190615016565b50505091505061307a8184614ae290919063ffffffff16565b6000610c6f6e53796e746865746978457363726f7760881b613004565b6000610c6f6d2932bbb0b93222b9b1b937bbab1960911b613004565b6000610c6f704c697175696461746f725265776172647360781b613004565b600061307a8383670de0b6b3a7640000614af7565b6000826148f257506000610f98565b828202828482816148ff57fe5b041461307a5760405162461bcd60e51b81526004016106ac90615d13565b600080821161493e5760405162461bcd60e51b81526004016106ac90615c73565b600082848161494957fe5b04949350505050565b600080614978766578743a41676772656761746f7244656274526174696f60481b613004565b6001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b1580156149b057600080fd5b505afa1580156149c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506149e89190810190615016565b50505091505080600014614a0b57614a06838263ffffffff61306116565b61307a565b50600092915050565b600082614a2357506001610f98565b81614a315750600019610f98565b81831115614a5057614a49838363ffffffff613c2f16565b9050610f98565b61307a828463ffffffff613c2f16565b6000614a6a61465f565b6001600160a01b03166323257c2b6d53797374656d53657474696e677360901b7f7072696365446576696174696f6e5468726573686f6c64466163746f720000006040518363ffffffff1660e01b81526004016130db929190615b01565b6000610c6f6b53797374656d53746174757360a01b613004565b600061307a83836b033b2e3c9fd0803ce80000005b600080600a8304614b0e868663ffffffff6148e316565b81614b1557fe5b0490506005600a82614649565b815481835581811115610ff157600083815260209020610ff1918101908301610c7291905b808211156140e35760008155600101614b47565b8035610f9881615ed8565b8051610f9881615ed8565b60008083601f840112614b8357600080fd5b50813567ffffffffffffffff811115614b9b57600080fd5b60208301915083602082028301111561403e57600080fd5b600082601f830112614bc457600080fd5b8151614bd7614bd282615dfe565b615dd7565b91508181835260208401935060208101905083856020840282011115614bfc57600080fd5b60005b83811015614c285781614c128882614c53565b8452506020928301929190910190600101614bff565b5050505092915050565b8035610f9881615eec565b8051610f9881615eec565b8035610f9881615ef5565b8051610f9881615ef5565b8035610f9881615efe565b8051610f9881615efe565b8035610f9881615f07565b8051610f9881615f07565b8051610f9881615f10565b600060208284031215614ca757600080fd5b60006147bf8484614b5b565b600060208284031215614cc557600080fd5b60006147bf8484614b66565b60008060408385031215614ce457600080fd5b6000614cf08585614b5b565b9250506020614d0185828601614b5b565b9150509250929050565b600080600060608486031215614d2057600080fd5b6000614d2c8686614b5b565b9350506020614d3d86828701614b5b565b9250506040614d4e86828701614c48565b9150509250925092565b60008060408385031215614d6b57600080fd5b6000614d778585614b5b565b9250506020614d0185828601614c32565b60008060408385031215614d9b57600080fd5b6000614da78585614b5b565b9250506020614d0185828601614c48565b60008060208385031215614dcb57600080fd5b823567ffffffffffffffff811115614de257600080fd5b614dee85828601614b71565b92509250509250929050565b60008060408385031215614e0d57600080fd5b825167ffffffffffffffff811115614e2457600080fd5b614e3085828601614bb3565b9250506020614d0185828601614c3d565b600060208284031215614e5357600080fd5b60006147bf8484614c3d565b600060208284031215614e7157600080fd5b60006147bf8484614c48565b600060208284031215614e8f57600080fd5b60006147bf8484614c53565b600080600060608486031215614eb057600080fd5b6000614d2c8686614c48565b60008060408385031215614ecf57600080fd5b6000614d778585614c48565b600060208284031215614eed57600080fd5b60006147bf8484614c5e565b600060208284031215614f0b57600080fd5b60006147bf8484614c69565b600060208284031215614f2957600080fd5b60006147bf8484614c74565b600060208284031215614f4757600080fd5b60006147bf8484614c7f565b60008060408385031215614f6657600080fd5b6000614e308585614c53565b60008060008060808587031215614f8857600080fd5b6000614f948787614c53565b9450506020614fa587828801614c53565b9350506040614fb687828801614c3d565b9250506060614fc787828801614c3d565b91505092959194509250565b600080600060608486031215614fe857600080fd5b6000614ff48686614c53565b935050602061500586828701614c53565b9250506040614d4e86828701614c53565b600080600080600060a0868803121561502e57600080fd5b600061503a8888614c8a565b955050602061504b88828901614c53565b945050604061505c88828901614c53565b935050606061506d88828901614c53565b925050608061507e88828901614c8a565b9150509295509295909350565b60006150978383615202565b505060200190565b6000615097838361521c565b6150b481615e32565b82525050565b6150b46150c682615e32565b615eb7565b60006150d78385615e29565b93506001600160fb1b038311156150ed57600080fd5b6020830292506150fe838584615e7f565b50500190565b600061510f82615e25565b6151198185615e29565b935061512483615e1f565b8060005b8381101561515257815161513c888261508b565b975061514783615e1f565b925050600101615128565b509495945050505050565b600061516882615e25565b6151728185615e29565b935061517d83615e1f565b8060005b83811015615152578151615195888261509f565b97506151a083615e1f565b925050600101615181565b60006151b682615e25565b6151c08185615e29565b93506151cb83615e1f565b8060005b838110156151525781516151e3888261508b565b97506151ee83615e1f565b9250506001016151cf565b6150b481615e3d565b6150b481610c72565b6150b461521782610c72565b610c72565b6150b481615e42565b6150b481615e74565b600061523982615e25565b6152438185615e29565b9350615253818560208601615e8b565b61525c81615ec8565b9093019392505050565b6000615273601e83615e29565b7f4973737565723a206f6e65206d696e746572206d757374206265203078300000815260200192915050565b60006152ac603583615e29565b7f596f75206d757374206265206e6f6d696e61746564206265666f726520796f7581527402063616e20616363657074206f776e65727368697605c1b602082015260400192915050565b6000615303601d83615e29565b7f4e6f7420617070726f76656420746f20616374206f6e20626568616c66000000815260200192915050565b600061533c601c83615e29565b7f4973737565723a2063616e6e6f74206275726e20302073796e74687300000000815260200192915050565b6000615375601b83615e29565b7f4973737565723a2077726f6e672073686f727420616464726573730000000000815260200192915050565b60006153ae601b83615e29565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000815260200192915050565b60006153e7603f83615e29565b7f4973737565723a204f6e6c79207468652053796e746852656465656d6572206381527f6f6e74726163742063616e20706572666f726d207468697320616374696f6e00602082015260400192915050565b74436f6c6c61746572616c53686f72744c656761637960581b9052565b6000615463601283615e29565b714e6f206465627420746f20666f726769766560701b815260200192915050565b6000615491601083615e29565b6f416d6f756e7420746f6f206c6172676560801b815260200192915050565b60006154bd601e83615e29565b7f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815260200192915050565b60006154f6601a83615e29565b7f536166654d6174683a206469766973696f6e206279207a65726f000000000000815260200192915050565b600061552f601183610705565b70026b4b9b9b4b7339030b2323932b9b99d1607d1b815260110192915050565b600061555c603b83615e29565b7f4973737565723a204f6e6c79207468652073796e74686574697820636f6e747281527f6163742063616e20706572666f726d207468697320616374696f6e0000000000602082015260400192915050565b60006155bb601083615e29565b6f135d5cdd08189948199959481c1bdbdb60821b815260200192915050565b60006155e7601e83615e29565b7f412073796e7468206f7220534e58207261746520697320696e76616c69640000815260200192915050565b6000615620601483615e29565b7314de5b9d1a08191bd95cc81b9bdd08195e1a5cdd60621b815260200192915050565b6000615650602a83615e29565b7f43616e6e6f742072656d6f76652073796e746820746f2072656465656d20776981526974686f7574207261746560b01b602082015260400192915050565b600061569c601883615e29565b7f4e6f74206f70656e20666f72206c69717569646174696f6e0000000000000000815260200192915050565b60006156d5602f83615e29565b7f4f6e6c792074686520636f6e7472616374206f776e6572206d6179207065726681526e37b936903a3434b99030b1ba34b7b760891b602082015260400192915050565b631cd554d160e21b9052565b6000615732601783615e29565b7f4973737565723a20696e76616c69642061646472657373000000000000000000815260200192915050565b600061576b601c83615e29565b7f53796e7468206164647265737320616c72656164792065786973747300000000815260200192915050565b60006157a4602183615e29565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f8152607760f81b602082015260400192915050565b60006157e7601383615e29565b72086c2dcdcdee840e4cadadeecca40e6f2dce8d606b1b815260200192915050565b6000615816601d83615e29565b7f4973737565723a2063616e6e6f7420697373756520302073796e746873000000815260200192915050565b600061584f601983610705565b7f5265736f6c766572206d697373696e67207461726765743a2000000000000000815260190192915050565b6000615888600c83615e29565b6b53796e74682065786973747360a01b815260200192915050565b60006158b0601b83615e29565b7f4973737565723a2073796e746820646f65736e27742065786973740000000000815260200192915050565b60006158e9601e83615e29565b7f4d696e696d756d207374616b652074696d65206e6f7420726561636865640000815260200192915050565b6000615922602883615e29565b7f53616665436173743a2076616c756520646f65736e27742066697420696e2061815267371034b73a191a9b60c11b602082015260400192915050565b600061596c601c83615e29565b7f4973737565723a206f6e6c792074727573746564206d696e7465727300000000815260200192915050565b6150b481615e4d565b60006159ad828561520b565b6020820191506159bd82846150ba565b5060140192915050565b60006159d282615522565b91506159de828461520b565b50602001919050565b60006159d282615842565b60208101610f9882846150ab565b60408101615a0e82856150ab565b61307a60208301846150ab565b60408101615a2982856150ab565b61307a60208301846151f9565b60408101615a4482856150ab565b61307a6020830184615202565b60808101615a5f82876150ab565b615a6c6020830186615202565b615a796040830185615202565b615a866060830184615202565b95945050505050565b60408082528101615aa18185876150cb565b90508181036020830152615a8681846151ab565b6020808252810161307a8184615104565b6020808252810161307a818461515d565b60208101610f9882846151f9565b60208101610f988284615202565b60408101615a0e8285615202565b60408101615a448285615202565b60608101615b1d8286615202565b615b2a6020830185615202565b6147bf6040830184615202565b60408101615b458285615202565b61307a6020830184615225565b60408101615b608285615202565b81810360208301526147bf818461522e565b60608101615b808285615202565b615b8d6020830184615202565b61307a60408301615719565b60208101610f98828461521c565b60408101615a44828561521c565b6020808252810161307a818461522e565b60208082528101610f9881615266565b60208082528101610f988161529f565b60208082528101610f98816152f6565b60208082528101610f988161532f565b60208082528101610f9881615368565b60208082528101610f98816153a1565b60208082528101610f98816153da565b6020810161070582615439565b60208082528101610f9881615456565b60208082528101610f9881615484565b60208082528101610f98816154b0565b60208082528101610f98816154e9565b60208082528101610f988161554f565b60208082528101610f98816155ae565b60208082528101610f98816155da565b60208082528101610f9881615613565b60208082528101610f9881615643565b60208082528101610f988161568f565b60208082528101610f98816156c8565b60208082528101610f9881615725565b60208082528101610f988161575e565b60208082528101610f9881615797565b60208082528101610f98816157da565b60208082528101610f9881615809565b60208082528101610f988161587b565b60208082528101610f98816158a3565b60208082528101610f98816158dc565b60208082528101610f9881615915565b60208082528101610f988161595f565b60208101610f988284615998565b60408101615a298285615202565b60608101615dbd8286615202565b615dca6020830185615202565b6147bf60408301846151f9565b60405181810167ffffffffffffffff81118282101715615df657600080fd5b604052919050565b600067ffffffffffffffff821115615e1557600080fd5b5060209081020190565b60200190565b5190565b90815260200190565b6000610f9882615e59565b151590565b6000610f9882615e32565b6001600160801b031690565b6001600160a01b031690565b69ffffffffffffffffffff1690565b6000610f9882610c72565b82818337506000910152565b60005b83811015615ea6578181015183820152602001615e8e565b838111156146065750506000910152565b6000610f98826000610f9882615ed2565b601f01601f191690565b60601b90565b615ee181615e32565b81146110f957600080fd5b615ee181615e3d565b615ee181610c72565b615ee181615e42565b615ee181615e4d565b615ee181615e6556fe74c62d09fbc50aefae0794a9a068f786a692826fbdfe63828ec23a875865823fa365627a7a72315820e660e36712f8816be253d1bd96bd20e56cd9401aa5603a1e525ebe560b5951076c6578706572696d656e74616cf564736f6c63430005100040
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000de910777c787903f78c89e7a0bf7f4c435cbb1fe0000000000000000000000004e3b31eb0e5cb73641ee1e65e7dcefe520ba3ef2
-----Decoded View---------------
Arg [0] : _owner (address): 0xDe910777C787903F78C89e7a0bf7F4C435cBB1Fe
Arg [1] : _resolver (address): 0x4E3b31eB0E5CB73641EE1E65E7dCEFe520bA3ef2
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000de910777c787903f78c89e7a0bf7f4c435cbb1fe
Arg [1] : 0000000000000000000000004e3b31eb0e5cb73641ee1e65e7dcefe520ba3ef2
Libraries Used
SafeDecimalMath : 0x84d626b2bb4d0f064067e4bf80fce7055d8f3e7bSystemSettingsLib : 0x307bdce0a68c612a17bae8d929f36402d7c94cfaSignedSafeDecimalMath : 0x728a2b79cad691531cc1146ef802617ff50c7095
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 31 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.