Sepolia Testnet

Contract

0x91112d49095Febf1616af25be7f32Cf580DBC7A3

Overview

ETH Balance

0 ETH

Token Holdings

Multichain Info

N/A
Transaction Hash
Method
Block
From
To

There are no matching entries

2 Token Transfers found.

View more zero value Internal Transactions in Advanced View mode

Advanced mode:

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Depot

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 2024-03-15
*/

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

* Synthetix: Depot.sol
*
* Latest source (may be newer): https://github.com/Synthetixio/synthetix/blob/master/contracts/Depot.sol
* Docs: https://docs.synthetix.io/contracts/Depot
*
* Contract Dependencies: 
*	- IAddressResolver
*	- IDepot
*	- MixinResolver
*	- Owned
*	- Pausable
*	- ReentrancyGuard
* Libraries: 
*	- SafeDecimalMath
*	- SafeMath
*
* MIT License
* ===========
*
* Copyright (c) 2024 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);
}


// Inheritance


// https://docs.synthetix.io/contracts/source/contracts/pausable
contract Pausable is Owned {
    uint public lastPauseTime;
    bool public paused;

    constructor() internal {
        // This contract is abstract, and thus cannot be instantiated directly
        require(owner != address(0), "Owner must be set");
        // Paused will be false, and lastPauseTime will be 0 upon initialisation
    }

    /**
     * @notice Change the paused state of the contract
     * @dev Only the contract owner may call this.
     */
    function setPaused(bool _paused) external onlyOwner {
        // Ensure we're actually changing the state before we do anything
        if (_paused == paused) {
            return;
        }

        // Set our paused state.
        paused = _paused;

        // If applicable, set the last pause time.
        if (paused) {
            lastPauseTime = now;
        }

        // Let everyone know that our pause state has changed.
        emit PauseChanged(paused);
    }

    event PauseChanged(bool isPaused);

    modifier notPaused {
        require(!paused, "This action cannot be performed while the contract is paused");
        _;
    }
}


/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the `nonReentrant` modifier
 * available, which can be aplied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 */
contract ReentrancyGuard {
    /// @dev counter to allow mutex lock with only one SSTORE operation
    uint256 private _guardCounter;

    constructor () internal {
        // The counter starts at one to prevent changing it from zero to a non-zero
        // value, which is a more expensive operation.
        _guardCounter = 1;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and make it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _guardCounter += 1;
        uint256 localCounter = _guardCounter;
        _;
        require(localCounter == _guardCounter, "ReentrancyGuard: reentrant call");
    }
}


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

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

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


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

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

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

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

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

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


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

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

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

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

    function availableSynthCount() external view returns (uint);

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

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

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

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

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

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

    function issuanceRatio() external view returns (uint);

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

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

    function minimumStakeTime() external view returns (uint);

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

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

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

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

    function totalIssuedSynths(bytes32 currencyKey, bool excludeOtherCollateral) external view returns (uint);

    function transferableSynthetixAndAnyRateIsInvalid(address account, uint balance)
        external
        view
        returns (uint transferable, bool anyRateIsInvalid);

    function liquidationAmounts(address account, bool isSelfLiquidation)
        external
        view
        returns (
            uint totalRedeemed,
            uint debtToRemove,
            uint escrowToLiquidate,
            uint initialDebtBalance
        );

    // Restricted: used internally to Synthetix
    function addSynths(ISynth[] calldata synthsToAdd) external;

    function issueSynths(address from, uint amount) external;

    function issueSynthsOnBehalf(
        address issueFor,
        address from,
        uint amount
    ) external;

    function issueMaxSynths(address from) external;

    function issueMaxSynthsOnBehalf(address issueFor, address from) external;

    function burnSynths(address from, uint amount) external;

    function burnSynthsOnBehalf(
        address burnForAddress,
        address from,
        uint amount
    ) external;

    function burnSynthsToTarget(address from) external;

    function burnSynthsToTargetOnBehalf(address burnForAddress, address from) external;

    function burnForRedemption(
        address deprecatedSynthProxy,
        address account,
        uint balance
    ) external;

    function setCurrentPeriodId(uint128 periodId) external;

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

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

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

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


// 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/idepot
interface IDepot {
    // Views
    function fundsWallet() external view returns (address payable);

    function maxEthPurchase() external view returns (uint);

    function minimumDepositAmount() external view returns (uint);

    function synthsReceivedForEther(uint amount) external view returns (uint);

    function totalSellableDeposits() external view returns (uint);

    // Mutative functions
    function depositSynths(uint amount) external;

    function exchangeEtherForSynths() external payable returns (uint);

    function exchangeEtherForSynthsAtRate(uint guaranteedRate) external payable returns (uint);

    function withdrawMyDepositedSynths() external;

    // Note: On mainnet no SNX has been deposited. The following functions are kept alive for testnet SNX faucets.
    function exchangeEtherForSNX() external payable returns (uint);

    function exchangeEtherForSNXAtRate(uint guaranteedRate, uint guaranteedSynthetixRate) external payable returns (uint);

    function exchangeSynthsForSNX(uint synthAmount) external returns (uint);

    function synthetixReceivedForEther(uint amount) external view returns (uint);

    function synthetixReceivedForSynths(uint amount) external view returns (uint);

    function withdrawSynthetix(uint amount) external;
}


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

        return c;
    }

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

        return c;
    }

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

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

        return c;
    }

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

        return c;
    }

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


// Libraries


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

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

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

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

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

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

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

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

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

        return quotientTimesTen / 10;
    }

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

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

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

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

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

        return resultTimesTen / 10;
    }

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

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

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

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

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

        return quotientTimesTen / 10;
    }

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

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

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


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


pragma experimental ABIEncoderV2;

// https://docs.synthetix.io/contracts/source/interfaces/IDirectIntegration
interface IDirectIntegrationManager {
    struct ParameterIntegrationSettings {
        bytes32 currencyKey;
        address dexPriceAggregator;
        address atomicEquivalentForDexPricing;
        uint atomicExchangeFeeRate;
        uint atomicTwapWindow;
        uint atomicMaxVolumePerBlock;
        uint atomicVolatilityConsiderationWindow;
        uint atomicVolatilityUpdateThreshold;
        uint exchangeFeeRate;
        uint exchangeMaxDynamicFee;
        uint exchangeDynamicFeeRounds;
        uint exchangeDynamicFeeThreshold;
        uint exchangeDynamicFeeWeightDecay;
    }

    function getExchangeParameters(address integration, bytes32 key)
        external
        view
        returns (ParameterIntegrationSettings memory settings);

    function setExchangeParameters(
        address integration,
        bytes32[] calldata currencyKeys,
        ParameterIntegrationSettings calldata params
    ) external;
}


// 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 effectiveAtomicValueAndRates(
        IDirectIntegrationManager.ParameterIntegrationSettings calldata sourceSettings,
        uint sourceAmount,
        IDirectIntegrationManager.ParameterIntegrationSettings calldata destinationSettings,
        IDirectIntegrationManager.ParameterIntegrationSettings calldata usdSettings
    )
        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);

    function synthTooVolatileForAtomicExchange(IDirectIntegrationManager.ParameterIntegrationSettings calldata settings)
        external
        view
        returns (bool);

    function rateWithSafetyChecks(bytes32 currencyKey)
        external
        returns (
            uint rate,
            bool broken,
            bool invalid
        );
}


// Inheritance


// Libraries


// Internal references


// https://docs.synthetix.io/contracts/source/contracts/depot
contract Depot is Owned, Pausable, ReentrancyGuard, MixinResolver, IDepot {
    using SafeMath for uint;
    using SafeDecimalMath for uint;

    bytes32 internal constant SNX = "SNX";
    bytes32 internal constant ETH = "ETH";

    /* ========== STATE VARIABLES ========== */

    // Address where the ether and Synths raised for selling SNX is transfered to
    // Any ether raised for selling Synths gets sent back to whoever deposited the Synths,
    // and doesn't have anything to do with this address.
    address payable public fundsWallet;

    /* Stores deposits from users. */
    struct SynthDepositEntry {
        // The user that made the deposit
        address payable user;
        // The amount (in Synths) that they deposited
        uint amount;
    }

    /* User deposits are sold on a FIFO (First in First out) basis. When users deposit
       synths with us, they get added this queue, which then gets fulfilled in order.
       Conceptually this fits well in an array, but then when users fill an order we
       end up copying the whole array around, so better to use an index mapping instead
       for gas performance reasons.

       The indexes are specified (inclusive, exclusive), so (0, 0) means there's nothing
       in the array, and (3, 6) means there are 3 elements at 3, 4, and 5. You can obtain
       the length of the "array" by querying depositEndIndex - depositStartIndex. All index
       operations use safeAdd, so there is no way to overflow, so that means there is a
       very large but finite amount of deposits this contract can handle before it fills up. */
    mapping(uint => SynthDepositEntry) public deposits;
    // The starting index of our queue inclusive
    uint public depositStartIndex;
    // The ending index of our queue exclusive
    uint public depositEndIndex;

    /* This is a convenience variable so users and dApps can just query how much sUSD
       we have available for purchase without having to iterate the mapping with a
       O(n) amount of calls for something we'll probably want to display quite regularly. */
    uint public totalSellableDeposits;

    // The minimum amount of sUSD required to enter the FiFo queue
    uint public minimumDepositAmount = 50 * SafeDecimalMath.unit();

    // A cap on the amount of sUSD you can buy with ETH in 1 transaction
    uint public maxEthPurchase = 500 * SafeDecimalMath.unit();

    // If a user deposits a synth amount < the minimumDepositAmount the contract will keep
    // the total of small deposits which will not be sold on market and the sender
    // must call withdrawMyDepositedSynths() to get them back.
    mapping(address => uint) public smallDeposits;

    /* ========== ADDRESS RESOLVER CONFIGURATION ========== */

    bytes32 private constant CONTRACT_SYNTHSUSD = "SynthsUSD";
    bytes32 private constant CONTRACT_EXRATES = "ExchangeRates";
    bytes32 private constant CONTRACT_SYNTHETIX = "Synthetix";

    /* ========== CONSTRUCTOR ========== */

    constructor(
        address _owner,
        address payable _fundsWallet,
        address _resolver
    ) public Owned(_owner) Pausable() MixinResolver(_resolver) {
        fundsWallet = _fundsWallet;
    }

    /* ========== SETTERS ========== */

    function setMaxEthPurchase(uint _maxEthPurchase) external onlyOwner {
        maxEthPurchase = _maxEthPurchase;
        emit MaxEthPurchaseUpdated(maxEthPurchase);
    }

    /**
     * @notice Set the funds wallet where ETH raised is held
     * @param _fundsWallet The new address to forward ETH and Synths to
     */
    function setFundsWallet(address payable _fundsWallet) external onlyOwner {
        fundsWallet = _fundsWallet;
        emit FundsWalletUpdated(fundsWallet);
    }

    /**
     * @notice Set the minimum deposit amount required to depoist sUSD into the FIFO queue
     * @param _amount The new new minimum number of sUSD required to deposit
     */
    function setMinimumDepositAmount(uint _amount) external onlyOwner {
        // Do not allow us to set it less than 1 dollar opening up to fractional desposits in the queue again
        require(_amount > SafeDecimalMath.unit(), "Minimum deposit amount must be greater than UNIT");
        minimumDepositAmount = _amount;
        emit MinimumDepositAmountUpdated(minimumDepositAmount);
    }

    /* ========== MUTATIVE FUNCTIONS ========== */

    /**
     * @notice Fallback function (exchanges ETH to sUSD)
     */
    function() external payable nonReentrant rateNotInvalid(ETH) notPaused {
        _exchangeEtherForSynths();
    }

    /**
     * @notice Exchange ETH to sUSD.
     */
    /* solhint-disable multiple-sends, reentrancy */
    function exchangeEtherForSynths()
        external
        payable
        nonReentrant
        rateNotInvalid(ETH)
        notPaused
        returns (
            uint // Returns the number of Synths (sUSD) received
        )
    {
        return _exchangeEtherForSynths();
    }

    function _exchangeEtherForSynths() internal returns (uint) {
        require(msg.value <= maxEthPurchase, "ETH amount above maxEthPurchase limit");
        uint ethToSend;

        // The multiplication works here because exchangeRates().rateForCurrency(ETH) is specified in
        // 18 decimal places, just like our currency base.
        uint requestedToPurchase = msg.value.multiplyDecimal(exchangeRates().rateForCurrency(ETH));
        uint remainingToFulfill = requestedToPurchase;

        // Iterate through our outstanding deposits and sell them one at a time.
        for (uint i = depositStartIndex; remainingToFulfill > 0 && i < depositEndIndex; i++) {
            SynthDepositEntry memory deposit = deposits[i];

            // If it's an empty spot in the queue from a previous withdrawal, just skip over it and
            // update the queue. It's already been deleted.
            if (deposit.user == address(0)) {
                depositStartIndex = depositStartIndex.add(1);
            } else {
                // If the deposit can more than fill the order, we can do this
                // without touching the structure of our queue.
                if (deposit.amount > remainingToFulfill) {
                    // Ok, this deposit can fulfill the whole remainder. We don't need
                    // to change anything about our queue we can just fulfill it.
                    // Subtract the amount from our deposit and total.
                    uint newAmount = deposit.amount.sub(remainingToFulfill);
                    deposits[i] = SynthDepositEntry({user: deposit.user, amount: newAmount});

                    totalSellableDeposits = totalSellableDeposits.sub(remainingToFulfill);

                    // Transfer the ETH to the depositor. Send is used instead of transfer
                    // so a non payable contract won't block the FIFO queue on a failed
                    // ETH payable for synths transaction. The proceeds to be sent to the
                    // synthetix foundation funds wallet. This is to protect all depositors
                    // in the queue in this rare case that may occur.
                    ethToSend = remainingToFulfill.divideDecimal(exchangeRates().rateForCurrency(ETH));

                    // We need to use send here instead of transfer because transfer reverts
                    // if the recipient is a non-payable contract. Send will just tell us it
                    // failed by returning false at which point we can continue.
                    if (!deposit.user.send(ethToSend)) {
                        fundsWallet.transfer(ethToSend);
                        emit NonPayableContract(deposit.user, ethToSend);
                    } else {
                        emit ClearedDeposit(msg.sender, deposit.user, ethToSend, remainingToFulfill, i);
                    }

                    // And the Synths to the recipient.
                    // Note: Fees are calculated by the Synth contract, so when
                    //       we request a specific transfer here, the fee is
                    //       automatically deducted and sent to the fee pool.
                    synthsUSD().transfer(msg.sender, remainingToFulfill);

                    // And we have nothing left to fulfill on this order.
                    remainingToFulfill = 0;
                } else if (deposit.amount <= remainingToFulfill) {
                    // We need to fulfill this one in its entirety and kick it out of the queue.
                    // Start by kicking it out of the queue.
                    // Free the storage because we can.
                    delete deposits[i];
                    // Bump our start index forward one.
                    depositStartIndex = depositStartIndex.add(1);
                    // We also need to tell our total it's decreased
                    totalSellableDeposits = totalSellableDeposits.sub(deposit.amount);

                    // Now fulfill by transfering the ETH to the depositor. Send is used instead of transfer
                    // so a non payable contract won't block the FIFO queue on a failed
                    // ETH payable for synths transaction. The proceeds to be sent to the
                    // synthetix foundation funds wallet. This is to protect all depositors
                    // in the queue in this rare case that may occur.
                    ethToSend = deposit.amount.divideDecimal(exchangeRates().rateForCurrency(ETH));

                    // We need to use send here instead of transfer because transfer reverts
                    // if the recipient is a non-payable contract. Send will just tell us it
                    // failed by returning false at which point we can continue.
                    if (!deposit.user.send(ethToSend)) {
                        fundsWallet.transfer(ethToSend);
                        emit NonPayableContract(deposit.user, ethToSend);
                    } else {
                        emit ClearedDeposit(msg.sender, deposit.user, ethToSend, deposit.amount, i);
                    }

                    // And the Synths to the recipient.
                    // Note: Fees are calculated by the Synth contract, so when
                    //       we request a specific transfer here, the fee is
                    //       automatically deducted and sent to the fee pool.
                    synthsUSD().transfer(msg.sender, deposit.amount);

                    // And subtract the order from our outstanding amount remaining
                    // for the next iteration of the loop.
                    remainingToFulfill = remainingToFulfill.sub(deposit.amount);
                }
            }
        }

        // Ok, if we're here and 'remainingToFulfill' isn't zero, then
        // we need to refund the remainder of their ETH back to them.
        if (remainingToFulfill > 0) {
            msg.sender.transfer(remainingToFulfill.divideDecimal(exchangeRates().rateForCurrency(ETH)));
        }

        // How many did we actually give them?
        uint fulfilled = requestedToPurchase.sub(remainingToFulfill);

        if (fulfilled > 0) {
            // Now tell everyone that we gave them that many (only if the amount is greater than 0).
            emit Exchange("ETH", msg.value, "sUSD", fulfilled);
        }

        return fulfilled;
    }

    /* solhint-enable multiple-sends, reentrancy */

    /**
     * @notice Exchange ETH to sUSD while insisting on a particular rate. This allows a user to
     *         exchange while protecting against frontrunning by the contract owner on the exchange rate.
     * @param guaranteedRate The exchange rate (ether price) which must be honored or the call will revert.
     */
    function exchangeEtherForSynthsAtRate(uint guaranteedRate)
        external
        payable
        rateNotInvalid(ETH)
        notPaused
        returns (
            uint // Returns the number of Synths (sUSD) received
        )
    {
        require(guaranteedRate == exchangeRates().rateForCurrency(ETH), "Guaranteed rate would not be received");

        return _exchangeEtherForSynths();
    }

    function _exchangeEtherForSNX() internal returns (uint) {
        // How many SNX are they going to be receiving?
        uint synthetixToSend = synthetixReceivedForEther(msg.value);

        // Store the ETH in our funds wallet
        fundsWallet.transfer(msg.value);

        // And send them the SNX.
        synthetix().transfer(msg.sender, synthetixToSend);

        emit Exchange("ETH", msg.value, "SNX", synthetixToSend);

        return synthetixToSend;
    }

    /**
     * @notice Exchange ETH to SNX.
     */
    function exchangeEtherForSNX()
        external
        payable
        rateNotInvalid(SNX)
        rateNotInvalid(ETH)
        notPaused
        returns (
            uint // Returns the number of SNX received
        )
    {
        return _exchangeEtherForSNX();
    }

    /**
     * @notice Exchange ETH to SNX while insisting on a particular set of rates. This allows a user to
     *         exchange while protecting against frontrunning by the contract owner on the exchange rates.
     * @param guaranteedEtherRate The ether exchange rate which must be honored or the call will revert.
     * @param guaranteedSynthetixRate The synthetix exchange rate which must be honored or the call will revert.
     */
    function exchangeEtherForSNXAtRate(uint guaranteedEtherRate, uint guaranteedSynthetixRate)
        external
        payable
        rateNotInvalid(SNX)
        rateNotInvalid(ETH)
        notPaused
        returns (
            uint // Returns the number of SNX received
        )
    {
        require(guaranteedEtherRate == exchangeRates().rateForCurrency(ETH), "Guaranteed ether rate would not be received");
        require(
            guaranteedSynthetixRate == exchangeRates().rateForCurrency(SNX),
            "Guaranteed synthetix rate would not be received"
        );

        return _exchangeEtherForSNX();
    }

    function _exchangeSynthsForSNX(uint synthAmount) internal returns (uint) {
        // How many SNX are they going to be receiving?
        uint synthetixToSend = synthetixReceivedForSynths(synthAmount);

        // Ok, transfer the Synths to our funds wallet.
        // These do not go in the deposit queue as they aren't for sale as such unless
        // they're sent back in from the funds wallet.
        synthsUSD().transferFrom(msg.sender, fundsWallet, synthAmount);

        // And send them the SNX.
        synthetix().transfer(msg.sender, synthetixToSend);

        emit Exchange("sUSD", synthAmount, "SNX", synthetixToSend);

        return synthetixToSend;
    }

    /**
     * @notice Exchange sUSD for SNX
     * @param synthAmount The amount of synths the user wishes to exchange.
     */
    function exchangeSynthsForSNX(uint synthAmount)
        external
        rateNotInvalid(SNX)
        notPaused
        returns (
            uint // Returns the number of SNX received
        )
    {
        return _exchangeSynthsForSNX(synthAmount);
    }

    /**
     * @notice Exchange sUSD for SNX while insisting on a particular rate. This allows a user to
     *         exchange while protecting against frontrunning by the contract owner on the exchange rate.
     * @param synthAmount The amount of synths the user wishes to exchange.
     * @param guaranteedRate A rate (synthetix price) the caller wishes to insist upon.
     */
    function exchangeSynthsForSNXAtRate(uint synthAmount, uint guaranteedRate)
        external
        rateNotInvalid(SNX)
        notPaused
        returns (
            uint // Returns the number of SNX received
        )
    {
        require(guaranteedRate == exchangeRates().rateForCurrency(SNX), "Guaranteed rate would not be received");

        return _exchangeSynthsForSNX(synthAmount);
    }

    /**
     * @notice Allows the owner to withdraw SNX from this contract if needed.
     * @param amount The amount of SNX to attempt to withdraw (in 18 decimal places).
     */
    function withdrawSynthetix(uint amount) external onlyOwner {
        synthetix().transfer(owner, amount);

        // We don't emit our own events here because we assume that anyone
        // who wants to watch what the Depot is doing can
        // just watch ERC20 events from the Synth and/or Synthetix contracts
        // filtered to our address.
    }

    /**
     * @notice Allows a user to withdraw all of their previously deposited synths from this contract if needed.
     *         Developer note: We could keep an index of address to deposits to make this operation more efficient
     *         but then all the other operations on the queue become less efficient. It's expected that this
     *         function will be very rarely used, so placing the inefficiency here is intentional. The usual
     *         use case does not involve a withdrawal.
     */
    function withdrawMyDepositedSynths() external {
        uint synthsToSend = 0;

        for (uint i = depositStartIndex; i < depositEndIndex; i++) {
            SynthDepositEntry memory deposit = deposits[i];

            if (deposit.user == msg.sender) {
                // The user is withdrawing this deposit. Remove it from our queue.
                // We'll just leave a gap, which the purchasing logic can walk past.
                synthsToSend = synthsToSend.add(deposit.amount);
                delete deposits[i];
                //Let the DApps know we've removed this deposit
                emit SynthDepositRemoved(deposit.user, deposit.amount, i);
            }
        }

        // Update our total
        totalSellableDeposits = totalSellableDeposits.sub(synthsToSend);

        // Check if the user has tried to send deposit amounts < the minimumDepositAmount to the FIFO
        // queue which would have been added to this mapping for withdrawal only
        synthsToSend = synthsToSend.add(smallDeposits[msg.sender]);
        smallDeposits[msg.sender] = 0;

        // If there's nothing to do then go ahead and revert the transaction
        require(synthsToSend > 0, "You have no deposits to withdraw.");

        // Send their deposits back to them (minus fees)
        synthsUSD().transfer(msg.sender, synthsToSend);

        emit SynthWithdrawal(msg.sender, synthsToSend);
    }

    /**
     * @notice depositSynths: Allows users to deposit synths via the approve / transferFrom workflow
     * @param amount The amount of sUSD you wish to deposit (must have been approved first)
     */
    function depositSynths(uint amount) external {
        // Grab the amount of synths. Will fail if not approved first
        synthsUSD().transferFrom(msg.sender, address(this), amount);

        // A minimum deposit amount is designed to protect purchasers from over paying
        // gas for fullfilling multiple small synth deposits
        if (amount < minimumDepositAmount) {
            // We cant fail/revert the transaction or send the synths back in a reentrant call.
            // So we will keep your synths balance seperate from the FIFO queue so you can withdraw them
            smallDeposits[msg.sender] = smallDeposits[msg.sender].add(amount);

            emit SynthDepositNotAccepted(msg.sender, amount, minimumDepositAmount);
        } else {
            // Ok, thanks for the deposit, let's queue it up.
            deposits[depositEndIndex] = SynthDepositEntry({user: msg.sender, amount: amount});
            emit SynthDeposit(msg.sender, amount, depositEndIndex);

            // Walk our index forward as well.
            depositEndIndex = depositEndIndex.add(1);

            // And add it to our total.
            totalSellableDeposits = totalSellableDeposits.add(amount);
        }
    }

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

    function resolverAddressesRequired() public view returns (bytes32[] memory addresses) {
        addresses = new bytes32[](3);
        addresses[0] = CONTRACT_SYNTHSUSD;
        addresses[1] = CONTRACT_EXRATES;
        addresses[2] = CONTRACT_SYNTHETIX;
    }

    /**
     * @notice Calculate how many SNX you will receive if you transfer
     *         an amount of synths.
     * @param amount The amount of synths (in 18 decimal places) you want to ask about
     */
    function synthetixReceivedForSynths(uint amount) public view returns (uint) {
        // And what would that be worth in SNX based on the current price?
        return amount.divideDecimal(exchangeRates().rateForCurrency(SNX));
    }

    /**
     * @notice Calculate how many SNX you will receive if you transfer
     *         an amount of ether.
     * @param amount The amount of ether (in wei) you want to ask about
     */
    function synthetixReceivedForEther(uint amount) public view returns (uint) {
        // How much is the ETH they sent us worth in sUSD (ignoring the transfer fee)?
        uint valueSentInSynths = amount.multiplyDecimal(exchangeRates().rateForCurrency(ETH));

        // Now, how many SNX will that USD amount buy?
        return synthetixReceivedForSynths(valueSentInSynths);
    }

    /**
     * @notice Calculate how many synths you will receive if you transfer
     *         an amount of ether.
     * @param amount The amount of ether (in wei) you want to ask about
     */
    function synthsReceivedForEther(uint amount) public view returns (uint) {
        // How many synths would that amount of ether be worth?
        return amount.multiplyDecimal(exchangeRates().rateForCurrency(ETH));
    }

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

    function synthsUSD() internal view returns (IERC20) {
        return IERC20(requireAndGetAddress(CONTRACT_SYNTHSUSD));
    }

    function synthetix() internal view returns (IERC20) {
        return IERC20(requireAndGetAddress(CONTRACT_SYNTHETIX));
    }

    function exchangeRates() internal view returns (IExchangeRates) {
        return IExchangeRates(requireAndGetAddress(CONTRACT_EXRATES));
    }

    // ========== MODIFIERS ==========

    modifier rateNotInvalid(bytes32 currencyKey) {
        require(!exchangeRates().rateIsInvalid(currencyKey), "Rate invalid or not a synth");
        _;
    }

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

    event MaxEthPurchaseUpdated(uint amount);
    event FundsWalletUpdated(address newFundsWallet);
    event Exchange(string fromCurrency, uint fromAmount, string toCurrency, uint toAmount);
    event SynthWithdrawal(address user, uint amount);
    event SynthDeposit(address indexed user, uint amount, uint indexed depositIndex);
    event SynthDepositRemoved(address indexed user, uint amount, uint indexed depositIndex);
    event SynthDepositNotAccepted(address user, uint amount, uint minimum);
    event MinimumDepositAmountUpdated(uint amount);
    event NonPayableContract(address indexed receiver, uint amount);
    event ClearedDeposit(
        address indexed fromAddress,
        address indexed toAddress,
        uint fromETHAmount,
        uint toAmount,
        uint indexed depositIndex
    );
}

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address payable","name":"_fundsWallet","type":"address"},{"internalType":"address","name":"_resolver","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"name","type":"bytes32"},{"indexed":false,"internalType":"address","name":"destination","type":"address"}],"name":"CacheUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"fromAddress","type":"address"},{"indexed":true,"internalType":"address","name":"toAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"fromETHAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toAmount","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"depositIndex","type":"uint256"}],"name":"ClearedDeposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"fromCurrency","type":"string"},{"indexed":false,"internalType":"uint256","name":"fromAmount","type":"uint256"},{"indexed":false,"internalType":"string","name":"toCurrency","type":"string"},{"indexed":false,"internalType":"uint256","name":"toAmount","type":"uint256"}],"name":"Exchange","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newFundsWallet","type":"address"}],"name":"FundsWalletUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"MaxEthPurchaseUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"MinimumDepositAmountUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"NonPayableContract","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":"bool","name":"isPaused","type":"bool"}],"name":"PauseChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"depositIndex","type":"uint256"}],"name":"SynthDeposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"minimum","type":"uint256"}],"name":"SynthDepositNotAccepted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"depositIndex","type":"uint256"}],"name":"SynthDepositRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"SynthWithdrawal","type":"event"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"constant":false,"inputs":[],"name":"acceptOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"depositEndIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"depositStartIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"depositSynths","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"deposits","outputs":[{"internalType":"address payable","name":"user","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"exchangeEtherForSNX","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"guaranteedEtherRate","type":"uint256"},{"internalType":"uint256","name":"guaranteedSynthetixRate","type":"uint256"}],"name":"exchangeEtherForSNXAtRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[],"name":"exchangeEtherForSynths","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"guaranteedRate","type":"uint256"}],"name":"exchangeEtherForSynthsAtRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"synthAmount","type":"uint256"}],"name":"exchangeSynthsForSNX","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"synthAmount","type":"uint256"},{"internalType":"uint256","name":"guaranteedRate","type":"uint256"}],"name":"exchangeSynthsForSNXAtRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"fundsWallet","outputs":[{"internalType":"address payable","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":"lastPauseTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"maxEthPurchase","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"minimumDepositAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"nominateNewOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"nominatedOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"rebuildCache","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"resolver","outputs":[{"internalType":"contract AddressResolver","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"resolverAddressesRequired","outputs":[{"internalType":"bytes32[]","name":"addresses","type":"bytes32[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address payable","name":"_fundsWallet","type":"address"}],"name":"setFundsWallet","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"_maxEthPurchase","type":"uint256"}],"name":"setMaxEthPurchase","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"setMinimumDepositAmount","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bool","name":"_paused","type":"bool"}],"name":"setPaused","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"smallDeposits","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"synthetixReceivedForEther","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"synthetixReceivedForSynths","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"synthsReceivedForEther","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalSellableDeposits","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"withdrawMyDepositedSynths","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawSynthetix","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"}]

60806040819052630241ebdb60e61b8152739d6d846d4546614a7e668e66886624c0ae21d7869063907af6c09060849060209060048186803b1580156200004557600080fd5b505af41580156200005a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250620000809190810190620002a4565b603202600c55739d6d846d4546614a7e668e66886624c0ae21d78663907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b158015620000cb57600080fd5b505af4158015620000e0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250620001069190810190620002a4565b6101f402600d553480156200011a57600080fd5b506040516200379a3803806200379a8339810160408190526200013d9162000250565b80836001600160a01b038116620001715760405162461bcd60e51b815260040162000168906200038b565b60405180910390fd5b600080546001600160a01b0319166001600160a01b0383161781556040517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c91620001be91849062000353565b60405180910390a1506000546001600160a01b0316620001f25760405162461bcd60e51b8152600401620001689062000379565b6001600455600580546001600160a01b039283166001600160a01b031991821617909155600780549490921693169290921790915550620003f49050565b80516200023d81620003cf565b92915050565b80516200023d81620003e9565b6000806000606084860312156200026657600080fd5b600062000274868662000230565b9350506020620002878682870162000230565b92505060406200029a8682870162000230565b9150509250925092565b600060208284031215620002b757600080fd5b6000620002c5848462000243565b949350505050565b620002d881620003bb565b82525050565b620002d881620003a6565b6000620002f86011836200039d565b7013dddb995c881b5d5cdd081899481cd95d607a1b815260200192915050565b6000620003276019836200039d565b7f4f776e657220616464726573732063616e6e6f74206265203000000000000000815260200192915050565b60408101620003638285620002cd565b620003726020830184620002de565b9392505050565b602080825281016200023d81620002e9565b602080825281016200023d8162000318565b90815260200190565b60006001600160a01b0382166200023d565b90565b60006200023d8260006200023d82620003a6565b620003da81620003a6565b8114620003e657600080fd5b50565b620003da81620003b8565b61339680620004046000396000f3fe6080604052600436106101f95760003560e01c806381b797dc1161010d578063b0c2cb96116100a0578063c8d889f21161006f578063c8d889f214610610578063dc8fa6c214610630578063e6d76a7614610650578063f852d39314610670578063fd12167f14610690576101f9565b8063b0c2cb961461059b578063b1338cc4146105bb578063bb7df172146105d0578063c6abb7c7146105f0576101f9565b80639342c0eb116100dc5780639342c0eb1461051a578063a3d8829b1461052d578063aab483d61461054d578063b02c43d01461056d576101f9565b806381b797dc146104b9578063899ffef4146104ce5780638da5cb5b146104f057806391b4ded914610505576101f9565b80632194f3a2116101905780635c975abb1161015f5780635c975abb1461044557806364e39b871461045a5780636d5ab4a91461047a578063741853601461048f57806379ba5097146104a4576101f9565b80632194f3a2146103d75780632af64bd3146103f95780634d0387fb1461041b57806353a47bb714610430576101f9565b80630c928f05116101cc5780630c928f051461036d5780631627540c1461038d57806316c38b3c146103af5780631f930115146103cf576101f9565b8063022794381461030557806304f3bcec14610323578063080c279a146103455780630c928bc21461035a575b60048054600101908190556208aa8960eb1b6102136106a5565b6001600160a01b0316632528f0fe826040518263ffffffff1660e01b815260040161023e91906130d5565b60206040518083038186803b15801561025657600080fd5b505afa15801561026a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061028e919081019061297f565b156102b45760405162461bcd60e51b81526004016102ab906131ef565b60405180910390fd5b60035460ff16156102d75760405162461bcd60e51b81526004016102ab9061326f565b6102df6106c6565b505060045481146103025760405162461bcd60e51b81526004016102ab9061328f565b50005b61030d610e8f565b60405161031a91906130d5565b60405180910390f35b34801561032f57600080fd5b50610338611011565b60405161031a9190613111565b34801561035157600080fd5b5061030d611020565b61030d61036836600461299d565b611026565b34801561037957600080fd5b5061030d61038836600461299d565b6111a8565b34801561039957600080fd5b506103ad6103a8366004612925565b611249565b005b3480156103bb57600080fd5b506103ad6103ca366004612961565b6112a7565b61030d61131c565b3480156103e357600080fd5b506103ec611424565b60405161031a9190613013565b34801561040557600080fd5b5061040e611433565b60405161031a91906130c7565b34801561042757600080fd5b5061030d61154a565b34801561043c57600080fd5b506103ec611550565b34801561045157600080fd5b5061040e61155f565b34801561046657600080fd5b506103ad610475366004612925565b611568565b34801561048657600080fd5b5061030d6115c1565b34801561049b57600080fd5b506103ad6115c7565b3480156104b057600080fd5b506103ad61171d565b3480156104c557600080fd5b506103ad6117b9565b3480156104da57600080fd5b506104e36119c2565b60405161031a91906130b6565b3480156104fc57600080fd5b506103ec611a5d565b34801561051157600080fd5b5061030d611a6c565b61030d6105283660046129d9565b611a72565b34801561053957600080fd5b5061030d61054836600461299d565b611d44565b34801561055957600080fd5b506103ad61056836600461299d565b611ddf565b34801561057957600080fd5b5061058d61058836600461299d565b611eb6565b60405161031a929190613057565b3480156105a757600080fd5b5061030d6105b63660046129d9565b611edb565b3480156105c757600080fd5b5061030d61205f565b3480156105dc57600080fd5b506103ad6105eb36600461299d565b612065565b3480156105fc57600080fd5b5061030d61060b366004612925565b6120a2565b34801561061c57600080fd5b5061030d61062b36600461299d565b6120b4565b34801561063c57600080fd5b506103ad61064b36600461299d565b61215b565b34801561065c57600080fd5b506103ad61066b36600461299d565b61231b565b34801561067c57600080fd5b5061030d61068b36600461299d565b6123b0565b34801561069c57600080fd5b5061030d612485565b60006106c06c45786368616e6765526174657360981b61248b565b90505b90565b6000600d543411156106ea5760405162461bcd60e51b81526004016102ab9061320f565b6000806107866106f86106a5565b6001600160a01b031663ac82f6086208aa8960eb1b6040518263ffffffff1660e01b815260040161072991906130d5565b60206040518083038186803b15801561074157600080fd5b505afa158015610755573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061077991908101906129bb565b349063ffffffff6124ef16565b60095490915081905b6000821180156107a05750600a5481105b15610d65576107ad6128cc565b50600081815260086020908152604091829020825180840190935280546001600160a01b031680845260019091015491830191909152610803576009546107fb90600163ffffffff61251916565b600955610d5c565b8281602001511115610ab2576020810151600090610827908563ffffffff61253e16565b60408051808201825284516001600160a01b039081168252602080830185815260008981526008909252939020915182546001600160a01b03191691161781559051600190910155600b5490915061087f908561253e565b600b5561091b61088d6106a5565b6001600160a01b031663ac82f6086208aa8960eb1b6040518263ffffffff1660e01b81526004016108be91906130d5565b60206040518083038186803b1580156108d657600080fd5b505afa1580156108ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061090e91908101906129bb565b859063ffffffff61256616565b82516040519197506001600160a01b03169087156108fc029088906000818181858888f193505050506109cd576007546040516001600160a01b039091169087156108fc029088906000818181858888f19350505050158015610982573d6000803e3d6000fd5b5081600001516001600160a01b03167ff2435d3901399daa085f8b58d2409fff9b83ce4ca97c1f144b532f5a08b1c96c876040516109c091906130d5565b60405180910390a2610a20565b8282600001516001600160a01b0316336001600160a01b03167f6d957e9e816107f67cb7118461e3c259e96896f80223c9af2972596c2fdd401c8988604051610a1792919061329f565b60405180910390a45b610a28612590565b6001600160a01b031663a9059cbb33866040518363ffffffff1660e01b8152600401610a55929190613072565b602060405180830381600087803b158015610a6f57600080fd5b505af1158015610a83573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610aa7919081019061297f565b506000935050610d5c565b82816020015111610d5c57600082815260086020526040812080546001600160a01b0319168155600190810191909155600954610af49163ffffffff61251916565b6009556020810151600b54610b0e9163ffffffff61253e16565b600b55610bae610b1c6106a5565b6001600160a01b031663ac82f6086208aa8960eb1b6040518263ffffffff1660e01b8152600401610b4d91906130d5565b60206040518083038186803b158015610b6557600080fd5b505afa158015610b79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610b9d91908101906129bb565b60208301519063ffffffff61256616565b81516040519196506001600160a01b03169086156108fc029087906000818181858888f19350505050610c60576007546040516001600160a01b039091169086156108fc029087906000818181858888f19350505050158015610c15573d6000803e3d6000fd5b5080600001516001600160a01b03167ff2435d3901399daa085f8b58d2409fff9b83ce4ca97c1f144b532f5a08b1c96c86604051610c5391906130d5565b60405180910390a2610cb7565b8181600001516001600160a01b0316336001600160a01b03167f6d957e9e816107f67cb7118461e3c259e96896f80223c9af2972596c2fdd401c888560200151604051610cae92919061329f565b60405180910390a45b610cbf612590565b6001600160a01b031663a9059cbb3383602001516040518363ffffffff1660e01b8152600401610cf0929190613072565b602060405180830381600087803b158015610d0a57600080fd5b505af1158015610d1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610d42919081019061297f565b506020810151610d5990849063ffffffff61253e16565b92505b5060010161078f565b508015610e3357336108fc610e09610d7b6106a5565b6001600160a01b031663ac82f6086208aa8960eb1b6040518263ffffffff1660e01b8152600401610dac91906130d5565b60206040518083038186803b158015610dc457600080fd5b505afa158015610dd8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610dfc91908101906129bb565b849063ffffffff61256616565b6040518115909202916000818181858888f19350505050158015610e31573d6000803e3d6000fd5b505b6000610e45838363ffffffff61253e16565b90508015610e87577fdb1741ffc6844b04a9284bb6337fb0ccfe543a493ef0ac8e725242201e93d4bd3482604051610e7e92919061322f565b60405180910390a15b935050505090565b6000620a69cb60eb1b610ea06106a5565b6001600160a01b0316632528f0fe826040518263ffffffff1660e01b8152600401610ecb91906130d5565b60206040518083038186803b158015610ee357600080fd5b505afa158015610ef7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610f1b919081019061297f565b15610f385760405162461bcd60e51b81526004016102ab906131ef565b6208aa8960eb1b610f476106a5565b6001600160a01b0316632528f0fe826040518263ffffffff1660e01b8152600401610f7291906130d5565b60206040518083038186803b158015610f8a57600080fd5b505afa158015610f9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610fc2919081019061297f565b15610fdf5760405162461bcd60e51b81526004016102ab906131ef565b60035460ff16156110025760405162461bcd60e51b81526004016102ab9061326f565b61100a6125a7565b9250505090565b6005546001600160a01b031681565b600c5481565b60006208aa8960eb1b6110376106a5565b6001600160a01b0316632528f0fe826040518263ffffffff1660e01b815260040161106291906130d5565b60206040518083038186803b15801561107a57600080fd5b505afa15801561108e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506110b2919081019061297f565b156110cf5760405162461bcd60e51b81526004016102ab906131ef565b60035460ff16156110f25760405162461bcd60e51b81526004016102ab9061326f565b6110fa6106a5565b6001600160a01b031663ac82f6086208aa8960eb1b6040518263ffffffff1660e01b815260040161112b91906130d5565b60206040518083038186803b15801561114357600080fd5b505afa158015611157573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061117b91908101906129bb565b83146111995760405162461bcd60e51b81526004016102ab9061327f565b6111a16106c6565b9392505050565b60006112436111b56106a5565b6001600160a01b031663ac82f6086208aa8960eb1b6040518263ffffffff1660e01b81526004016111e691906130d5565b60206040518083038186803b1580156111fe57600080fd5b505afa158015611212573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061123691908101906129bb565b839063ffffffff6124ef16565b92915050565b6112516126b4565b600180546001600160a01b0319166001600160a01b0383161790556040517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce229061129c908390613013565b60405180910390a150565b6112af6126b4565b60035460ff16151581151514156112c557611319565b6003805460ff1916821515179081905560ff16156112e257426002555b6003546040517f8fb6c181ee25a520cf3dd6565006ef91229fcfe5a989566c2a3b8c115570cec59161129c9160ff909116906130c7565b50565b60048054600101908190556000906208aa8960eb1b6113396106a5565b6001600160a01b0316632528f0fe826040518263ffffffff1660e01b815260040161136491906130d5565b60206040518083038186803b15801561137c57600080fd5b505afa158015611390573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506113b4919081019061297f565b156113d15760405162461bcd60e51b81526004016102ab906131ef565b60035460ff16156113f45760405162461bcd60e51b81526004016102ab9061326f565b6113fc6106c6565b92505060045481146114205760405162461bcd60e51b81526004016102ab9061328f565b5090565b6007546001600160a01b031681565b6000606061143f6119c2565b905060005b815181101561154157600082828151811061145b57fe5b602090810291909101810151600081815260069092526040918290205460055492516321f8a72160e01b81529193506001600160a01b039081169216906321f8a721906114ac9085906004016130d5565b60206040518083038186803b1580156114c457600080fd5b505afa1580156114d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506114fc9190810190612943565b6001600160a01b031614158061152757506000818152600660205260409020546001600160a01b0316155b1561153857600093505050506106c3565b50600101611444565b50600191505090565b600b5481565b6001546001600160a01b031681565b60035460ff1681565b6115706126b4565b600780546001600160a01b0319166001600160a01b0383811691909117918290556040517f4deb077bf9c4bc824cc2c989e01a5e53b0a4ecc44c5039d46abc9ffc88f8a0509261129c921690613021565b60095481565b60606115d16119c2565b905060005b81518110156117195760008282815181106115ed57fe5b602002602001015190506000600560009054906101000a90046001600160a01b03166001600160a01b031663dacb2d01838460405160200161162f9190613008565b6040516020818303038152906040526040518363ffffffff1660e01b815260040161165b9291906130f1565b60206040518083038186803b15801561167357600080fd5b505afa158015611687573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506116ab9190810190612943565b6000838152600660205260409081902080546001600160a01b0319166001600160a01b038416179055519091507f88a93678a3692f6789d9546fc621bf7234b101ddb7d4fe479455112831b8aa689061170790849084906130e3565b60405180910390a150506001016115d6565b5050565b6001546001600160a01b031633146117475760405162461bcd60e51b81526004016102ab90613140565b6000546001546040517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9261178a926001600160a01b039182169291169061309b565b60405180910390a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b6009546000905b600a548110156118a2576117d26128cc565b50600081815260086020908152604091829020825180840190935280546001600160a01b03168084526001909101549183019190915233141561189957602081015161182590849063ffffffff61251916565b600083815260086020908152604080832080546001600160a01b031916815560010192909255835190840151915192955084926001600160a01b03909116917f3aa2b18eace5e5727a4ab525921b9b0a1ca1afdb0f96b599e3ab2d76cb5e7f729161189091906130d5565b60405180910390a35b506001016117c0565b50600b546118b6908263ffffffff61253e16565b600b55336000908152600e60205260409020546118da90829063ffffffff61251916565b336000908152600e60205260408120559050806119095760405162461bcd60e51b81526004016102ab90613190565b611911612590565b6001600160a01b031663a9059cbb33836040518363ffffffff1660e01b815260040161193e929190613072565b602060405180830381600087803b15801561195857600080fd5b505af115801561196c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611990919081019061297f565b507faf6ec623f558c7b3527ff6c9c09432c7d81a3d38bd2e1eaaee2efe7aac23c28b338260405161129c929190613072565b604080516003808252608082019092526060916020820183803883390190505090506814de5b9d1a1cd554d160ba1b816000815181106119fe57fe5b6020026020010181815250506c45786368616e6765526174657360981b81600181518110611a2857fe5b602002602001018181525050680a6f2dce8d0cae8d2f60bb1b81600281518110611a4e57fe5b60200260200101818152505090565b6000546001600160a01b031681565b60025481565b6000620a69cb60eb1b611a836106a5565b6001600160a01b0316632528f0fe826040518263ffffffff1660e01b8152600401611aae91906130d5565b60206040518083038186803b158015611ac657600080fd5b505afa158015611ada573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611afe919081019061297f565b15611b1b5760405162461bcd60e51b81526004016102ab906131ef565b6208aa8960eb1b611b2a6106a5565b6001600160a01b0316632528f0fe826040518263ffffffff1660e01b8152600401611b5591906130d5565b60206040518083038186803b158015611b6d57600080fd5b505afa158015611b81573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611ba5919081019061297f565b15611bc25760405162461bcd60e51b81526004016102ab906131ef565b60035460ff1615611be55760405162461bcd60e51b81526004016102ab9061326f565b611bed6106a5565b6001600160a01b031663ac82f6086208aa8960eb1b6040518263ffffffff1660e01b8152600401611c1e91906130d5565b60206040518083038186803b158015611c3657600080fd5b505afa158015611c4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611c6e91908101906129bb565b8514611c8c5760405162461bcd60e51b81526004016102ab90613130565b611c946106a5565b6001600160a01b031663ac82f608620a69cb60eb1b6040518263ffffffff1660e01b8152600401611cc591906130d5565b60206040518083038186803b158015611cdd57600080fd5b505afa158015611cf1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611d1591908101906129bb565b8414611d335760405162461bcd60e51b81526004016102ab90613150565b611d3b6125a7565b95945050505050565b6000611243611d516106a5565b6001600160a01b031663ac82f608620a69cb60eb1b6040518263ffffffff1660e01b8152600401611d8291906130d5565b60206040518083038186803b158015611d9a57600080fd5b505afa158015611dae573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611dd291908101906129bb565b839063ffffffff61256616565b611de76126b4565b739d6d846d4546614a7e668e66886624c0ae21d78663907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b158015611e2b57600080fd5b505af4158015611e3f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611e6391908101906129bb565b8111611e815760405162461bcd60e51b81526004016102ab9061321f565b600c8190556040517fa39eacd162ee82c70b2b030a1bc8fe89adcccc61122fad4821a8772dbcc542679061129c9083906130d5565b600860205260009081526040902080546001909101546001600160a01b039091169082565b6000620a69cb60eb1b611eec6106a5565b6001600160a01b0316632528f0fe826040518263ffffffff1660e01b8152600401611f1791906130d5565b60206040518083038186803b158015611f2f57600080fd5b505afa158015611f43573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611f67919081019061297f565b15611f845760405162461bcd60e51b81526004016102ab906131ef565b60035460ff1615611fa75760405162461bcd60e51b81526004016102ab9061326f565b611faf6106a5565b6001600160a01b031663ac82f608620a69cb60eb1b6040518263ffffffff1660e01b8152600401611fe091906130d5565b60206040518083038186803b158015611ff857600080fd5b505afa15801561200c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061203091908101906129bb565b831461204e5760405162461bcd60e51b81526004016102ab9061327f565b612057846126e0565b949350505050565b600d5481565b61206d6126b4565b600d8190556040517fdc2be810a133e01cb21a41082f15b2863d96f9fe79d1f84d7e2d5b810c5c82439061129c9083906130d5565b600e6020526000908152604090205481565b6000806121506120c26106a5565b6001600160a01b031663ac82f6086208aa8960eb1b6040518263ffffffff1660e01b81526004016120f391906130d5565b60206040518083038186803b15801561210b57600080fd5b505afa15801561211f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061214391908101906129bb565b849063ffffffff6124ef16565b90506111a181611d44565b612163612590565b6001600160a01b03166323b872dd3330846040518463ffffffff1660e01b81526004016121929392919061302f565b602060405180830381600087803b1580156121ac57600080fd5b505af11580156121c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506121e4919081019061297f565b50600c5481101561226557336000908152600e602052604090205461220f908263ffffffff61251916565b336000818152600e60205260409081902092909255600c5491517fbc3a12638d840d60760c64b39c73985a6498cf6eb8176f124995b0e07236cbd2926122589291859190613080565b60405180910390a1611319565b604080518082018252338082526020808301858152600a80546000908152600890935291859020935184546001600160a01b0319166001600160a01b0390911617845551600190930192909255905491517fd9acabe6e09d178728ba5c366661c5be0621b4770f216305b059ec175b37e0b4906122e39085906130d5565b60405180910390a3600a546122ff90600163ffffffff61251916565b600a55600b54612315908263ffffffff61251916565b600b5550565b6123236126b4565b61232b612846565b60005460405163a9059cbb60e01b81526001600160a01b039283169263a9059cbb9261235e929116908590600401613057565b602060405180830381600087803b15801561237857600080fd5b505af115801561238c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611719919081019061297f565b6000620a69cb60eb1b6123c16106a5565b6001600160a01b0316632528f0fe826040518263ffffffff1660e01b81526004016123ec91906130d5565b60206040518083038186803b15801561240457600080fd5b505afa158015612418573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061243c919081019061297f565b156124595760405162461bcd60e51b81526004016102ab906131ef565b60035460ff161561247c5760405162461bcd60e51b81526004016102ab9061326f565b6111a1836126e0565b600a5481565b60008181526006602090815260408083205490516001600160a01b0390911691821515916124bb91869101612fe8565b604051602081830303815290604052906124e85760405162461bcd60e51b81526004016102ab919061311f565b5092915050565b6000670de0b6b3a764000061250a848463ffffffff61285d16565b8161251157fe5b049392505050565b6000828201838110156111a15760405162461bcd60e51b81526004016102ab90613160565b6000828211156125605760405162461bcd60e51b81526004016102ab90613170565b50900390565b60006111a18261258485670de0b6b3a764000063ffffffff61285d16565b9063ffffffff61289716565b60006106c06814de5b9d1a1cd554d160ba1b61248b565b6000806125b3346120b4565b6007546040519192506001600160a01b0316903480156108fc02916000818181858888f193505050501580156125ed573d6000803e3d6000fd5b506125f6612846565b6001600160a01b031663a9059cbb33836040518363ffffffff1660e01b8152600401612623929190613072565b602060405180830381600087803b15801561263d57600080fd5b505af1158015612651573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250612675919081019061297f565b507fdb1741ffc6844b04a9284bb6337fb0ccfe543a493ef0ac8e725242201e93d4bd34826040516126a792919061325f565b60405180910390a1905090565b6000546001600160a01b031633146126de5760405162461bcd60e51b81526004016102ab906131a0565b565b6000806126ec83611d44565b90506126f6612590565b6007546040516323b872dd60e01b81526001600160a01b03928316926323b872dd9261272c92339290911690889060040161302f565b602060405180830381600087803b15801561274657600080fd5b505af115801561275a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061277e919081019061297f565b50612787612846565b6001600160a01b031663a9059cbb33836040518363ffffffff1660e01b81526004016127b4929190613072565b602060405180830381600087803b1580156127ce57600080fd5b505af11580156127e2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250612806919081019061297f565b507fdb1741ffc6844b04a9284bb6337fb0ccfe543a493ef0ac8e725242201e93d4bd83826040516128389291906131b0565b60405180910390a192915050565b60006106c0680a6f2dce8d0cae8d2f60bb1b61248b565b60008261286c57506000611243565b8282028284828161287957fe5b04146111a15760405162461bcd60e51b81526004016102ab906131ff565b60008082116128b85760405162461bcd60e51b81526004016102ab90613180565b60008284816128c357fe5b04949350505050565b604080518082019091526000808252602082015290565b80356112438161332d565b80516112438161332d565b803561124381613341565b805161124381613341565b80356112438161334a565b80516112438161334a565b60006020828403121561293757600080fd5b600061205784846128e3565b60006020828403121561295557600080fd5b600061205784846128ee565b60006020828403121561297357600080fd5b600061205784846128f9565b60006020828403121561299157600080fd5b60006120578484612904565b6000602082840312156129af57600080fd5b6000612057848461290f565b6000602082840312156129cd57600080fd5b6000612057848461291a565b600080604083850312156129ec57600080fd5b60006129f8858561290f565b9250506020612a098582860161290f565b9150509250929050565b6000612a1f8383612aa1565b505060200190565b612a30816132e1565b82525050565b612a30816132c5565b6000612a4a826132b3565b612a5481856132b7565b9350612a5f836132ad565b8060005b83811015612a8d578151612a778882612a13565b9750612a82836132ad565b925050600101612a63565b509495945050505050565b612a30816132d0565b612a30816106c3565b612a30612ab6826106c3565b6106c3565b612a30816132e8565b6000612acf826132b3565b612ad981856132b7565b9350612ae98185602086016132f3565b612af281613323565b9093019392505050565b6000612b09602b836132b7565b7f47756172616e74656564206574686572207261746520776f756c64206e6f742081526a1899481c9958d95a5d995960aa1b602082015260400192915050565b6000612b566035836132b7565b7f596f75206d757374206265206e6f6d696e61746564206265666f726520796f7581527402063616e20616363657074206f776e65727368697605c1b602082015260400192915050565b6000612bad602f836132b7565b7f47756172616e746565642073796e746865746978207261746520776f756c642081526e1b9bdd081899481c9958d95a5d9959608a1b602082015260400192915050565b6000612bfe601b836132b7565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000815260200192915050565b6000612c37601e836132b7565b7f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815260200192915050565b6000612c70601a836132b7565b7f536166654d6174683a206469766973696f6e206279207a65726f000000000000815260200192915050565b6000612ca96011836132c0565b70026b4b9b9b4b7339030b2323932b9b99d1607d1b815260110192915050565b6000612cd66021836132b7565b7f596f752068617665206e6f206465706f7369747320746f2077697468647261778152601760f91b602082015260400192915050565b6000612d19602f836132b7565b7f4f6e6c792074686520636f6e7472616374206f776e6572206d6179207065726681526e37b936903a3434b99030b1ba34b7b760891b602082015260400192915050565b6000612d6a6004836132b7565b631cd554d160e21b815260200192915050565b6000612d8a601b836132b7565b7f5261746520696e76616c6964206f72206e6f7420612073796e74680000000000815260200192915050565b6000612dc36021836132b7565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f8152607760f81b602082015260400192915050565b6000612e066025836132b7565b7f45544820616d6f756e742061626f7665206d61784574685075726368617365208152641b1a5b5a5d60da1b602082015260400192915050565b6000612e4d6030836132b7565b7f4d696e696d756d206465706f73697420616d6f756e74206d757374206265206781526f1c99585d195c881d1a185b881553925560821b602082015260400192915050565b6000612e9f6003836132b7565b6208aa8960eb1b815260200192915050565b6000612ebe603c836132b7565b7f5468697320616374696f6e2063616e6e6f7420626520706572666f726d65642081527f7768696c652074686520636f6e74726163742069732070617573656400000000602082015260400192915050565b6000612f1d6019836132c0565b7f5265736f6c766572206d697373696e67207461726765743a2000000000000000815260190192915050565b6000612f566003836132b7565b620a69cb60eb1b815260200192915050565b6000612f756025836132b7565b7f47756172616e74656564207261746520776f756c64206e6f7420626520726563815264195a5d995960da1b602082015260400192915050565b6000612fbc601f836132b7565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00815260200192915050565b6000612ff382612c9c565b9150612fff8284612aaa565b50602001919050565b6000612ff382612f10565b602081016112438284612a36565b602081016112438284612a27565b6060810161303d8286612a27565b61304a6020830185612a27565b6120576040830184612aa1565b604081016130658285612a36565b6111a16020830184612aa1565b604081016130658285612a27565b6060810161308e8286612a27565b61304a6020830185612aa1565b604081016130a98285612a36565b6111a16020830184612a36565b602080825281016111a18184612a3f565b602081016112438284612a98565b602081016112438284612aa1565b604081016130a98285612aa1565b604081016130ff8285612aa1565b81810360208301526120578184612ac4565b602081016112438284612abb565b602080825281016111a18184612ac4565b6020808252810161124381612afc565b6020808252810161124381612b49565b6020808252810161124381612ba0565b6020808252810161124381612bf1565b6020808252810161124381612c2a565b6020808252810161124381612c63565b6020808252810161124381612cc9565b6020808252810161124381612d0c565b608080825281016131c081612d5d565b90506131cf6020830185612aa1565b81810360408301526131e081612f49565b90506111a16060830184612aa1565b6020808252810161124381612d7d565b6020808252810161124381612db6565b6020808252810161124381612df9565b6020808252810161124381612e40565b6080808252810161323f81612e92565b905061324e6020830185612aa1565b81810360408301526131e081612d5d565b608080825281016131c081612e92565b6020808252810161124381612eb1565b6020808252810161124381612f68565b6020808252810161124381612faf565b604081016130658285612aa1565b60200190565b5190565b90815260200190565b919050565b6000611243826132d5565b151590565b6001600160a01b031690565b6000611243825b6000611243826132c5565b60005b8381101561330e5781810151838201526020016132f6565b8381111561331d576000848401525b50505050565b601f01601f191690565b613336816132c5565b811461131957600080fd5b613336816132d0565b613336816106c356fea365627a7a72315820d3694d5cfea1328c19bc446d63d0a1a83e3fc67686437bdf2b7c16f279fb64976c6578706572696d656e74616cf564736f6c6343000510004000000000000000000000000048914229dedd5a9922f44441ffccfc2cb7856ee900000000000000000000000048914229dedd5a9922f44441ffccfc2cb7856ee9000000000000000000000000b61a6af69e992e1bed69b0ae0cba5143ca25d4d1

Deployed Bytecode

0x6080604052600436106101f95760003560e01c806381b797dc1161010d578063b0c2cb96116100a0578063c8d889f21161006f578063c8d889f214610610578063dc8fa6c214610630578063e6d76a7614610650578063f852d39314610670578063fd12167f14610690576101f9565b8063b0c2cb961461059b578063b1338cc4146105bb578063bb7df172146105d0578063c6abb7c7146105f0576101f9565b80639342c0eb116100dc5780639342c0eb1461051a578063a3d8829b1461052d578063aab483d61461054d578063b02c43d01461056d576101f9565b806381b797dc146104b9578063899ffef4146104ce5780638da5cb5b146104f057806391b4ded914610505576101f9565b80632194f3a2116101905780635c975abb1161015f5780635c975abb1461044557806364e39b871461045a5780636d5ab4a91461047a578063741853601461048f57806379ba5097146104a4576101f9565b80632194f3a2146103d75780632af64bd3146103f95780634d0387fb1461041b57806353a47bb714610430576101f9565b80630c928f05116101cc5780630c928f051461036d5780631627540c1461038d57806316c38b3c146103af5780631f930115146103cf576101f9565b8063022794381461030557806304f3bcec14610323578063080c279a146103455780630c928bc21461035a575b60048054600101908190556208aa8960eb1b6102136106a5565b6001600160a01b0316632528f0fe826040518263ffffffff1660e01b815260040161023e91906130d5565b60206040518083038186803b15801561025657600080fd5b505afa15801561026a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061028e919081019061297f565b156102b45760405162461bcd60e51b81526004016102ab906131ef565b60405180910390fd5b60035460ff16156102d75760405162461bcd60e51b81526004016102ab9061326f565b6102df6106c6565b505060045481146103025760405162461bcd60e51b81526004016102ab9061328f565b50005b61030d610e8f565b60405161031a91906130d5565b60405180910390f35b34801561032f57600080fd5b50610338611011565b60405161031a9190613111565b34801561035157600080fd5b5061030d611020565b61030d61036836600461299d565b611026565b34801561037957600080fd5b5061030d61038836600461299d565b6111a8565b34801561039957600080fd5b506103ad6103a8366004612925565b611249565b005b3480156103bb57600080fd5b506103ad6103ca366004612961565b6112a7565b61030d61131c565b3480156103e357600080fd5b506103ec611424565b60405161031a9190613013565b34801561040557600080fd5b5061040e611433565b60405161031a91906130c7565b34801561042757600080fd5b5061030d61154a565b34801561043c57600080fd5b506103ec611550565b34801561045157600080fd5b5061040e61155f565b34801561046657600080fd5b506103ad610475366004612925565b611568565b34801561048657600080fd5b5061030d6115c1565b34801561049b57600080fd5b506103ad6115c7565b3480156104b057600080fd5b506103ad61171d565b3480156104c557600080fd5b506103ad6117b9565b3480156104da57600080fd5b506104e36119c2565b60405161031a91906130b6565b3480156104fc57600080fd5b506103ec611a5d565b34801561051157600080fd5b5061030d611a6c565b61030d6105283660046129d9565b611a72565b34801561053957600080fd5b5061030d61054836600461299d565b611d44565b34801561055957600080fd5b506103ad61056836600461299d565b611ddf565b34801561057957600080fd5b5061058d61058836600461299d565b611eb6565b60405161031a929190613057565b3480156105a757600080fd5b5061030d6105b63660046129d9565b611edb565b3480156105c757600080fd5b5061030d61205f565b3480156105dc57600080fd5b506103ad6105eb36600461299d565b612065565b3480156105fc57600080fd5b5061030d61060b366004612925565b6120a2565b34801561061c57600080fd5b5061030d61062b36600461299d565b6120b4565b34801561063c57600080fd5b506103ad61064b36600461299d565b61215b565b34801561065c57600080fd5b506103ad61066b36600461299d565b61231b565b34801561067c57600080fd5b5061030d61068b36600461299d565b6123b0565b34801561069c57600080fd5b5061030d612485565b60006106c06c45786368616e6765526174657360981b61248b565b90505b90565b6000600d543411156106ea5760405162461bcd60e51b81526004016102ab9061320f565b6000806107866106f86106a5565b6001600160a01b031663ac82f6086208aa8960eb1b6040518263ffffffff1660e01b815260040161072991906130d5565b60206040518083038186803b15801561074157600080fd5b505afa158015610755573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061077991908101906129bb565b349063ffffffff6124ef16565b60095490915081905b6000821180156107a05750600a5481105b15610d65576107ad6128cc565b50600081815260086020908152604091829020825180840190935280546001600160a01b031680845260019091015491830191909152610803576009546107fb90600163ffffffff61251916565b600955610d5c565b8281602001511115610ab2576020810151600090610827908563ffffffff61253e16565b60408051808201825284516001600160a01b039081168252602080830185815260008981526008909252939020915182546001600160a01b03191691161781559051600190910155600b5490915061087f908561253e565b600b5561091b61088d6106a5565b6001600160a01b031663ac82f6086208aa8960eb1b6040518263ffffffff1660e01b81526004016108be91906130d5565b60206040518083038186803b1580156108d657600080fd5b505afa1580156108ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061090e91908101906129bb565b859063ffffffff61256616565b82516040519197506001600160a01b03169087156108fc029088906000818181858888f193505050506109cd576007546040516001600160a01b039091169087156108fc029088906000818181858888f19350505050158015610982573d6000803e3d6000fd5b5081600001516001600160a01b03167ff2435d3901399daa085f8b58d2409fff9b83ce4ca97c1f144b532f5a08b1c96c876040516109c091906130d5565b60405180910390a2610a20565b8282600001516001600160a01b0316336001600160a01b03167f6d957e9e816107f67cb7118461e3c259e96896f80223c9af2972596c2fdd401c8988604051610a1792919061329f565b60405180910390a45b610a28612590565b6001600160a01b031663a9059cbb33866040518363ffffffff1660e01b8152600401610a55929190613072565b602060405180830381600087803b158015610a6f57600080fd5b505af1158015610a83573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610aa7919081019061297f565b506000935050610d5c565b82816020015111610d5c57600082815260086020526040812080546001600160a01b0319168155600190810191909155600954610af49163ffffffff61251916565b6009556020810151600b54610b0e9163ffffffff61253e16565b600b55610bae610b1c6106a5565b6001600160a01b031663ac82f6086208aa8960eb1b6040518263ffffffff1660e01b8152600401610b4d91906130d5565b60206040518083038186803b158015610b6557600080fd5b505afa158015610b79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610b9d91908101906129bb565b60208301519063ffffffff61256616565b81516040519196506001600160a01b03169086156108fc029087906000818181858888f19350505050610c60576007546040516001600160a01b039091169086156108fc029087906000818181858888f19350505050158015610c15573d6000803e3d6000fd5b5080600001516001600160a01b03167ff2435d3901399daa085f8b58d2409fff9b83ce4ca97c1f144b532f5a08b1c96c86604051610c5391906130d5565b60405180910390a2610cb7565b8181600001516001600160a01b0316336001600160a01b03167f6d957e9e816107f67cb7118461e3c259e96896f80223c9af2972596c2fdd401c888560200151604051610cae92919061329f565b60405180910390a45b610cbf612590565b6001600160a01b031663a9059cbb3383602001516040518363ffffffff1660e01b8152600401610cf0929190613072565b602060405180830381600087803b158015610d0a57600080fd5b505af1158015610d1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610d42919081019061297f565b506020810151610d5990849063ffffffff61253e16565b92505b5060010161078f565b508015610e3357336108fc610e09610d7b6106a5565b6001600160a01b031663ac82f6086208aa8960eb1b6040518263ffffffff1660e01b8152600401610dac91906130d5565b60206040518083038186803b158015610dc457600080fd5b505afa158015610dd8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610dfc91908101906129bb565b849063ffffffff61256616565b6040518115909202916000818181858888f19350505050158015610e31573d6000803e3d6000fd5b505b6000610e45838363ffffffff61253e16565b90508015610e87577fdb1741ffc6844b04a9284bb6337fb0ccfe543a493ef0ac8e725242201e93d4bd3482604051610e7e92919061322f565b60405180910390a15b935050505090565b6000620a69cb60eb1b610ea06106a5565b6001600160a01b0316632528f0fe826040518263ffffffff1660e01b8152600401610ecb91906130d5565b60206040518083038186803b158015610ee357600080fd5b505afa158015610ef7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610f1b919081019061297f565b15610f385760405162461bcd60e51b81526004016102ab906131ef565b6208aa8960eb1b610f476106a5565b6001600160a01b0316632528f0fe826040518263ffffffff1660e01b8152600401610f7291906130d5565b60206040518083038186803b158015610f8a57600080fd5b505afa158015610f9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610fc2919081019061297f565b15610fdf5760405162461bcd60e51b81526004016102ab906131ef565b60035460ff16156110025760405162461bcd60e51b81526004016102ab9061326f565b61100a6125a7565b9250505090565b6005546001600160a01b031681565b600c5481565b60006208aa8960eb1b6110376106a5565b6001600160a01b0316632528f0fe826040518263ffffffff1660e01b815260040161106291906130d5565b60206040518083038186803b15801561107a57600080fd5b505afa15801561108e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506110b2919081019061297f565b156110cf5760405162461bcd60e51b81526004016102ab906131ef565b60035460ff16156110f25760405162461bcd60e51b81526004016102ab9061326f565b6110fa6106a5565b6001600160a01b031663ac82f6086208aa8960eb1b6040518263ffffffff1660e01b815260040161112b91906130d5565b60206040518083038186803b15801561114357600080fd5b505afa158015611157573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061117b91908101906129bb565b83146111995760405162461bcd60e51b81526004016102ab9061327f565b6111a16106c6565b9392505050565b60006112436111b56106a5565b6001600160a01b031663ac82f6086208aa8960eb1b6040518263ffffffff1660e01b81526004016111e691906130d5565b60206040518083038186803b1580156111fe57600080fd5b505afa158015611212573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061123691908101906129bb565b839063ffffffff6124ef16565b92915050565b6112516126b4565b600180546001600160a01b0319166001600160a01b0383161790556040517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce229061129c908390613013565b60405180910390a150565b6112af6126b4565b60035460ff16151581151514156112c557611319565b6003805460ff1916821515179081905560ff16156112e257426002555b6003546040517f8fb6c181ee25a520cf3dd6565006ef91229fcfe5a989566c2a3b8c115570cec59161129c9160ff909116906130c7565b50565b60048054600101908190556000906208aa8960eb1b6113396106a5565b6001600160a01b0316632528f0fe826040518263ffffffff1660e01b815260040161136491906130d5565b60206040518083038186803b15801561137c57600080fd5b505afa158015611390573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506113b4919081019061297f565b156113d15760405162461bcd60e51b81526004016102ab906131ef565b60035460ff16156113f45760405162461bcd60e51b81526004016102ab9061326f565b6113fc6106c6565b92505060045481146114205760405162461bcd60e51b81526004016102ab9061328f565b5090565b6007546001600160a01b031681565b6000606061143f6119c2565b905060005b815181101561154157600082828151811061145b57fe5b602090810291909101810151600081815260069092526040918290205460055492516321f8a72160e01b81529193506001600160a01b039081169216906321f8a721906114ac9085906004016130d5565b60206040518083038186803b1580156114c457600080fd5b505afa1580156114d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506114fc9190810190612943565b6001600160a01b031614158061152757506000818152600660205260409020546001600160a01b0316155b1561153857600093505050506106c3565b50600101611444565b50600191505090565b600b5481565b6001546001600160a01b031681565b60035460ff1681565b6115706126b4565b600780546001600160a01b0319166001600160a01b0383811691909117918290556040517f4deb077bf9c4bc824cc2c989e01a5e53b0a4ecc44c5039d46abc9ffc88f8a0509261129c921690613021565b60095481565b60606115d16119c2565b905060005b81518110156117195760008282815181106115ed57fe5b602002602001015190506000600560009054906101000a90046001600160a01b03166001600160a01b031663dacb2d01838460405160200161162f9190613008565b6040516020818303038152906040526040518363ffffffff1660e01b815260040161165b9291906130f1565b60206040518083038186803b15801561167357600080fd5b505afa158015611687573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506116ab9190810190612943565b6000838152600660205260409081902080546001600160a01b0319166001600160a01b038416179055519091507f88a93678a3692f6789d9546fc621bf7234b101ddb7d4fe479455112831b8aa689061170790849084906130e3565b60405180910390a150506001016115d6565b5050565b6001546001600160a01b031633146117475760405162461bcd60e51b81526004016102ab90613140565b6000546001546040517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9261178a926001600160a01b039182169291169061309b565b60405180910390a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b6009546000905b600a548110156118a2576117d26128cc565b50600081815260086020908152604091829020825180840190935280546001600160a01b03168084526001909101549183019190915233141561189957602081015161182590849063ffffffff61251916565b600083815260086020908152604080832080546001600160a01b031916815560010192909255835190840151915192955084926001600160a01b03909116917f3aa2b18eace5e5727a4ab525921b9b0a1ca1afdb0f96b599e3ab2d76cb5e7f729161189091906130d5565b60405180910390a35b506001016117c0565b50600b546118b6908263ffffffff61253e16565b600b55336000908152600e60205260409020546118da90829063ffffffff61251916565b336000908152600e60205260408120559050806119095760405162461bcd60e51b81526004016102ab90613190565b611911612590565b6001600160a01b031663a9059cbb33836040518363ffffffff1660e01b815260040161193e929190613072565b602060405180830381600087803b15801561195857600080fd5b505af115801561196c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611990919081019061297f565b507faf6ec623f558c7b3527ff6c9c09432c7d81a3d38bd2e1eaaee2efe7aac23c28b338260405161129c929190613072565b604080516003808252608082019092526060916020820183803883390190505090506814de5b9d1a1cd554d160ba1b816000815181106119fe57fe5b6020026020010181815250506c45786368616e6765526174657360981b81600181518110611a2857fe5b602002602001018181525050680a6f2dce8d0cae8d2f60bb1b81600281518110611a4e57fe5b60200260200101818152505090565b6000546001600160a01b031681565b60025481565b6000620a69cb60eb1b611a836106a5565b6001600160a01b0316632528f0fe826040518263ffffffff1660e01b8152600401611aae91906130d5565b60206040518083038186803b158015611ac657600080fd5b505afa158015611ada573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611afe919081019061297f565b15611b1b5760405162461bcd60e51b81526004016102ab906131ef565b6208aa8960eb1b611b2a6106a5565b6001600160a01b0316632528f0fe826040518263ffffffff1660e01b8152600401611b5591906130d5565b60206040518083038186803b158015611b6d57600080fd5b505afa158015611b81573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611ba5919081019061297f565b15611bc25760405162461bcd60e51b81526004016102ab906131ef565b60035460ff1615611be55760405162461bcd60e51b81526004016102ab9061326f565b611bed6106a5565b6001600160a01b031663ac82f6086208aa8960eb1b6040518263ffffffff1660e01b8152600401611c1e91906130d5565b60206040518083038186803b158015611c3657600080fd5b505afa158015611c4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611c6e91908101906129bb565b8514611c8c5760405162461bcd60e51b81526004016102ab90613130565b611c946106a5565b6001600160a01b031663ac82f608620a69cb60eb1b6040518263ffffffff1660e01b8152600401611cc591906130d5565b60206040518083038186803b158015611cdd57600080fd5b505afa158015611cf1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611d1591908101906129bb565b8414611d335760405162461bcd60e51b81526004016102ab90613150565b611d3b6125a7565b95945050505050565b6000611243611d516106a5565b6001600160a01b031663ac82f608620a69cb60eb1b6040518263ffffffff1660e01b8152600401611d8291906130d5565b60206040518083038186803b158015611d9a57600080fd5b505afa158015611dae573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611dd291908101906129bb565b839063ffffffff61256616565b611de76126b4565b739d6d846d4546614a7e668e66886624c0ae21d78663907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b158015611e2b57600080fd5b505af4158015611e3f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611e6391908101906129bb565b8111611e815760405162461bcd60e51b81526004016102ab9061321f565b600c8190556040517fa39eacd162ee82c70b2b030a1bc8fe89adcccc61122fad4821a8772dbcc542679061129c9083906130d5565b600860205260009081526040902080546001909101546001600160a01b039091169082565b6000620a69cb60eb1b611eec6106a5565b6001600160a01b0316632528f0fe826040518263ffffffff1660e01b8152600401611f1791906130d5565b60206040518083038186803b158015611f2f57600080fd5b505afa158015611f43573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611f67919081019061297f565b15611f845760405162461bcd60e51b81526004016102ab906131ef565b60035460ff1615611fa75760405162461bcd60e51b81526004016102ab9061326f565b611faf6106a5565b6001600160a01b031663ac82f608620a69cb60eb1b6040518263ffffffff1660e01b8152600401611fe091906130d5565b60206040518083038186803b158015611ff857600080fd5b505afa15801561200c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061203091908101906129bb565b831461204e5760405162461bcd60e51b81526004016102ab9061327f565b612057846126e0565b949350505050565b600d5481565b61206d6126b4565b600d8190556040517fdc2be810a133e01cb21a41082f15b2863d96f9fe79d1f84d7e2d5b810c5c82439061129c9083906130d5565b600e6020526000908152604090205481565b6000806121506120c26106a5565b6001600160a01b031663ac82f6086208aa8960eb1b6040518263ffffffff1660e01b81526004016120f391906130d5565b60206040518083038186803b15801561210b57600080fd5b505afa15801561211f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061214391908101906129bb565b849063ffffffff6124ef16565b90506111a181611d44565b612163612590565b6001600160a01b03166323b872dd3330846040518463ffffffff1660e01b81526004016121929392919061302f565b602060405180830381600087803b1580156121ac57600080fd5b505af11580156121c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506121e4919081019061297f565b50600c5481101561226557336000908152600e602052604090205461220f908263ffffffff61251916565b336000818152600e60205260409081902092909255600c5491517fbc3a12638d840d60760c64b39c73985a6498cf6eb8176f124995b0e07236cbd2926122589291859190613080565b60405180910390a1611319565b604080518082018252338082526020808301858152600a80546000908152600890935291859020935184546001600160a01b0319166001600160a01b0390911617845551600190930192909255905491517fd9acabe6e09d178728ba5c366661c5be0621b4770f216305b059ec175b37e0b4906122e39085906130d5565b60405180910390a3600a546122ff90600163ffffffff61251916565b600a55600b54612315908263ffffffff61251916565b600b5550565b6123236126b4565b61232b612846565b60005460405163a9059cbb60e01b81526001600160a01b039283169263a9059cbb9261235e929116908590600401613057565b602060405180830381600087803b15801561237857600080fd5b505af115801561238c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611719919081019061297f565b6000620a69cb60eb1b6123c16106a5565b6001600160a01b0316632528f0fe826040518263ffffffff1660e01b81526004016123ec91906130d5565b60206040518083038186803b15801561240457600080fd5b505afa158015612418573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061243c919081019061297f565b156124595760405162461bcd60e51b81526004016102ab906131ef565b60035460ff161561247c5760405162461bcd60e51b81526004016102ab9061326f565b6111a1836126e0565b600a5481565b60008181526006602090815260408083205490516001600160a01b0390911691821515916124bb91869101612fe8565b604051602081830303815290604052906124e85760405162461bcd60e51b81526004016102ab919061311f565b5092915050565b6000670de0b6b3a764000061250a848463ffffffff61285d16565b8161251157fe5b049392505050565b6000828201838110156111a15760405162461bcd60e51b81526004016102ab90613160565b6000828211156125605760405162461bcd60e51b81526004016102ab90613170565b50900390565b60006111a18261258485670de0b6b3a764000063ffffffff61285d16565b9063ffffffff61289716565b60006106c06814de5b9d1a1cd554d160ba1b61248b565b6000806125b3346120b4565b6007546040519192506001600160a01b0316903480156108fc02916000818181858888f193505050501580156125ed573d6000803e3d6000fd5b506125f6612846565b6001600160a01b031663a9059cbb33836040518363ffffffff1660e01b8152600401612623929190613072565b602060405180830381600087803b15801561263d57600080fd5b505af1158015612651573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250612675919081019061297f565b507fdb1741ffc6844b04a9284bb6337fb0ccfe543a493ef0ac8e725242201e93d4bd34826040516126a792919061325f565b60405180910390a1905090565b6000546001600160a01b031633146126de5760405162461bcd60e51b81526004016102ab906131a0565b565b6000806126ec83611d44565b90506126f6612590565b6007546040516323b872dd60e01b81526001600160a01b03928316926323b872dd9261272c92339290911690889060040161302f565b602060405180830381600087803b15801561274657600080fd5b505af115801561275a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061277e919081019061297f565b50612787612846565b6001600160a01b031663a9059cbb33836040518363ffffffff1660e01b81526004016127b4929190613072565b602060405180830381600087803b1580156127ce57600080fd5b505af11580156127e2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250612806919081019061297f565b507fdb1741ffc6844b04a9284bb6337fb0ccfe543a493ef0ac8e725242201e93d4bd83826040516128389291906131b0565b60405180910390a192915050565b60006106c0680a6f2dce8d0cae8d2f60bb1b61248b565b60008261286c57506000611243565b8282028284828161287957fe5b04146111a15760405162461bcd60e51b81526004016102ab906131ff565b60008082116128b85760405162461bcd60e51b81526004016102ab90613180565b60008284816128c357fe5b04949350505050565b604080518082019091526000808252602082015290565b80356112438161332d565b80516112438161332d565b803561124381613341565b805161124381613341565b80356112438161334a565b80516112438161334a565b60006020828403121561293757600080fd5b600061205784846128e3565b60006020828403121561295557600080fd5b600061205784846128ee565b60006020828403121561297357600080fd5b600061205784846128f9565b60006020828403121561299157600080fd5b60006120578484612904565b6000602082840312156129af57600080fd5b6000612057848461290f565b6000602082840312156129cd57600080fd5b6000612057848461291a565b600080604083850312156129ec57600080fd5b60006129f8858561290f565b9250506020612a098582860161290f565b9150509250929050565b6000612a1f8383612aa1565b505060200190565b612a30816132e1565b82525050565b612a30816132c5565b6000612a4a826132b3565b612a5481856132b7565b9350612a5f836132ad565b8060005b83811015612a8d578151612a778882612a13565b9750612a82836132ad565b925050600101612a63565b509495945050505050565b612a30816132d0565b612a30816106c3565b612a30612ab6826106c3565b6106c3565b612a30816132e8565b6000612acf826132b3565b612ad981856132b7565b9350612ae98185602086016132f3565b612af281613323565b9093019392505050565b6000612b09602b836132b7565b7f47756172616e74656564206574686572207261746520776f756c64206e6f742081526a1899481c9958d95a5d995960aa1b602082015260400192915050565b6000612b566035836132b7565b7f596f75206d757374206265206e6f6d696e61746564206265666f726520796f7581527402063616e20616363657074206f776e65727368697605c1b602082015260400192915050565b6000612bad602f836132b7565b7f47756172616e746565642073796e746865746978207261746520776f756c642081526e1b9bdd081899481c9958d95a5d9959608a1b602082015260400192915050565b6000612bfe601b836132b7565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000815260200192915050565b6000612c37601e836132b7565b7f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815260200192915050565b6000612c70601a836132b7565b7f536166654d6174683a206469766973696f6e206279207a65726f000000000000815260200192915050565b6000612ca96011836132c0565b70026b4b9b9b4b7339030b2323932b9b99d1607d1b815260110192915050565b6000612cd66021836132b7565b7f596f752068617665206e6f206465706f7369747320746f2077697468647261778152601760f91b602082015260400192915050565b6000612d19602f836132b7565b7f4f6e6c792074686520636f6e7472616374206f776e6572206d6179207065726681526e37b936903a3434b99030b1ba34b7b760891b602082015260400192915050565b6000612d6a6004836132b7565b631cd554d160e21b815260200192915050565b6000612d8a601b836132b7565b7f5261746520696e76616c6964206f72206e6f7420612073796e74680000000000815260200192915050565b6000612dc36021836132b7565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f8152607760f81b602082015260400192915050565b6000612e066025836132b7565b7f45544820616d6f756e742061626f7665206d61784574685075726368617365208152641b1a5b5a5d60da1b602082015260400192915050565b6000612e4d6030836132b7565b7f4d696e696d756d206465706f73697420616d6f756e74206d757374206265206781526f1c99585d195c881d1a185b881553925560821b602082015260400192915050565b6000612e9f6003836132b7565b6208aa8960eb1b815260200192915050565b6000612ebe603c836132b7565b7f5468697320616374696f6e2063616e6e6f7420626520706572666f726d65642081527f7768696c652074686520636f6e74726163742069732070617573656400000000602082015260400192915050565b6000612f1d6019836132c0565b7f5265736f6c766572206d697373696e67207461726765743a2000000000000000815260190192915050565b6000612f566003836132b7565b620a69cb60eb1b815260200192915050565b6000612f756025836132b7565b7f47756172616e74656564207261746520776f756c64206e6f7420626520726563815264195a5d995960da1b602082015260400192915050565b6000612fbc601f836132b7565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00815260200192915050565b6000612ff382612c9c565b9150612fff8284612aaa565b50602001919050565b6000612ff382612f10565b602081016112438284612a36565b602081016112438284612a27565b6060810161303d8286612a27565b61304a6020830185612a27565b6120576040830184612aa1565b604081016130658285612a36565b6111a16020830184612aa1565b604081016130658285612a27565b6060810161308e8286612a27565b61304a6020830185612aa1565b604081016130a98285612a36565b6111a16020830184612a36565b602080825281016111a18184612a3f565b602081016112438284612a98565b602081016112438284612aa1565b604081016130a98285612aa1565b604081016130ff8285612aa1565b81810360208301526120578184612ac4565b602081016112438284612abb565b602080825281016111a18184612ac4565b6020808252810161124381612afc565b6020808252810161124381612b49565b6020808252810161124381612ba0565b6020808252810161124381612bf1565b6020808252810161124381612c2a565b6020808252810161124381612c63565b6020808252810161124381612cc9565b6020808252810161124381612d0c565b608080825281016131c081612d5d565b90506131cf6020830185612aa1565b81810360408301526131e081612f49565b90506111a16060830184612aa1565b6020808252810161124381612d7d565b6020808252810161124381612db6565b6020808252810161124381612df9565b6020808252810161124381612e40565b6080808252810161323f81612e92565b905061324e6020830185612aa1565b81810360408301526131e081612d5d565b608080825281016131c081612e92565b6020808252810161124381612eb1565b6020808252810161124381612f68565b6020808252810161124381612faf565b604081016130658285612aa1565b60200190565b5190565b90815260200190565b919050565b6000611243826132d5565b151590565b6001600160a01b031690565b6000611243825b6000611243826132c5565b60005b8381101561330e5781810151838201526020016132f6565b8381111561331d576000848401525b50505050565b601f01601f191690565b613336816132c5565b811461131957600080fd5b613336816132d0565b613336816106c356fea365627a7a72315820d3694d5cfea1328c19bc446d63d0a1a83e3fc67686437bdf2b7c16f279fb64976c6578706572696d656e74616cf564736f6c63430005100040

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

00000000000000000000000048914229dedd5a9922f44441ffccfc2cb7856ee900000000000000000000000048914229dedd5a9922f44441ffccfc2cb7856ee9000000000000000000000000b61a6af69e992e1bed69b0ae0cba5143ca25d4d1

-----Decoded View---------------
Arg [0] : _owner (address): 0x48914229deDd5A9922f44441ffCCfC2Cb7856Ee9
Arg [1] : _fundsWallet (address): 0x48914229deDd5A9922f44441ffCCfC2Cb7856Ee9
Arg [2] : _resolver (address): 0xb61a6aF69e992e1bed69b0aE0CBa5143CA25D4D1

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 00000000000000000000000048914229dedd5a9922f44441ffccfc2cb7856ee9
Arg [1] : 00000000000000000000000048914229dedd5a9922f44441ffccfc2cb7856ee9
Arg [2] : 000000000000000000000000b61a6af69e992e1bed69b0ae0cba5143ca25d4d1


Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Loading...
Loading

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