ETH Price: $2,896.80 (-4.98%)
Gas: 3 Gwei

Contract

0xd711709eFc452152B7ad11DbD01ed4B69c9421B3
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
Nominate New Own...194162402024-03-12 3:12:47117 days ago1710213167IN
0xd711709e...69c9421B3
0 ETH0.0014871448.84366168
Nominate New Own...193847382024-03-07 17:18:47122 days ago1709831927IN
0xd711709e...69c9421B3
0 ETH0.00482055101.38503001
0x60806040193845552024-03-07 16:41:47122 days ago1709829707IN
 Create: Synthetix
0 ETH0.4734344886.66931013

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To Value
202583102024-07-08 0:47:351 min ago1720399655
0xd711709e...69c9421B3
0 ETH
202583102024-07-08 0:47:351 min ago1720399655
0xd711709e...69c9421B3
0 ETH
202583102024-07-08 0:47:351 min ago1720399655
0xd711709e...69c9421B3
0 ETH
202583102024-07-08 0:47:351 min ago1720399655
0xd711709e...69c9421B3
0 ETH
202583102024-07-08 0:47:351 min ago1720399655
0xd711709e...69c9421B3
0 ETH
202583102024-07-08 0:47:351 min ago1720399655
0xd711709e...69c9421B3
0 ETH
202583102024-07-08 0:47:351 min ago1720399655
0xd711709e...69c9421B3
0 ETH
202583102024-07-08 0:47:351 min ago1720399655
0xd711709e...69c9421B3
0 ETH
202583102024-07-08 0:47:351 min ago1720399655
0xd711709e...69c9421B3
0 ETH
202583102024-07-08 0:47:351 min ago1720399655
0xd711709e...69c9421B3
0 ETH
202583092024-07-08 0:47:231 min ago1720399643
0xd711709e...69c9421B3
0 ETH
202583092024-07-08 0:47:231 min ago1720399643
0xd711709e...69c9421B3
0 ETH
202583092024-07-08 0:47:231 min ago1720399643
0xd711709e...69c9421B3
0 ETH
202583092024-07-08 0:47:231 min ago1720399643
0xd711709e...69c9421B3
0 ETH
202583092024-07-08 0:47:231 min ago1720399643
0xd711709e...69c9421B3
0 ETH
202583092024-07-08 0:47:231 min ago1720399643
0xd711709e...69c9421B3
0 ETH
202583092024-07-08 0:47:231 min ago1720399643
0xd711709e...69c9421B3
0 ETH
202583092024-07-08 0:47:231 min ago1720399643
0xd711709e...69c9421B3
0 ETH
202583092024-07-08 0:47:231 min ago1720399643
0xd711709e...69c9421B3
0 ETH
202583092024-07-08 0:47:231 min ago1720399643
0xd711709e...69c9421B3
0 ETH
202583052024-07-08 0:46:352 mins ago1720399595
0xd711709e...69c9421B3
0 ETH
202583052024-07-08 0:46:352 mins ago1720399595
0xd711709e...69c9421B3
0 ETH
202583052024-07-08 0:46:352 mins ago1720399595
0xd711709e...69c9421B3
0 ETH
202583052024-07-08 0:46:352 mins ago1720399595
0xd711709e...69c9421B3
0 ETH
202583052024-07-08 0:46:352 mins ago1720399595
0xd711709e...69c9421B3
0 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Synthetix

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-07
*/

/*

⚠⚠⚠ WARNING WARNING WARNING ⚠⚠⚠

This is a TARGET contract - DO NOT CONNECT TO IT DIRECTLY IN YOUR CONTRACTS or DAPPS!

This contract has an associated PROXY that MUST be used for all integrations - this TARGET will be REPLACED in an upcoming Synthetix release!
The proxy for this contract can be found here:

https://contracts.synthetix.io/ProxySynthetix

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

* Synthetix: Synthetix.sol
*
* Latest source (may be newer): https://github.com/Synthetixio/synthetix/blob/master/contracts/Synthetix.sol
* Docs: https://docs.synthetix.io/contracts/Synthetix
*
* Contract Dependencies: 
*	- BaseSynthetix
*	- ExternStateToken
*	- IAddressResolver
*	- IERC20
*	- ISynthetix
*	- MixinResolver
*	- Owned
*	- Proxyable
*	- State
* Libraries: 
*	- SafeDecimalMath
*	- SafeMath
*	- VestingEntries
*
* 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.4.24;

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


// 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


// Internal references


// https://docs.synthetix.io/contracts/source/contracts/proxy
contract Proxy is Owned {
    Proxyable public target;

    constructor(address _owner) public Owned(_owner) {}

    function setTarget(Proxyable _target) external onlyOwner {
        target = _target;
        emit TargetUpdated(_target);
    }

    function _emit(
        bytes calldata callData,
        uint numTopics,
        bytes32 topic1,
        bytes32 topic2,
        bytes32 topic3,
        bytes32 topic4
    ) external onlyTarget {
        uint size = callData.length;
        bytes memory _callData = callData;

        assembly {
            /* The first 32 bytes of callData contain its length (as specified by the abi).
             * Length is assumed to be a uint256 and therefore maximum of 32 bytes
             * in length. It is also leftpadded to be a multiple of 32 bytes.
             * This means moving call_data across 32 bytes guarantees we correctly access
             * the data itself. */
            switch numTopics
                case 0 {
                    log0(add(_callData, 32), size)
                }
                case 1 {
                    log1(add(_callData, 32), size, topic1)
                }
                case 2 {
                    log2(add(_callData, 32), size, topic1, topic2)
                }
                case 3 {
                    log3(add(_callData, 32), size, topic1, topic2, topic3)
                }
                case 4 {
                    log4(add(_callData, 32), size, topic1, topic2, topic3, topic4)
                }
        }
    }

    // solhint-disable no-complex-fallback
    function() external payable {
        // Mutable call setting Proxyable.messageSender as this is using call not delegatecall
        target.setMessageSender(msg.sender);

        assembly {
            let free_ptr := mload(0x40)
            calldatacopy(free_ptr, 0, calldatasize)

            /* We must explicitly forward ether to the underlying contract as well. */
            let result := call(gas, sload(target_slot), callvalue, free_ptr, calldatasize, 0, 0)
            returndatacopy(free_ptr, 0, returndatasize)

            if iszero(result) {
                revert(free_ptr, returndatasize)
            }
            return(free_ptr, returndatasize)
        }
    }

    modifier onlyTarget {
        require(Proxyable(msg.sender) == target, "Must be proxy target");
        _;
    }

    event TargetUpdated(Proxyable newTarget);
}


// Inheritance


// Internal references


// https://docs.synthetix.io/contracts/source/contracts/proxyable
contract Proxyable is Owned {
    // This contract should be treated like an abstract contract

    /* The proxy this contract exists behind. */
    Proxy public proxy;

    /* The caller of the proxy, passed through to this contract.
     * Note that every function using this member must apply the onlyProxy or
     * optionalProxy modifiers, otherwise their invocations can use stale values. */
    address public messageSender;

    constructor(address payable _proxy) internal {
        // This contract is abstract, and thus cannot be instantiated directly
        require(owner != address(0), "Owner must be set");

        proxy = Proxy(_proxy);
        emit ProxyUpdated(_proxy);
    }

    function setProxy(address payable _proxy) external onlyOwner {
        proxy = Proxy(_proxy);
        emit ProxyUpdated(_proxy);
    }

    function setMessageSender(address sender) external onlyProxy {
        messageSender = sender;
    }

    modifier onlyProxy {
        _onlyProxy();
        _;
    }

    function _onlyProxy() private view {
        require(Proxy(msg.sender) == proxy, "Only the proxy can call");
    }

    modifier optionalProxy {
        _optionalProxy();
        _;
    }

    function _optionalProxy() private {
        if (Proxy(msg.sender) != proxy && messageSender != msg.sender) {
            messageSender = msg.sender;
        }
    }

    modifier optionalProxy_onlyOwner {
        _optionalProxy_onlyOwner();
        _;
    }

    // solhint-disable-next-line func-name-mixedcase
    function _optionalProxy_onlyOwner() private {
        if (Proxy(msg.sender) != proxy && messageSender != msg.sender) {
            messageSender = msg.sender;
        }
        require(messageSender == owner, "Owner only function");
    }

    event ProxyUpdated(address proxyAddress);
}


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


// Inheritance


// https://docs.synthetix.io/contracts/source/contracts/state
contract State is Owned {
    // the address of the contract that can modify variables
    // this can only be changed by the owner of this contract
    address public associatedContract;

    constructor(address _associatedContract) internal {
        // This contract is abstract, and thus cannot be instantiated directly
        require(owner != address(0), "Owner must be set");

        associatedContract = _associatedContract;
        emit AssociatedContractUpdated(_associatedContract);
    }

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

    // Change the associated contract to a new address
    function setAssociatedContract(address _associatedContract) external onlyOwner {
        associatedContract = _associatedContract;
        emit AssociatedContractUpdated(_associatedContract);
    }

    /* ========== MODIFIERS ========== */

    modifier onlyAssociatedContract {
        require(msg.sender == associatedContract, "Only the associated contract can perform this action");
        _;
    }

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

    event AssociatedContractUpdated(address associatedContract);
}


// Inheritance


// https://docs.synthetix.io/contracts/source/contracts/tokenstate
contract TokenState is Owned, State {
    /* ERC20 fields. */
    mapping(address => uint) public balanceOf;
    mapping(address => mapping(address => uint)) public allowance;

    constructor(address _owner, address _associatedContract) public Owned(_owner) State(_associatedContract) {}

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

    /**
     * @notice Set ERC20 allowance.
     * @dev Only the associated contract may call this.
     * @param tokenOwner The authorising party.
     * @param spender The authorised party.
     * @param value The total value the authorised party may spend on the
     * authorising party's behalf.
     */
    function setAllowance(
        address tokenOwner,
        address spender,
        uint value
    ) external onlyAssociatedContract {
        allowance[tokenOwner][spender] = value;
    }

    /**
     * @notice Set the balance in a given account
     * @dev Only the associated contract may call this.
     * @param account The account whose value to set.
     * @param value The new balance of the given account.
     */
    function setBalanceOf(address account, uint value) external onlyAssociatedContract {
        balanceOf[account] = value;
    }
}


// Inheritance


// Libraries


// Internal references


// https://docs.synthetix.io/contracts/source/contracts/externstatetoken
contract ExternStateToken is Owned, Proxyable {
    using SafeMath for uint;
    using SafeDecimalMath for uint;

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

    /* Stores balances and allowances. */
    TokenState public tokenState;

    /* Other ERC20 fields. */
    string public name;
    string public symbol;
    uint public totalSupply;
    uint8 public decimals;

    constructor(
        address payable _proxy,
        TokenState _tokenState,
        string memory _name,
        string memory _symbol,
        uint _totalSupply,
        uint8 _decimals,
        address _owner
    ) public Owned(_owner) Proxyable(_proxy) {
        tokenState = _tokenState;

        name = _name;
        symbol = _symbol;
        totalSupply = _totalSupply;
        decimals = _decimals;
    }

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

    /**
     * @notice Returns the ERC20 allowance of one party to spend on behalf of another.
     * @param owner The party authorising spending of their funds.
     * @param spender The party spending tokenOwner's funds.
     */
    function allowance(address owner, address spender) public view returns (uint) {
        return tokenState.allowance(owner, spender);
    }

    /**
     * @notice Returns the ERC20 token balance of a given account.
     */
    function balanceOf(address account) external view returns (uint) {
        return tokenState.balanceOf(account);
    }

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

    /**
     * @notice Set the address of the TokenState contract.
     * @dev This can be used to "pause" transfer functionality, by pointing the tokenState at 0x000..
     * as balances would be unreachable.
     */
    function setTokenState(TokenState _tokenState) external optionalProxy_onlyOwner {
        tokenState = _tokenState;
        emitTokenStateUpdated(address(_tokenState));
    }

    function _internalTransfer(
        address from,
        address to,
        uint value
    ) internal returns (bool) {
        /* Disallow transfers to irretrievable-addresses. */
        require(to != address(0) && to != address(this) && to != address(proxy), "Cannot transfer to this address");

        // Insufficient balance will be handled by the safe subtraction.
        tokenState.setBalanceOf(from, tokenState.balanceOf(from).sub(value));
        tokenState.setBalanceOf(to, tokenState.balanceOf(to).add(value));

        // Emit a standard ERC20 transfer event
        emitTransfer(from, to, value);

        return true;
    }

    /**
     * @dev Perform an ERC20 token transfer. Designed to be called by transfer functions possessing
     * the onlyProxy or optionalProxy modifiers.
     */
    function _transferByProxy(
        address from,
        address to,
        uint value
    ) internal returns (bool) {
        return _internalTransfer(from, to, value);
    }

    /*
     * @dev Perform an ERC20 token transferFrom. Designed to be called by transferFrom functions
     * possessing the optionalProxy or optionalProxy modifiers.
     */
    function _transferFromByProxy(
        address sender,
        address from,
        address to,
        uint value
    ) internal returns (bool) {
        /* Insufficient allowance will be handled by the safe subtraction. */
        tokenState.setAllowance(from, sender, tokenState.allowance(from, sender).sub(value));
        return _internalTransfer(from, to, value);
    }

    /**
     * @notice Approves spender to transfer on the message sender's behalf.
     */
    function approve(address spender, uint value) public optionalProxy returns (bool) {
        address sender = messageSender;

        tokenState.setAllowance(sender, spender, value);
        emitApproval(sender, spender, value);
        return true;
    }

    /* ========== EVENTS ========== */
    function addressToBytes32(address input) internal pure returns (bytes32) {
        return bytes32(uint256(uint160(input)));
    }

    event Transfer(address indexed from, address indexed to, uint value);
    bytes32 internal constant TRANSFER_SIG = keccak256("Transfer(address,address,uint256)");

    function emitTransfer(
        address from,
        address to,
        uint value
    ) internal {
        proxy._emit(abi.encode(value), 3, TRANSFER_SIG, addressToBytes32(from), addressToBytes32(to), 0);
    }

    event Approval(address indexed owner, address indexed spender, uint value);
    bytes32 internal constant APPROVAL_SIG = keccak256("Approval(address,address,uint256)");

    function emitApproval(
        address owner,
        address spender,
        uint value
    ) internal {
        proxy._emit(abi.encode(value), 3, APPROVAL_SIG, addressToBytes32(owner), addressToBytes32(spender), 0);
    }

    event TokenStateUpdated(address newTokenState);
    bytes32 internal constant TOKENSTATEUPDATED_SIG = keccak256("TokenStateUpdated(address)");

    function emitTokenStateUpdated(address newTokenState) internal {
        proxy._emit(abi.encode(newTokenState), 1, TOKENSTATEUPDATED_SIG, 0, 0, 0);
    }
}


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


interface IVirtualSynth {
    // Views
    function balanceOfUnderlying(address account) external view returns (uint);

    function rate() external view returns (uint);

    function readyToSettle() external view returns (bool);

    function secsLeftInWaitingPeriod() external view returns (uint);

    function settled() external view returns (bool);

    function synth() external view returns (ISynth);

    // Mutative functions
    function settle(address account) external;
}


// https://docs.synthetix.io/contracts/source/interfaces/isynthetix
interface ISynthetix {
    // Views
    function anySynthOrSNXRateIsInvalid() external view returns (bool anyRateInvalid);

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

    function availableSynthCount() external view returns (uint);

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

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

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

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

    function isWaitingPeriod(bytes32 currencyKey) external view returns (bool);

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

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

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

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

    function totalIssuedSynths(bytes32 currencyKey) external view returns (uint);

    function totalIssuedSynthsExcludeOtherCollateral(bytes32 currencyKey) external view returns (uint);

    function transferableSynthetix(address account) external view returns (uint transferable);

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

    // Mutative Functions
    function burnSynths(uint amount) external;

    function burnSynthsOnBehalf(address burnForAddress, uint amount) external;

    function burnSynthsToTarget() external;

    function burnSynthsToTargetOnBehalf(address burnForAddress) external;

    function exchange(
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey
    ) external returns (uint amountReceived);

    function exchangeOnBehalf(
        address exchangeForAddress,
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey
    ) external returns (uint amountReceived);

    function exchangeWithTracking(
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey,
        address rewardAddress,
        bytes32 trackingCode
    ) external returns (uint amountReceived);

    function exchangeWithTrackingForInitiator(
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey,
        address rewardAddress,
        bytes32 trackingCode
    ) external returns (uint amountReceived);

    function exchangeOnBehalfWithTracking(
        address exchangeForAddress,
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey,
        address rewardAddress,
        bytes32 trackingCode
    ) external returns (uint amountReceived);

    function exchangeWithVirtual(
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey,
        bytes32 trackingCode
    ) external returns (uint amountReceived, IVirtualSynth vSynth);

    function exchangeAtomically(
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey,
        bytes32 trackingCode,
        uint minAmount
    ) external returns (uint amountReceived);

    function issueMaxSynths() external;

    function issueMaxSynthsOnBehalf(address issueForAddress) external;

    function issueSynths(uint amount) external;

    function issueSynthsOnBehalf(address issueForAddress, uint amount) external;

    function mint() external returns (bool);

    function settle(bytes32 currencyKey)
        external
        returns (
            uint reclaimed,
            uint refunded,
            uint numEntries
        );

    // Liquidations
    function liquidateDelinquentAccount(address account) external returns (bool);

    function liquidateDelinquentAccountEscrowIndex(address account, uint escrowStartIndex) external returns (bool);

    function liquidateSelf() external returns (bool);

    // Restricted Functions

    function mintSecondary(address account, uint amount) external;

    function mintSecondaryRewards(uint amount) external;

    function burnSecondary(address account, uint amount) external;

    function migrateAccountBalances(address account) external returns (uint totalEscrowRevoked, uint totalLiquidBalance);
}


// https://docs.synthetix.io/contracts/source/interfaces/isystemstatus
interface ISystemStatus {
    struct Status {
        bool canSuspend;
        bool canResume;
    }

    struct Suspension {
        bool suspended;
        // reason is an integer code,
        // 0 => no reason, 1 => upgrading, 2+ => defined by system usage
        uint248 reason;
    }

    // Views
    function accessControl(bytes32 section, address account) external view returns (bool canSuspend, bool canResume);

    function requireSystemActive() external view;

    function systemSuspended() external view returns (bool);

    function requireIssuanceActive() external view;

    function requireExchangeActive() external view;

    function requireFuturesActive() external view;

    function requireFuturesMarketActive(bytes32 marketKey) external view;

    function requireExchangeBetweenSynthsAllowed(bytes32 sourceCurrencyKey, bytes32 destinationCurrencyKey) external view;

    function requireSynthActive(bytes32 currencyKey) external view;

    function synthSuspended(bytes32 currencyKey) external view returns (bool);

    function requireSynthsActive(bytes32 sourceCurrencyKey, bytes32 destinationCurrencyKey) external view;

    function systemSuspension() external view returns (bool suspended, uint248 reason);

    function issuanceSuspension() external view returns (bool suspended, uint248 reason);

    function exchangeSuspension() external view returns (bool suspended, uint248 reason);

    function futuresSuspension() external view returns (bool suspended, uint248 reason);

    function synthExchangeSuspension(bytes32 currencyKey) external view returns (bool suspended, uint248 reason);

    function synthSuspension(bytes32 currencyKey) external view returns (bool suspended, uint248 reason);

    function futuresMarketSuspension(bytes32 marketKey) external view returns (bool suspended, uint248 reason);

    function getSynthExchangeSuspensions(bytes32[] calldata synths)
        external
        view
        returns (bool[] memory exchangeSuspensions, uint256[] memory reasons);

    function getSynthSuspensions(bytes32[] calldata synths)
        external
        view
        returns (bool[] memory suspensions, uint256[] memory reasons);

    function getFuturesMarketSuspensions(bytes32[] calldata marketKeys)
        external
        view
        returns (bool[] memory suspensions, uint256[] memory reasons);

    // Restricted functions
    function suspendIssuance(uint256 reason) external;

    function suspendSynth(bytes32 currencyKey, uint256 reason) external;

    function suspendFuturesMarket(bytes32 marketKey, uint256 reason) external;

    function updateAccessControl(
        bytes32 section,
        address account,
        bool canSuspend,
        bool canResume
    ) external;
}


pragma experimental ABIEncoderV2;


// https://docs.synthetix.io/contracts/source/interfaces/iexchanger
interface IExchanger {
    struct ExchangeEntrySettlement {
        bytes32 src;
        uint amount;
        bytes32 dest;
        uint reclaim;
        uint rebate;
        uint srcRoundIdAtPeriodEnd;
        uint destRoundIdAtPeriodEnd;
        uint timestamp;
    }

    struct ExchangeEntry {
        uint sourceRate;
        uint destinationRate;
        uint destinationAmount;
        uint exchangeFeeRate;
        uint exchangeDynamicFeeRate;
        uint roundIdForSrc;
        uint roundIdForDest;
        uint sourceAmountAfterSettlement;
    }

    // Views
    function calculateAmountAfterSettlement(
        address from,
        bytes32 currencyKey,
        uint amount,
        uint refunded
    ) external view returns (uint amountAfterSettlement);

    function isSynthRateInvalid(bytes32 currencyKey) external view returns (bool);

    function maxSecsLeftInWaitingPeriod(address account, bytes32 currencyKey) external view returns (uint);

    function settlementOwing(address account, bytes32 currencyKey)
        external
        view
        returns (
            uint reclaimAmount,
            uint rebateAmount,
            uint numEntries
        );

    function hasWaitingPeriodOrSettlementOwing(address account, bytes32 currencyKey) external view returns (bool);

    function feeRateForExchange(bytes32 sourceCurrencyKey, bytes32 destinationCurrencyKey) external view returns (uint);

    function dynamicFeeRateForExchange(bytes32 sourceCurrencyKey, bytes32 destinationCurrencyKey)
        external
        view
        returns (uint feeRate, bool tooVolatile);

    function getAmountsForExchange(
        uint sourceAmount,
        bytes32 sourceCurrencyKey,
        bytes32 destinationCurrencyKey
    )
        external
        view
        returns (
            uint amountReceived,
            uint fee,
            uint exchangeFeeRate
        );

    function priceDeviationThresholdFactor() external view returns (uint);

    function waitingPeriodSecs() external view returns (uint);

    function lastExchangeRate(bytes32 currencyKey) external view returns (uint);

    // Mutative functions
    function exchange(
        address exchangeForAddress,
        address from,
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey,
        address destinationAddress,
        bool virtualSynth,
        address rewardAddress,
        bytes32 trackingCode
    ) external returns (uint amountReceived, IVirtualSynth vSynth);

    function exchangeAtomically(
        address from,
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey,
        address destinationAddress,
        bytes32 trackingCode,
        uint minAmount
    ) external returns (uint amountReceived);

    function settle(address from, bytes32 currencyKey)
        external
        returns (
            uint reclaimed,
            uint refunded,
            uint numEntries
        );
}

// Used to have strongly-typed access to internal mutative functions in Synthetix
interface ISynthetixInternal {
    function emitExchangeTracking(
        bytes32 trackingCode,
        bytes32 toCurrencyKey,
        uint256 toAmount,
        uint256 fee
    ) external;

    function emitSynthExchange(
        address account,
        bytes32 fromCurrencyKey,
        uint fromAmount,
        bytes32 toCurrencyKey,
        uint toAmount,
        address toAddress
    ) external;

    function emitAtomicSynthExchange(
        address account,
        bytes32 fromCurrencyKey,
        uint fromAmount,
        bytes32 toCurrencyKey,
        uint toAmount,
        address toAddress
    ) external;

    function emitExchangeReclaim(
        address account,
        bytes32 currencyKey,
        uint amount
    ) external;

    function emitExchangeRebate(
        address account,
        bytes32 currencyKey,
        uint amount
    ) external;
}

interface IExchangerInternalDebtCache {
    function updateCachedSynthDebtsWithRates(bytes32[] calldata currencyKeys, uint[] calldata currencyRates) external;

    function updateCachedSynthDebts(bytes32[] calldata currencyKeys) external;
}


// https://docs.synthetix.io/contracts/source/interfaces/irewardsdistribution
interface IRewardsDistribution {
    // Structs
    struct DistributionData {
        address destination;
        uint amount;
    }

    // Views
    function authority() external view returns (address);

    function distributions(uint index) external view returns (address destination, uint amount); // DistributionData

    function distributionsLength() external view returns (uint);

    // Mutative Functions
    function distributeRewards(uint amount) external returns (bool);
}


interface ILiquidator {
    // Views
    function issuanceRatio() external view returns (uint);

    function liquidationDelay() external view returns (uint);

    function liquidationRatio() external view returns (uint);

    function liquidationEscrowDuration() external view returns (uint);

    function liquidationPenalty() external view returns (uint);

    function selfLiquidationPenalty() external view returns (uint);

    function liquidateReward() external view returns (uint);

    function flagReward() external view returns (uint);

    function liquidationCollateralRatio() external view returns (uint);

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

    function getLiquidationCallerForAccount(address account) external view returns (address);

    function isLiquidationOpen(address account, bool isSelfLiquidation) external view returns (bool);

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

    function calculateAmountToFixCollateral(
        uint debtBalance,
        uint collateral,
        uint penalty
    ) external view returns (uint);

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

    // Mutative Functions
    function flagAccountForLiquidation(address account) external;

    // Restricted: used internally to Synthetix contracts
    function removeAccountInLiquidation(address account) external;

    function checkAndRemoveAccountInLiquidation(address account) external;
}


interface ILiquidatorRewards {
    // Views

    function earned(address account) external view returns (uint256);

    // Mutative

    function getReward(address account) external;

    function notifyRewardAmount(uint256 reward) external;

    function updateEntry(address account) external;
}


library VestingEntries {
    struct VestingEntry {
        uint64 endTime;
        uint256 escrowAmount;
    }
    struct VestingEntryWithID {
        uint64 endTime;
        uint256 escrowAmount;
        uint256 entryID;
    }
}

/// SIP-252: this is the interface for immutable V2 escrow (renamed with suffix Frozen).
/// These sources need to exist here and match on-chain frozen contracts for tests and reference.
/// the reason for the naming mess is that the immutable LiquidatorRewards expects a working
/// RewardEscrowV2 resolver entry for its getReward method, so the "new" (would be V3)
/// needs to be found at that entry for liq-rewards to function.
interface IRewardEscrowV2Frozen {
    // Views
    function balanceOf(address account) external view returns (uint);

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

    function totalEscrowedBalance() external view returns (uint);

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

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

    function getVestingQuantity(address account, uint256[] calldata entryIDs) external view returns (uint);

    function getVestingSchedules(
        address account,
        uint256 index,
        uint256 pageSize
    ) external view returns (VestingEntries.VestingEntryWithID[] memory);

    function getAccountVestingEntryIDs(
        address account,
        uint256 index,
        uint256 pageSize
    ) external view returns (uint256[] memory);

    function getVestingEntryClaimable(address account, uint256 entryID) external view returns (uint);

    function getVestingEntry(address account, uint256 entryID) external view returns (uint64, uint256);

    // Mutative functions
    function vest(uint256[] calldata entryIDs) external;

    function createEscrowEntry(
        address beneficiary,
        uint256 deposit,
        uint256 duration
    ) external;

    function appendVestingEntry(
        address account,
        uint256 quantity,
        uint256 duration
    ) external;

    function migrateVestingSchedule(address _addressToMigrate) external;

    function migrateAccountEscrowBalances(
        address[] calldata accounts,
        uint256[] calldata escrowBalances,
        uint256[] calldata vestedBalances
    ) external;

    // Account Merging
    function startMergingWindow() external;

    function mergeAccount(address accountToMerge, uint256[] calldata entryIDs) external;

    function nominateAccountToMerge(address account) external;

    function accountMergingIsOpen() external view returns (bool);

    // L2 Migration
    function importVestingEntries(
        address account,
        uint256 escrowedAmount,
        VestingEntries.VestingEntry[] calldata vestingEntries
    ) external;

    // Return amount of SNX transfered to SynthetixBridgeToOptimism deposit contract
    function burnForMigration(address account, uint256[] calldata entryIDs)
        external
        returns (uint256 escrowedAccountBalance, VestingEntries.VestingEntry[] memory vestingEntries);

    function nextEntryId() external view returns (uint);

    function vestingSchedules(address account, uint256 entryId) external view returns (VestingEntries.VestingEntry memory);

    function accountVestingEntryIDs(address account, uint256 index) external view returns (uint);

    //function totalEscrowedAccountBalance(address account) external view returns (uint);
    //function totalVestedAccountBalance(address account) external view returns (uint);
}


interface IRewardEscrowV2Storage {
    /// Views
    function numVestingEntries(address account) external view returns (uint);

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

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

    function totalEscrowedBalance() external view returns (uint);

    function nextEntryId() external view returns (uint);

    function vestingSchedules(address account, uint256 entryId) external view returns (VestingEntries.VestingEntry memory);

    function accountVestingEntryIDs(address account, uint256 index) external view returns (uint);

    /// Mutative
    function setZeroAmount(address account, uint entryId) external;

    function setZeroAmountUntilTarget(
        address account,
        uint startIndex,
        uint targetAmount
    )
        external
        returns (
            uint total,
            uint endIndex,
            uint lastEntryTime
        );

    function updateEscrowAccountBalance(address account, int delta) external;

    function updateVestedAccountBalance(address account, int delta) external;

    function updateTotalEscrowedBalance(int delta) external;

    function addVestingEntry(address account, VestingEntries.VestingEntry calldata entry) external returns (uint);

    // setFallbackRewardEscrow is used for configuration but not used by contracts
}

/// this should remain backwards compatible to IRewardEscrowV2Frozen
/// ideally this would be done by inheriting from that interface
/// but solidity v0.5 doesn't support interface inheritance
interface IRewardEscrowV2 {
    // Views
    function balanceOf(address account) external view returns (uint);

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

    function totalEscrowedBalance() external view returns (uint);

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

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

    function getVestingQuantity(address account, uint256[] calldata entryIDs) external view returns (uint);

    function getVestingSchedules(
        address account,
        uint256 index,
        uint256 pageSize
    ) external view returns (VestingEntries.VestingEntryWithID[] memory);

    function getAccountVestingEntryIDs(
        address account,
        uint256 index,
        uint256 pageSize
    ) external view returns (uint256[] memory);

    function getVestingEntryClaimable(address account, uint256 entryID) external view returns (uint);

    function getVestingEntry(address account, uint256 entryID) external view returns (uint64, uint256);

    // Mutative functions
    function vest(uint256[] calldata entryIDs) external;

    function createEscrowEntry(
        address beneficiary,
        uint256 deposit,
        uint256 duration
    ) external;

    function appendVestingEntry(
        address account,
        uint256 quantity,
        uint256 duration
    ) external;

    function migrateVestingSchedule(address _addressToMigrate) external;

    function migrateAccountEscrowBalances(
        address[] calldata accounts,
        uint256[] calldata escrowBalances,
        uint256[] calldata vestedBalances
    ) external;

    // Account Merging
    function startMergingWindow() external;

    function mergeAccount(address accountToMerge, uint256[] calldata entryIDs) external;

    function nominateAccountToMerge(address account) external;

    function accountMergingIsOpen() external view returns (bool);

    // L2 Migration
    function importVestingEntries(
        address account,
        uint256 escrowedAmount,
        VestingEntries.VestingEntry[] calldata vestingEntries
    ) external;

    // Return amount of SNX transfered to SynthetixBridgeToOptimism deposit contract
    function burnForMigration(address account, uint256[] calldata entryIDs)
        external
        returns (uint256 escrowedAccountBalance, VestingEntries.VestingEntry[] memory vestingEntries);

    function nextEntryId() external view returns (uint);

    function vestingSchedules(address account, uint256 entryId) external view returns (VestingEntries.VestingEntry memory);

    function accountVestingEntryIDs(address account, uint256 index) external view returns (uint);

    /// below are methods not available in IRewardEscrowV2Frozen

    // revoke entries for liquidations (access controlled to Synthetix)
    function revokeFrom(
        address account,
        address recipient,
        uint targetAmount,
        uint startIndex
    ) external;
}


// Inheritance


// Internal references


contract BaseSynthetix is IERC20, ExternStateToken, MixinResolver, ISynthetix {
    // ========== STATE VARIABLES ==========

    // Available Synths which can be used with the system
    string public constant TOKEN_NAME = "Synthetix Network Token";
    string public constant TOKEN_SYMBOL = "SNX";
    uint8 public constant DECIMALS = 18;
    bytes32 public constant sUSD = "sUSD";

    // ========== ADDRESS RESOLVER CONFIGURATION ==========
    bytes32 private constant CONTRACT_SYSTEMSTATUS = "SystemStatus";
    bytes32 private constant CONTRACT_EXCHANGER = "Exchanger";
    bytes32 private constant CONTRACT_ISSUER = "Issuer";
    bytes32 private constant CONTRACT_REWARDSDISTRIBUTION = "RewardsDistribution";
    bytes32 private constant CONTRACT_LIQUIDATORREWARDS = "LiquidatorRewards";
    bytes32 private constant CONTRACT_LIQUIDATOR = "Liquidator";
    bytes32 private constant CONTRACT_REWARDESCROW_V2 = "RewardEscrowV2";
    bytes32 private constant CONTRACT_V3_LEGACYMARKET = "LegacyMarket";
    bytes32 private constant CONTRACT_DEBT_MIGRATOR_ON_ETHEREUM = "DebtMigratorOnEthereum";

    // ========== CONSTRUCTOR ==========

    constructor(
        address payable _proxy,
        TokenState _tokenState,
        address _owner,
        uint _totalSupply,
        address _resolver
    )
        public
        ExternStateToken(_proxy, _tokenState, TOKEN_NAME, TOKEN_SYMBOL, _totalSupply, DECIMALS, _owner)
        MixinResolver(_resolver)
    {}

    // ========== VIEWS ==========

    // Note: use public visibility so that it can be invoked in a subclass
    function resolverAddressesRequired() public view returns (bytes32[] memory addresses) {
        addresses = new bytes32[](7);
        addresses[0] = CONTRACT_SYSTEMSTATUS;
        addresses[1] = CONTRACT_EXCHANGER;
        addresses[2] = CONTRACT_ISSUER;
        addresses[3] = CONTRACT_REWARDSDISTRIBUTION;
        addresses[4] = CONTRACT_LIQUIDATORREWARDS;
        addresses[5] = CONTRACT_LIQUIDATOR;
        addresses[6] = CONTRACT_REWARDESCROW_V2;
    }

    function systemStatus() internal view returns (ISystemStatus) {
        return ISystemStatus(requireAndGetAddress(CONTRACT_SYSTEMSTATUS));
    }

    function exchanger() internal view returns (IExchanger) {
        return IExchanger(requireAndGetAddress(CONTRACT_EXCHANGER));
    }

    function issuer() internal view returns (IIssuer) {
        return IIssuer(requireAndGetAddress(CONTRACT_ISSUER));
    }

    function rewardsDistribution() internal view returns (IRewardsDistribution) {
        return IRewardsDistribution(requireAndGetAddress(CONTRACT_REWARDSDISTRIBUTION));
    }

    function liquidatorRewards() internal view returns (ILiquidatorRewards) {
        return ILiquidatorRewards(requireAndGetAddress(CONTRACT_LIQUIDATORREWARDS));
    }

    function rewardEscrowV2() internal view returns (IRewardEscrowV2) {
        return IRewardEscrowV2(requireAndGetAddress(CONTRACT_REWARDESCROW_V2));
    }

    function liquidator() internal view returns (ILiquidator) {
        return ILiquidator(requireAndGetAddress(CONTRACT_LIQUIDATOR));
    }

    function debtBalanceOf(address account, bytes32 currencyKey) external view returns (uint) {
        return issuer().debtBalanceOf(account, currencyKey);
    }

    function totalIssuedSynths(bytes32 currencyKey) external view returns (uint) {
        return issuer().totalIssuedSynths(currencyKey, false);
    }

    function totalIssuedSynthsExcludeOtherCollateral(bytes32 currencyKey) external view returns (uint) {
        return issuer().totalIssuedSynths(currencyKey, true);
    }

    function availableCurrencyKeys() external view returns (bytes32[] memory) {
        return issuer().availableCurrencyKeys();
    }

    function availableSynthCount() external view returns (uint) {
        return issuer().availableSynthCount();
    }

    function availableSynths(uint index) external view returns (ISynth) {
        return issuer().availableSynths(index);
    }

    function synths(bytes32 currencyKey) external view returns (ISynth) {
        return issuer().synths(currencyKey);
    }

    function synthsByAddress(address synthAddress) external view returns (bytes32) {
        return issuer().synthsByAddress(synthAddress);
    }

    function isWaitingPeriod(bytes32 currencyKey) external view returns (bool) {
        return exchanger().maxSecsLeftInWaitingPeriod(messageSender, currencyKey) > 0;
    }

    function anySynthOrSNXRateIsInvalid() external view returns (bool anyRateInvalid) {
        return issuer().anySynthOrSNXRateIsInvalid();
    }

    function maxIssuableSynths(address account) external view returns (uint maxIssuable) {
        return issuer().maxIssuableSynths(account);
    }

    function remainingIssuableSynths(address account)
        external
        view
        returns (
            uint maxIssuable,
            uint alreadyIssued,
            uint totalSystemDebt
        )
    {
        return issuer().remainingIssuableSynths(account);
    }

    function collateralisationRatio(address _issuer) external view returns (uint) {
        return issuer().collateralisationRatio(_issuer);
    }

    function collateral(address account) external view returns (uint) {
        return issuer().collateral(account);
    }

    function transferableSynthetix(address account) external view returns (uint transferable) {
        (transferable, ) = issuer().transferableSynthetixAndAnyRateIsInvalid(account, tokenState.balanceOf(account));
    }

    /// the index of the first non zero RewardEscrowV2 entry for an account in order of iteration over accountVestingEntryIDs.
    /// This is intended as a convenience off-chain view for liquidators to calculate the startIndex to pass
    /// into liquidateDelinquentAccountEscrowIndex to save gas.
    function getFirstNonZeroEscrowIndex(address account) external view returns (uint) {
        uint numIds = rewardEscrowV2().numVestingEntries(account);
        uint entryID;
        VestingEntries.VestingEntry memory entry;
        for (uint i = 0; i < numIds; i++) {
            entryID = rewardEscrowV2().accountVestingEntryIDs(account, i);
            entry = rewardEscrowV2().vestingSchedules(account, entryID);
            if (entry.escrowAmount > 0) {
                return i;
            }
        }
        revert("all entries are zero");
    }

    function _canTransfer(address account, uint value) internal view returns (bool) {
        // Always allow legacy market to transfer
        // note if legacy market is not yet available this will just return 0 address and it  will never be true
        address legacyMarketAddress = resolver.getAddress(CONTRACT_V3_LEGACYMARKET);
        if ((messageSender != address(0) && messageSender == legacyMarketAddress) || account == legacyMarketAddress) {
            return true;
        }

        if (issuer().debtBalanceOf(account, sUSD) > 0) {
            (uint transferable, bool anyRateIsInvalid) =
                issuer().transferableSynthetixAndAnyRateIsInvalid(account, tokenState.balanceOf(account));
            require(value <= transferable, "Cannot transfer staked or escrowed SNX");
            require(!anyRateIsInvalid, "A synth or SNX rate is invalid");
        }

        return true;
    }

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

    function exchange(
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey
    ) external exchangeActive(sourceCurrencyKey, destinationCurrencyKey) optionalProxy returns (uint amountReceived) {
        (amountReceived, ) = exchanger().exchange(
            messageSender,
            messageSender,
            sourceCurrencyKey,
            sourceAmount,
            destinationCurrencyKey,
            messageSender,
            false,
            messageSender,
            bytes32(0)
        );
    }

    function exchangeOnBehalf(
        address exchangeForAddress,
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey
    ) external exchangeActive(sourceCurrencyKey, destinationCurrencyKey) optionalProxy returns (uint amountReceived) {
        (amountReceived, ) = exchanger().exchange(
            exchangeForAddress,
            messageSender,
            sourceCurrencyKey,
            sourceAmount,
            destinationCurrencyKey,
            exchangeForAddress,
            false,
            exchangeForAddress,
            bytes32(0)
        );
    }

    function settle(bytes32 currencyKey)
        external
        optionalProxy
        returns (
            uint reclaimed,
            uint refunded,
            uint numEntriesSettled
        )
    {
        return exchanger().settle(messageSender, currencyKey);
    }

    function exchangeWithTracking(
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey,
        address rewardAddress,
        bytes32 trackingCode
    ) external exchangeActive(sourceCurrencyKey, destinationCurrencyKey) optionalProxy returns (uint amountReceived) {
        (amountReceived, ) = exchanger().exchange(
            messageSender,
            messageSender,
            sourceCurrencyKey,
            sourceAmount,
            destinationCurrencyKey,
            messageSender,
            false,
            rewardAddress,
            trackingCode
        );
    }

    function exchangeOnBehalfWithTracking(
        address exchangeForAddress,
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey,
        address rewardAddress,
        bytes32 trackingCode
    ) external exchangeActive(sourceCurrencyKey, destinationCurrencyKey) optionalProxy returns (uint amountReceived) {
        (amountReceived, ) = exchanger().exchange(
            exchangeForAddress,
            messageSender,
            sourceCurrencyKey,
            sourceAmount,
            destinationCurrencyKey,
            exchangeForAddress,
            false,
            rewardAddress,
            trackingCode
        );
    }

    function transfer(address to, uint value) external onlyProxyOrInternal systemActive returns (bool) {
        // Ensure they're not trying to exceed their locked amount -- only if they have debt.
        _canTransfer(messageSender, value);

        // Perform the transfer: if there is a problem an exception will be thrown in this call.
        _transferByProxy(messageSender, to, value);

        return true;
    }

    function transferFrom(
        address from,
        address to,
        uint value
    ) external onlyProxyOrInternal systemActive returns (bool) {
        // Ensure they're not trying to exceed their locked amount -- only if they have debt.
        _canTransfer(from, value);

        // Perform the transfer: if there is a problem,
        // an exception will be thrown in this call.
        return _transferFromByProxy(messageSender, from, to, value);
    }

    // SIP-252: migration of SNX token balance from old to new escrow rewards contract
    function migrateEscrowContractBalance() external onlyOwner {
        address from = resolver.requireAndGetAddress("RewardEscrowV2Frozen", "Old escrow address unset");
        // technically the below could use `rewardEscrowV2()`, but in the case of a migration it's better to avoid
        // using the cached value and read the most updated one directly from the resolver
        address to = resolver.requireAndGetAddress("RewardEscrowV2", "New escrow address unset");
        require(to != from, "cannot migrate to same address");

        uint currentBalance = tokenState.balanceOf(from);
        // allow no-op for idempotent migration steps in case action was performed already
        if (currentBalance > 0) {
            _internalTransfer(from, to, currentBalance);
        }
    }

    function issueSynths(uint amount) external issuanceActive optionalProxy {
        return issuer().issueSynths(messageSender, amount);
    }

    function issueSynthsOnBehalf(address issueForAddress, uint amount) external issuanceActive optionalProxy {
        return issuer().issueSynthsOnBehalf(issueForAddress, messageSender, amount);
    }

    function issueMaxSynths() external issuanceActive optionalProxy {
        return issuer().issueMaxSynths(messageSender);
    }

    function issueMaxSynthsOnBehalf(address issueForAddress) external issuanceActive optionalProxy {
        return issuer().issueMaxSynthsOnBehalf(issueForAddress, messageSender);
    }

    function burnSynths(uint amount) external issuanceActive optionalProxy {
        return issuer().burnSynths(messageSender, amount);
    }

    function burnSynthsOnBehalf(address burnForAddress, uint amount) external issuanceActive optionalProxy {
        return issuer().burnSynthsOnBehalf(burnForAddress, messageSender, amount);
    }

    function burnSynthsToTarget() external issuanceActive optionalProxy {
        return issuer().burnSynthsToTarget(messageSender);
    }

    function burnSynthsToTargetOnBehalf(address burnForAddress) external issuanceActive optionalProxy {
        return issuer().burnSynthsToTargetOnBehalf(burnForAddress, messageSender);
    }

    /// @notice Force liquidate a delinquent account and distribute the redeemed SNX rewards amongst the appropriate recipients.
    /// @dev The SNX transfers will revert if the amount to send is more than balanceOf account (i.e. due to escrowed balance).
    function liquidateDelinquentAccount(address account) external systemActive optionalProxy returns (bool) {
        return _liquidateDelinquentAccount(account, 0, messageSender);
    }

    /// @param escrowStartIndex: index into the account's vesting entries list to start iterating from
    /// when liquidating from escrow in order to save gas (the default method uses 0 as default)
    function liquidateDelinquentAccountEscrowIndex(address account, uint escrowStartIndex)
        external
        systemActive
        optionalProxy
        returns (bool)
    {
        return _liquidateDelinquentAccount(account, escrowStartIndex, messageSender);
    }

    /// @notice Force liquidate a delinquent account and distribute the redeemed SNX rewards amongst the appropriate recipients.
    /// @dev The SNX transfers will revert if the amount to send is more than balanceOf account (i.e. due to escrowed balance).
    function _liquidateDelinquentAccount(
        address account,
        uint escrowStartIndex,
        address liquidatorAccount
    ) internal returns (bool) {
        // ensure the user has no liquidation rewards (also counted towards collateral) outstanding
        liquidatorRewards().getReward(account);

        (uint totalRedeemed, uint debtToRemove, uint escrowToLiquidate) = issuer().liquidateAccount(account, false);

        // This transfers the to-be-liquidated part of escrow to the account (!) as liquid SNX.
        // It is transferred to the account instead of to the rewards because of the liquidator / flagger
        // rewards that may need to be paid (so need to be transferrable, to avoid edge cases)
        if (escrowToLiquidate > 0) {
            rewardEscrowV2().revokeFrom(account, account, escrowToLiquidate, escrowStartIndex);
        }

        emitAccountLiquidated(account, totalRedeemed, debtToRemove, liquidatorAccount);

        // First, pay out the flag and liquidate rewards.
        uint flagReward = liquidator().flagReward();
        uint liquidateReward = liquidator().liquidateReward();

        // Transfer the flagReward to the account who flagged this account for liquidation.
        address flagger = liquidator().getLiquidationCallerForAccount(account);
        bool flagRewardTransferSucceeded = _transferByProxy(account, flagger, flagReward);
        require(flagRewardTransferSucceeded, "Flag reward transfer did not succeed");

        // Transfer the liquidateReward to liquidator (the account who invoked this liquidation).
        bool liquidateRewardTransferSucceeded = _transferByProxy(account, liquidatorAccount, liquidateReward);
        require(liquidateRewardTransferSucceeded, "Liquidate reward transfer did not succeed");

        if (totalRedeemed > 0) {
            // Send the remaining SNX to the LiquidatorRewards contract.
            bool liquidatorRewardTransferSucceeded = _transferByProxy(account, address(liquidatorRewards()), totalRedeemed);
            require(liquidatorRewardTransferSucceeded, "Transfer to LiquidatorRewards failed");

            // Inform the LiquidatorRewards contract about the incoming SNX rewards.
            liquidatorRewards().notifyRewardAmount(totalRedeemed);
        }

        return true;
    }

    /// @notice Allows an account to self-liquidate anytime its c-ratio is below the target issuance ratio.
    function liquidateSelf() external systemActive optionalProxy returns (bool) {
        // must store liquidated account address because below functions may attempt to transfer SNX which changes messageSender
        address liquidatedAccount = messageSender;

        // ensure the user has no liquidation rewards (also counted towards collateral) outstanding
        liquidatorRewards().getReward(liquidatedAccount);

        // Self liquidate the account (`isSelfLiquidation` flag must be set to `true`).
        // escrowToLiquidate is unused because it cannot be used for self-liquidations
        (uint totalRedeemed, uint debtRemoved, ) = issuer().liquidateAccount(liquidatedAccount, true);
        require(debtRemoved > 0, "cannot self liquidate");

        emitAccountLiquidated(liquidatedAccount, totalRedeemed, debtRemoved, liquidatedAccount);

        // Transfer the redeemed SNX to the LiquidatorRewards contract.
        // Reverts if amount to redeem is more than balanceOf account (i.e. due to escrowed balance).
        bool success = _transferByProxy(liquidatedAccount, address(liquidatorRewards()), totalRedeemed);
        require(success, "Transfer to LiquidatorRewards failed");

        // Inform the LiquidatorRewards contract about the incoming SNX rewards.
        liquidatorRewards().notifyRewardAmount(totalRedeemed);

        return success;
    }

    function migrateAccountBalances(address account)
        external
        systemActive
        returns (uint totalEscrowRevoked, uint totalLiquidBalance)
    {
        address debtMigratorOnEthereum = resolver.getAddress(CONTRACT_DEBT_MIGRATOR_ON_ETHEREUM);
        require(
            msg.sender == debtMigratorOnEthereum || msg.sender == resolver.getAddress(CONTRACT_V3_LEGACYMARKET),
            "Only L1 DebtMigrator or LegacyMarket"
        );

        // get their liquid SNX balance and transfer it to the migrator contract
        totalLiquidBalance = tokenState.balanceOf(account);
        if (totalLiquidBalance > 0) {
            bool succeeded = _transferByProxy(account, msg.sender, totalLiquidBalance);
            require(succeeded, "snx transfer failed");
        }

        // get their escrowed SNX balance and revoke it all
        totalEscrowRevoked = rewardEscrowV2().totalEscrowedAccountBalance(account);
        if (totalEscrowRevoked > 0) {
            rewardEscrowV2().revokeFrom(account, msg.sender, totalEscrowRevoked, 0);
        }
    }

    function exchangeWithTrackingForInitiator(
        bytes32,
        uint,
        bytes32,
        address,
        bytes32
    ) external returns (uint) {
        _notImplemented();
    }

    function exchangeWithVirtual(
        bytes32,
        uint,
        bytes32,
        bytes32
    ) external returns (uint, IVirtualSynth) {
        _notImplemented();
    }

    function exchangeAtomically(
        bytes32,
        uint,
        bytes32,
        bytes32,
        uint
    ) external returns (uint) {
        _notImplemented();
    }

    function mint() external returns (bool) {
        _notImplemented();
    }

    function mintSecondary(address, uint) external {
        _notImplemented();
    }

    function mintSecondaryRewards(uint) external {
        _notImplemented();
    }

    function burnSecondary(address, uint) external {
        _notImplemented();
    }

    function _notImplemented() internal pure {
        revert("Cannot be run on this layer");
    }

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

    modifier systemActive() {
        _systemActive();
        _;
    }

    function _systemActive() private view {
        systemStatus().requireSystemActive();
    }

    modifier issuanceActive() {
        _issuanceActive();
        _;
    }

    function _issuanceActive() private view {
        systemStatus().requireIssuanceActive();
    }

    modifier exchangeActive(bytes32 src, bytes32 dest) {
        _exchangeActive(src, dest);
        _;
    }

    function _exchangeActive(bytes32 src, bytes32 dest) private view {
        systemStatus().requireExchangeBetweenSynthsAllowed(src, dest);
    }

    modifier onlyExchanger() {
        _onlyExchanger();
        _;
    }

    function _onlyExchanger() private view {
        require(msg.sender == address(exchanger()), "Only Exchanger can invoke this");
    }

    modifier onlyProxyOrInternal {
        _onlyProxyOrInternal();
        _;
    }

    function _onlyProxyOrInternal() internal {
        if (msg.sender == address(proxy)) {
            // allow proxy through, messageSender should be already set correctly
            return;
        } else if (_isInternalTransferCaller(msg.sender)) {
            // optionalProxy behaviour only for the internal legacy contracts
            messageSender = msg.sender;
        } else {
            revert("Only the proxy can call");
        }
    }

    /// some legacy internal contracts use transfer methods directly on implementation
    /// which isn't supported due to SIP-238 for other callers
    function _isInternalTransferCaller(address caller) internal view returns (bool) {
        // These entries are not required or cached in order to allow them to not exist (==address(0))
        // e.g. due to not being available on L2 or at some future point in time.
        return
            // ordered to reduce gas for more frequent calls, bridge first, vesting and migrating after, legacy last
            caller == resolver.getAddress("SynthetixBridgeToOptimism") ||
            caller == resolver.getAddress("RewardEscrowV2") ||
            caller == resolver.getAddress("DebtMigratorOnOptimism") ||
            // legacy contracts
            caller == resolver.getAddress("RewardEscrow") ||
            caller == resolver.getAddress("SynthetixEscrow") ||
            caller == resolver.getAddress("Depot");
    }

    // ========== EVENTS ==========
    event AccountLiquidated(address indexed account, uint snxRedeemed, uint amountLiquidated, address liquidator);
    bytes32 internal constant ACCOUNTLIQUIDATED_SIG = keccak256("AccountLiquidated(address,uint256,uint256,address)");

    function emitAccountLiquidated(
        address account,
        uint256 snxRedeemed,
        uint256 amountLiquidated,
        address liquidator
    ) internal {
        proxy._emit(
            abi.encode(snxRedeemed, amountLiquidated, liquidator),
            2,
            ACCOUNTLIQUIDATED_SIG,
            addressToBytes32(account),
            0,
            0
        );
    }

    event SynthExchange(
        address indexed account,
        bytes32 fromCurrencyKey,
        uint256 fromAmount,
        bytes32 toCurrencyKey,
        uint256 toAmount,
        address toAddress
    );
    bytes32 internal constant SYNTH_EXCHANGE_SIG =
        keccak256("SynthExchange(address,bytes32,uint256,bytes32,uint256,address)");

    function emitSynthExchange(
        address account,
        bytes32 fromCurrencyKey,
        uint256 fromAmount,
        bytes32 toCurrencyKey,
        uint256 toAmount,
        address toAddress
    ) external onlyExchanger {
        proxy._emit(
            abi.encode(fromCurrencyKey, fromAmount, toCurrencyKey, toAmount, toAddress),
            2,
            SYNTH_EXCHANGE_SIG,
            addressToBytes32(account),
            0,
            0
        );
    }

    event ExchangeTracking(bytes32 indexed trackingCode, bytes32 toCurrencyKey, uint256 toAmount, uint256 fee);
    bytes32 internal constant EXCHANGE_TRACKING_SIG = keccak256("ExchangeTracking(bytes32,bytes32,uint256,uint256)");

    function emitExchangeTracking(
        bytes32 trackingCode,
        bytes32 toCurrencyKey,
        uint256 toAmount,
        uint256 fee
    ) external onlyExchanger {
        proxy._emit(abi.encode(toCurrencyKey, toAmount, fee), 2, EXCHANGE_TRACKING_SIG, trackingCode, 0, 0);
    }

    event ExchangeReclaim(address indexed account, bytes32 currencyKey, uint amount);
    bytes32 internal constant EXCHANGERECLAIM_SIG = keccak256("ExchangeReclaim(address,bytes32,uint256)");

    function emitExchangeReclaim(
        address account,
        bytes32 currencyKey,
        uint256 amount
    ) external onlyExchanger {
        proxy._emit(abi.encode(currencyKey, amount), 2, EXCHANGERECLAIM_SIG, addressToBytes32(account), 0, 0);
    }

    event ExchangeRebate(address indexed account, bytes32 currencyKey, uint amount);
    bytes32 internal constant EXCHANGEREBATE_SIG = keccak256("ExchangeRebate(address,bytes32,uint256)");

    function emitExchangeRebate(
        address account,
        bytes32 currencyKey,
        uint256 amount
    ) external onlyExchanger {
        proxy._emit(abi.encode(currencyKey, amount), 2, EXCHANGEREBATE_SIG, addressToBytes32(account), 0, 0);
    }
}


// https://docs.synthetix.io/contracts/source/interfaces/irewardescrow
interface IRewardEscrow {
    // Views
    function balanceOf(address account) external view returns (uint);

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

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

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

    function getVestingScheduleEntry(address account, uint index) external view returns (uint[2] memory);

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

    // Mutative functions
    function appendVestingEntry(address account, uint quantity) external;

    function vest() external;
}


// https://docs.synthetix.io/contracts/source/interfaces/isupplyschedule
interface ISupplySchedule {
    // Views
    function mintableSupply() external view returns (uint);

    function isMintable() external view returns (bool);

    function minterReward() external view returns (uint);

    // Mutative functions
    function recordMintEvent(uint supplyMinted) external returns (uint);
}


// Inheritance


// Internal references


// https://docs.synthetix.io/contracts/source/contracts/synthetix
contract Synthetix is BaseSynthetix {
    bytes32 public constant CONTRACT_NAME = "Synthetix";

    // ========== ADDRESS RESOLVER CONFIGURATION ==========
    bytes32 private constant CONTRACT_REWARD_ESCROW = "RewardEscrow";
    bytes32 private constant CONTRACT_SUPPLYSCHEDULE = "SupplySchedule";

    // ========== CONSTRUCTOR ==========

    constructor(
        address payable _proxy,
        TokenState _tokenState,
        address _owner,
        uint _totalSupply,
        address _resolver
    ) public BaseSynthetix(_proxy, _tokenState, _owner, _totalSupply, _resolver) {}

    function resolverAddressesRequired() public view returns (bytes32[] memory addresses) {
        bytes32[] memory existingAddresses = BaseSynthetix.resolverAddressesRequired();
        bytes32[] memory newAddresses = new bytes32[](2);
        newAddresses[0] = CONTRACT_REWARD_ESCROW;
        newAddresses[1] = CONTRACT_SUPPLYSCHEDULE;
        return combineArrays(existingAddresses, newAddresses);
    }

    // ========== VIEWS ==========

    function rewardEscrow() internal view returns (IRewardEscrow) {
        return IRewardEscrow(requireAndGetAddress(CONTRACT_REWARD_ESCROW));
    }

    function supplySchedule() internal view returns (ISupplySchedule) {
        return ISupplySchedule(requireAndGetAddress(CONTRACT_SUPPLYSCHEDULE));
    }

    // ========== OVERRIDDEN FUNCTIONS ==========

    function exchangeWithVirtual(
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey,
        bytes32 trackingCode
    )
        external
        exchangeActive(sourceCurrencyKey, destinationCurrencyKey)
        optionalProxy
        returns (uint amountReceived, IVirtualSynth vSynth)
    {
        return
            exchanger().exchange(
                messageSender,
                messageSender,
                sourceCurrencyKey,
                sourceAmount,
                destinationCurrencyKey,
                messageSender,
                true,
                messageSender,
                trackingCode
            );
    }

    // SIP-140 The initiating user of this exchange will receive the proceeds of the exchange
    // Note: this function may have unintended consequences if not understood correctly. Please
    // read SIP-140 for more information on the use-case
    function exchangeWithTrackingForInitiator(
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey,
        address rewardAddress,
        bytes32 trackingCode
    ) external exchangeActive(sourceCurrencyKey, destinationCurrencyKey) optionalProxy returns (uint amountReceived) {
        (amountReceived, ) = exchanger().exchange(
            messageSender,
            messageSender,
            sourceCurrencyKey,
            sourceAmount,
            destinationCurrencyKey,
            // solhint-disable avoid-tx-origin
            tx.origin,
            false,
            rewardAddress,
            trackingCode
        );
    }

    function exchangeAtomically(
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey,
        bytes32 trackingCode,
        uint minAmount
    ) external exchangeActive(sourceCurrencyKey, destinationCurrencyKey) optionalProxy returns (uint amountReceived) {
        return
            exchanger().exchangeAtomically(
                messageSender,
                sourceCurrencyKey,
                sourceAmount,
                destinationCurrencyKey,
                messageSender,
                trackingCode,
                minAmount
            );
    }

    function settle(bytes32 currencyKey)
        external
        optionalProxy
        returns (
            uint reclaimed,
            uint refunded,
            uint numEntriesSettled
        )
    {
        return exchanger().settle(messageSender, currencyKey);
    }

    function mint() external issuanceActive returns (bool) {
        require(address(rewardsDistribution()) != address(0), "RewardsDistribution not set");

        ISupplySchedule _supplySchedule = supplySchedule();
        IRewardsDistribution _rewardsDistribution = rewardsDistribution();

        uint supplyToMint = _supplySchedule.mintableSupply();
        require(supplyToMint > 0, "No supply is mintable");

        emitTransfer(address(0), address(this), supplyToMint);

        // record minting event before mutation to token supply
        uint minterReward = _supplySchedule.recordMintEvent(supplyToMint);

        // Set minted SNX balance to RewardEscrow's balance
        // Minus the minterReward and set balance of minter to add reward
        uint amountToDistribute = supplyToMint.sub(minterReward);

        // Set the token balance to the RewardsDistribution contract
        tokenState.setBalanceOf(
            address(_rewardsDistribution),
            tokenState.balanceOf(address(_rewardsDistribution)).add(amountToDistribute)
        );
        emitTransfer(address(this), address(_rewardsDistribution), amountToDistribute);

        // Kick off the distribution of rewards
        _rewardsDistribution.distributeRewards(amountToDistribute);

        // Assign the minters reward.
        tokenState.setBalanceOf(msg.sender, tokenState.balanceOf(msg.sender).add(minterReward));
        emitTransfer(address(this), msg.sender, minterReward);

        // Increase total supply by minted amount
        totalSupply = totalSupply.add(supplyToMint);

        return true;
    }

    /* Once off function for SIP-60 to migrate SNX balances in the RewardEscrow contract
     * To the new RewardEscrowV2 contract
     */
    function migrateEscrowBalanceToRewardEscrowV2() external onlyOwner {
        // Record balanceOf(RewardEscrow) contract
        uint rewardEscrowBalance = tokenState.balanceOf(address(rewardEscrow()));

        // transfer all of RewardEscrow's balance to RewardEscrowV2
        // _internalTransfer emits the transfer event
        _internalTransfer(address(rewardEscrow()), address(rewardEscrowV2()), rewardEscrowBalance);
    }

    // ========== EVENTS ==========

    event AtomicSynthExchange(
        address indexed account,
        bytes32 fromCurrencyKey,
        uint256 fromAmount,
        bytes32 toCurrencyKey,
        uint256 toAmount,
        address toAddress
    );
    bytes32 internal constant ATOMIC_SYNTH_EXCHANGE_SIG =
        keccak256("AtomicSynthExchange(address,bytes32,uint256,bytes32,uint256,address)");

    function emitAtomicSynthExchange(
        address account,
        bytes32 fromCurrencyKey,
        uint256 fromAmount,
        bytes32 toCurrencyKey,
        uint256 toAmount,
        address toAddress
    ) external onlyExchanger {
        proxy._emit(
            abi.encode(fromCurrencyKey, fromAmount, toCurrencyKey, toAmount, toAddress),
            2,
            ATOMIC_SYNTH_EXCHANGE_SIG,
            addressToBytes32(account),
            0,
            0
        );
    }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address payable","name":"_proxy","type":"address"},{"internalType":"contract TokenState","name":"_tokenState","type":"address"},{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint256","name":"_totalSupply","type":"uint256"},{"internalType":"address","name":"_resolver","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"snxRedeemed","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountLiquidated","type":"uint256"},{"indexed":false,"internalType":"address","name":"liquidator","type":"address"}],"name":"AccountLiquidated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"bytes32","name":"fromCurrencyKey","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"fromAmount","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"toCurrencyKey","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"toAmount","type":"uint256"},{"indexed":false,"internalType":"address","name":"toAddress","type":"address"}],"name":"AtomicSynthExchange","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"name","type":"bytes32"},{"indexed":false,"internalType":"address","name":"destination","type":"address"}],"name":"CacheUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"bytes32","name":"currencyKey","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ExchangeRebate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"bytes32","name":"currencyKey","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ExchangeReclaim","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"trackingCode","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"toCurrencyKey","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"toAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"fee","type":"uint256"}],"name":"ExchangeTracking","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":"address","name":"proxyAddress","type":"address"}],"name":"ProxyUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"bytes32","name":"fromCurrencyKey","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"fromAmount","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"toCurrencyKey","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"toAmount","type":"uint256"},{"indexed":false,"internalType":"address","name":"toAddress","type":"address"}],"name":"SynthExchange","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newTokenState","type":"address"}],"name":"TokenStateUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"constant":true,"inputs":[],"name":"CONTRACT_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"DECIMALS","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"TOKEN_NAME","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"TOKEN_SYMBOL","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"acceptOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"anySynthOrSNXRateIsInvalid","outputs":[{"internalType":"bool","name":"anyRateInvalid","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"availableCurrencyKeys","outputs":[{"internalType":"bytes32[]","name":"","type":"bytes32[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"availableSynthCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"availableSynths","outputs":[{"internalType":"contract ISynth","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"burnSecondary","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burnSynths","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"burnForAddress","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burnSynthsOnBehalf","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"burnSynthsToTarget","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"burnForAddress","type":"address"}],"name":"burnSynthsToTargetOnBehalf","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"collateral","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"_issuer","type":"address"}],"name":"collateralisationRatio","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"currencyKey","type":"bytes32"}],"name":"debtBalanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"fromCurrencyKey","type":"bytes32"},{"internalType":"uint256","name":"fromAmount","type":"uint256"},{"internalType":"bytes32","name":"toCurrencyKey","type":"bytes32"},{"internalType":"uint256","name":"toAmount","type":"uint256"},{"internalType":"address","name":"toAddress","type":"address"}],"name":"emitAtomicSynthExchange","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"currencyKey","type":"bytes32"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"emitExchangeRebate","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"currencyKey","type":"bytes32"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"emitExchangeReclaim","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"trackingCode","type":"bytes32"},{"internalType":"bytes32","name":"toCurrencyKey","type":"bytes32"},{"internalType":"uint256","name":"toAmount","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"}],"name":"emitExchangeTracking","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"fromCurrencyKey","type":"bytes32"},{"internalType":"uint256","name":"fromAmount","type":"uint256"},{"internalType":"bytes32","name":"toCurrencyKey","type":"bytes32"},{"internalType":"uint256","name":"toAmount","type":"uint256"},{"internalType":"address","name":"toAddress","type":"address"}],"name":"emitSynthExchange","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"sourceCurrencyKey","type":"bytes32"},{"internalType":"uint256","name":"sourceAmount","type":"uint256"},{"internalType":"bytes32","name":"destinationCurrencyKey","type":"bytes32"}],"name":"exchange","outputs":[{"internalType":"uint256","name":"amountReceived","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"sourceCurrencyKey","type":"bytes32"},{"internalType":"uint256","name":"sourceAmount","type":"uint256"},{"internalType":"bytes32","name":"destinationCurrencyKey","type":"bytes32"},{"internalType":"bytes32","name":"trackingCode","type":"bytes32"},{"internalType":"uint256","name":"minAmount","type":"uint256"}],"name":"exchangeAtomically","outputs":[{"internalType":"uint256","name":"amountReceived","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"exchangeForAddress","type":"address"},{"internalType":"bytes32","name":"sourceCurrencyKey","type":"bytes32"},{"internalType":"uint256","name":"sourceAmount","type":"uint256"},{"internalType":"bytes32","name":"destinationCurrencyKey","type":"bytes32"}],"name":"exchangeOnBehalf","outputs":[{"internalType":"uint256","name":"amountReceived","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"exchangeForAddress","type":"address"},{"internalType":"bytes32","name":"sourceCurrencyKey","type":"bytes32"},{"internalType":"uint256","name":"sourceAmount","type":"uint256"},{"internalType":"bytes32","name":"destinationCurrencyKey","type":"bytes32"},{"internalType":"address","name":"rewardAddress","type":"address"},{"internalType":"bytes32","name":"trackingCode","type":"bytes32"}],"name":"exchangeOnBehalfWithTracking","outputs":[{"internalType":"uint256","name":"amountReceived","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"sourceCurrencyKey","type":"bytes32"},{"internalType":"uint256","name":"sourceAmount","type":"uint256"},{"internalType":"bytes32","name":"destinationCurrencyKey","type":"bytes32"},{"internalType":"address","name":"rewardAddress","type":"address"},{"internalType":"bytes32","name":"trackingCode","type":"bytes32"}],"name":"exchangeWithTracking","outputs":[{"internalType":"uint256","name":"amountReceived","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"sourceCurrencyKey","type":"bytes32"},{"internalType":"uint256","name":"sourceAmount","type":"uint256"},{"internalType":"bytes32","name":"destinationCurrencyKey","type":"bytes32"},{"internalType":"address","name":"rewardAddress","type":"address"},{"internalType":"bytes32","name":"trackingCode","type":"bytes32"}],"name":"exchangeWithTrackingForInitiator","outputs":[{"internalType":"uint256","name":"amountReceived","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"sourceCurrencyKey","type":"bytes32"},{"internalType":"uint256","name":"sourceAmount","type":"uint256"},{"internalType":"bytes32","name":"destinationCurrencyKey","type":"bytes32"},{"internalType":"bytes32","name":"trackingCode","type":"bytes32"}],"name":"exchangeWithVirtual","outputs":[{"internalType":"uint256","name":"amountReceived","type":"uint256"},{"internalType":"contract IVirtualSynth","name":"vSynth","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getFirstNonZeroEscrowIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isResolverCached","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"currencyKey","type":"bytes32"}],"name":"isWaitingPeriod","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"issueMaxSynths","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"issueForAddress","type":"address"}],"name":"issueMaxSynthsOnBehalf","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"issueSynths","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"issueForAddress","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"issueSynthsOnBehalf","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"liquidateDelinquentAccount","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"escrowStartIndex","type":"uint256"}],"name":"liquidateDelinquentAccountEscrowIndex","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"liquidateSelf","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"maxIssuableSynths","outputs":[{"internalType":"uint256","name":"maxIssuable","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"messageSender","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"migrateAccountBalances","outputs":[{"internalType":"uint256","name":"totalEscrowRevoked","type":"uint256"},{"internalType":"uint256","name":"totalLiquidBalance","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"migrateEscrowBalanceToRewardEscrowV2","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"migrateEscrowContractBalance","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"mint","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"mintSecondary","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"mintSecondaryRewards","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"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":"proxy","outputs":[{"internalType":"contract Proxy","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"rebuildCache","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"remainingIssuableSynths","outputs":[{"internalType":"uint256","name":"maxIssuable","type":"uint256"},{"internalType":"uint256","name":"alreadyIssued","type":"uint256"},{"internalType":"uint256","name":"totalSystemDebt","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"resolver","outputs":[{"internalType":"contract AddressResolver","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"resolverAddressesRequired","outputs":[{"internalType":"bytes32[]","name":"addresses","type":"bytes32[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"sUSD","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"setMessageSender","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address payable","name":"_proxy","type":"address"}],"name":"setProxy","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"contract TokenState","name":"_tokenState","type":"address"}],"name":"setTokenState","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"currencyKey","type":"bytes32"}],"name":"settle","outputs":[{"internalType":"uint256","name":"reclaimed","type":"uint256"},{"internalType":"uint256","name":"refunded","type":"uint256"},{"internalType":"uint256","name":"numEntriesSettled","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"currencyKey","type":"bytes32"}],"name":"synths","outputs":[{"internalType":"contract ISynth","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"synthAddress","type":"address"}],"name":"synthsByAddress","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"tokenState","outputs":[{"internalType":"contract TokenState","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"currencyKey","type":"bytes32"}],"name":"totalIssuedSynths","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"currencyKey","type":"bytes32"}],"name":"totalIssuedSynthsExcludeOtherCollateral","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"transferableSynthetix","outputs":[{"internalType":"uint256","name":"transferable","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"}]

60806040523480156200001157600080fd5b506040516200638438038062006384833981016040819052620000349162000315565b84848484848085856040518060400160405280601781526020017f53796e746865746978204e6574776f726b20546f6b656e000000000000000000815250604051806040016040528060038152602001620a69cb60eb1b81525086601289868160006001600160a01b0316816001600160a01b03161415620000d35760405162461bcd60e51b8152600401620000ca9062000463565b60405180910390fd5b600080546001600160a01b0319166001600160a01b0383161781556040517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c91620001209184906200042b565b60405180910390a1506000546001600160a01b0316620001545760405162461bcd60e51b8152600401620000ca9062000451565b600280546001600160a01b0319166001600160a01b0383161790556040517ffc80377ca9c49cc11ae6982f390a42db976d5530af7c43889264b13fbbd7c57e90620001a19083906200041b565b60405180910390a150600480546001600160a01b0319166001600160a01b0388161790558451620001da90600590602088019062000243565b508351620001f090600690602087019062000243565b50506007919091556008805460ff191660ff90921691909117610100600160a81b0319166101006001600160a01b0397909716969096029590951790945550620004e19c50505050505050505050505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200028657805160ff1916838001178555620002b6565b82800160010185558215620002b6579182015b82811115620002b657825182559160200191906001019062000299565b50620002c4929150620002c8565b5090565b620002e591905b80821115620002c45760008155600101620002cf565b90565b8051620002f581620004b1565b92915050565b8051620002f581620004cb565b8051620002f581620004d6565b600080600080600060a086880312156200032e57600080fd5b60006200033c8888620002e8565b95505060206200034f88828901620002fb565b94505060406200036288828901620002e8565b9350506060620003758882890162000308565b92505060806200038888828901620002e8565b9150509295509295909350565b620003a081620004a4565b82525050565b620003a0816200047e565b6000620003c060118362000475565b7013dddb995c881b5d5cdd081899481cd95d607a1b815260200192915050565b6000620003ef60198362000475565b7f4f776e657220616464726573732063616e6e6f74206265203000000000000000815260200192915050565b60208101620002f5828462000395565b604081016200043b828562000395565b6200044a6020830184620003a6565b9392505050565b60208082528101620002f581620003b1565b60208082528101620002f581620003e0565b90815260200190565b6000620002f58262000498565b6000620002f5826200047e565b6001600160a01b031690565b6000620002f5826200048b565b620004bc816200047e565b8114620004c857600080fd5b50565b620004bc816200048b565b620004bc81620002e5565b615e9380620004f16000396000f3fe608060405234801561001057600080fd5b50600436106104495760003560e01c80636c00f310116102415780639f7698071161013b578063d37c4d8b116100c3578063e8e09b8b11610087578063e8e09b8b146108f3578063e90dd9e214610906578063ec5568891461090e578063edef719a146106b0578063ee52a2f31461091657610449565b8063d37c4d8b146108aa578063d67bdd25146108bd578063d8a1f76f146108c5578063dbf63340146108d8578063dd62ed3e146108e057610449565b8063ace88afd1161010a578063ace88afd14610856578063af086c7e14610869578063bc67f83214610871578063c2bf388014610884578063c836fa0a1461089757610449565b80639f7698071461080a578063a311c7c21461081d578063a5fdc5de14610830578063a9059cbb1461084357610449565b806384358843116101c95780639324cac71161018d5780639324cac7146107cc57806395d89b41146107d457806397107d6d146107dc5780639741fb22146107ef578063987757dd146107f757610449565b80638435884314610775578063899ffef4146107965780638a2900141461079e5780638da5cb5b146107b157806391e56b68146107b957610449565b806372cb051f1161021057806372cb051f1461072a578063741853601461073f57806379ba509714610747578063835e119c1461074f57806383d625d41461076257610449565b80636c00f310146106de5780636f01a986146106f1578063704e7b851461070457806370a082311461071757610449565b80632c955fa71161035257806344b3e923116102da5780635e22846a1161029e5780635e22846a14610695578063614d08f8146106a8578063666ed4f1146106b05780636ac0bf9c146106c35780636b76222f146106d657610449565b806344b3e9231461064a5780634e99bda91461065d578063528c7efb1461066557806353a47bb71461066d5780635af090ef1461068257610449565b806330ead7601161032157806330ead760146105f6578063313ce56714610609578063320223db1461061157806332608039146106245780633e89b9e51461063757610449565b80632c955fa7146105a85780632d3169eb146105bb5780632e0f2625146105ce5780632f7206ce146105e357610449565b806316b2213f116103d557806323b872dd116103a457806323b872dd1461055f5780632621716f14610572578063295da87d146105855780632a905318146105985780632af64bd3146105a057610449565b806316b2213f1461052957806318160ddd1461053c57806318821400146105445780631fce304d1461054c57610449565b8063095ea7b31161041c578063095ea7b3146104ab5780630e30963c146104cb5780631137aedf146104ec5780631249c58b1461050e5780631627540c1461051657610449565b806303fbc5471461044e57806304f3bcec1461045857806305b3c1c91461047657806306fdde0314610496575b600080fd5b610456610929565b005b610460610b16565b60405161046d9190615aeb565b60405180910390f35b6104896104843660046146ea565b610b2a565b60405161046d919061594c565b61049e610bb7565b60405161046d9190615af9565b6104be6104b93660046147ad565b610c45565b60405161046d919061593e565b6104de6104d9366004614a00565b610cd2565b60405161046d929190615ce4565b6104ff6104fa3660046146ea565b610de1565b60405161046d939291906159f0565b6104be610e76565b6104566105243660046146ea565b611230565b6104896105373660046146ea565b61128e565b6104896112c3565b61049e6112c9565b6104be61055a3660046149c4565b611302565b6104be61056d366004614760565b611397565b6104896105803660046146ea565b6113d6565b6104566105933660046149c4565b6115b7565b61049e611638565b6104be611657565b6104566105b63660046146ea565b611773565b6104566105c9366004614a00565b6117bf565b6105d6611875565b60405161046d9190615d27565b6104566105f13660046148f7565b61187a565b610489610604366004614a43565b61193c565b6105d66119fa565b61045661061f3660046146ea565b611a03565b6104606106323660046149c4565b611a4f565b6104896106453660046149c4565b611ad4565b610489610658366004614ab8565b611b0c565b6104be611bc4565b6104be611c43565b610675611e23565b60405161046d91906156e5565b610489610690366004614a43565b611e32565b6104be6106a33660046146ea565b611e92565b610489611ebe565b6104566106be3660046147ad565b611ece565b6104896106d13660046146ea565b611eda565b610456611fe2565b6104566106ec3660046148f7565b61208d565b6104566106ff3660046147dd565b6120e0565b6104be6107123660046147ad565b612199565b6104896107253660046146ea565b6121c4565b6107326121f6565b60405161046d919061592d565b610456612274565b6104566123c6565b61046061075d3660046149c4565b612462565b6104896107703660046149c4565b612497565b6107886107833660046146ea565b6124cf565b60405161046d929190615976565b610732612804565b6104566107ac3660046149c4565b612898565b6106756128e2565b6104896107c7366004614870565b6128f1565b6104896129b1565b61049e6129bc565b6104566107ea3660046146ea565b612a17565b610456612a6a565b6104ff6108053660046149c4565b612ae3565b610456610818366004614b2d565b612b59565b61048961082b3660046146ea565b612b85565b61048961083e3660046146ea565b612bba565b6104be6108513660046147ad565b612bef565b6104566108643660046147dd565b612c39565b610456612c86565b61045661087f3660046146ea565b612ccf565b6104566108923660046147ad565b612cf9565b6104896108a536600461480f565b612d7d565b6104896108b83660046147ad565b612e3b565b610675612ec2565b6104566108d33660046149c4565b612ed1565b610489612ed9565b6104896108ee366004614726565b612f53565b6104566109013660046147ad565b612f87565b610460612fd5565b610460612fe4565b610489610924366004614a22565b612ff3565b6109316130af565b60085460405163dacb2d0160e01b815260009161010090046001600160a01b03169063dacb2d019061096590600401615cc6565b60206040518083038186803b15801561097d57600080fd5b505afa158015610991573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506109b59190810190614708565b60085460405163dacb2d0160e01b81529192506000916101009091046001600160a01b03169063dacb2d01906109ed90600401615c3e565b60206040518083038186803b158015610a0557600080fd5b505afa158015610a19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610a3d9190810190614708565b9050816001600160a01b0316816001600160a01b03161415610a7a5760405162461bcd60e51b8152600401610a7190615cb6565b60405180910390fd5b600480546040516370a0823160e01b81526000926001600160a01b03909216916370a0823191610aac918791016156e5565b60206040518083038186803b158015610ac457600080fd5b505afa158015610ad8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610afc91908101906149e2565b90508015610b1157610b0f8383836130d9565b505b505050565b60085461010090046001600160a01b031681565b6000610b346132b5565b6001600160a01b03166305b3c1c9836040518263ffffffff1660e01b8152600401610b5f91906156e5565b60206040518083038186803b158015610b7757600080fd5b505afa158015610b8b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610baf91908101906149e2565b90505b919050565b6005805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610c3d5780601f10610c1257610100808354040283529160200191610c3d565b820191906000526020600020905b815481529060010190602001808311610c2057829003601f168201915b505050505081565b6000610c4f6132c9565b60035460048054604051633691826360e21b81526001600160a01b03938416939091169163da46098c91610c89918591899189910161584b565b600060405180830381600087803b158015610ca357600080fd5b505af1158015610cb7573d6000803e3d6000fd5b50505050610cc6818585613308565b60019150505b92915050565b6000808584610ce18282613388565b610ce96132c9565b610cf16133e9565b6001600160a01b0316634f8633d2600360009054906101000a90046001600160a01b0316600360009054906101000a90046001600160a01b03168b8b8b600360009054906101000a90046001600160a01b03166001600360009054906101000a90046001600160a01b03168e6040518a63ffffffff1660e01b8152600401610d81999897969594939291906157fb565b6040805180830381600087803b158015610d9a57600080fd5b505af1158015610dae573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610dd29190810190614b99565b93509350505094509492505050565b6000806000610dee6132b5565b6001600160a01b0316631137aedf856040518263ffffffff1660e01b8152600401610e1991906156e5565b60606040518083038186803b158015610e3157600080fd5b505afa158015610e45573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610e699190810190614bc9565b9250925092509193909250565b6000610e80613400565b6000610e8a613454565b6001600160a01b03161415610eb15760405162461bcd60e51b8152600401610a7190615bf1565b6000610ebb613475565b90506000610ec7613454565b90506000826001600160a01b031663cc5c095c6040518163ffffffff1660e01b815260040160206040518083038186803b158015610f0457600080fd5b505afa158015610f18573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610f3c91908101906149e2565b905060008111610f5e5760405162461bcd60e51b8152600401610a7190615c89565b610f6a60003083613491565b604051637e7961d760e01b81526000906001600160a01b03851690637e7961d790610f9990859060040161594c565b602060405180830381600087803b158015610fb357600080fd5b505af1158015610fc7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610feb91908101906149e2565b90506000610fff838363ffffffff6134d416565b600480546040516370a0823160e01b81529293506001600160a01b03169163b46310f691879161109b91869186916370a082319161103f918791016156e5565b60206040518083038186803b15801561105757600080fd5b505afa15801561106b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061108f91908101906149e2565b9063ffffffff6134fc16565b6040518363ffffffff1660e01b81526004016110b89291906158c3565b600060405180830381600087803b1580156110d257600080fd5b505af11580156110e6573d6000803e3d6000fd5b505050506110f5308583613491565b604051630b32e9c760e31b81526001600160a01b038516906359974e389061112190849060040161594c565b602060405180830381600087803b15801561113b57600080fd5b505af115801561114f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061117391908101906149a6565b50600480546040516370a0823160e01b81526001600160a01b039091169163b46310f69133916111b391879186916370a082319161103f918791016156f3565b6040518363ffffffff1660e01b81526004016111d0929190615701565b600060405180830381600087803b1580156111ea57600080fd5b505af11580156111fe573d6000803e3d6000fd5b5050505061120d303384613491565b600754611220908463ffffffff6134fc16565b6007555060019450505050505b90565b6112386130af565b600180546001600160a01b0319166001600160a01b0383161790556040517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce22906112839083906156e5565b60405180910390a150565b60006112986132b5565b6001600160a01b03166316b2213f836040518263ffffffff1660e01b8152600401610b5f91906156e5565b60075481565b6040518060400160405280601781526020017f53796e746865746978204e6574776f726b20546f6b656e00000000000000000081525081565b60008061130d6133e9565b6003546040516301670a7b60e21b81526001600160a01b039283169263059c29ec926113409291169087906004016158c3565b60206040518083038186803b15801561135857600080fd5b505afa15801561136c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061139091908101906149e2565b1192915050565b60006113a1613521565b6113a9613576565b6113b384836135b6565b506003546113cc906001600160a01b0316858585613887565b90505b9392505050565b6000806113e1613933565b6001600160a01b031663204b676a846040518263ffffffff1660e01b815260040161140c91906156e5565b60206040518083038186803b15801561142457600080fd5b505afa158015611438573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061145c91908101906149e2565b905060006114686145b5565b60005b8381101561159e5761147b613933565b6001600160a01b031663ae58254987836040518363ffffffff1660e01b81526004016114a89291906158c3565b60206040518083038186803b1580156114c057600080fd5b505afa1580156114d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506114f891908101906149e2565b9250611502613933565b6001600160a01b03166345626bd687856040518363ffffffff1660e01b815260040161152f9291906158c3565b604080518083038186803b15801561154657600080fd5b505afa15801561155a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061157e9190810190614b4b565b602081015190925015611596579350610bb292505050565b60010161146b565b5060405162461bcd60e51b8152600401610a7190615b64565b6115bf613400565b6115c76132c9565b6115cf6132b5565b60035460405163b06e8c6560e01b81526001600160a01b039283169263b06e8c65926116029291169085906004016158c3565b600060405180830381600087803b15801561161c57600080fd5b505af1158015611630573d6000803e3d6000fd5b505050505b50565b604051806040016040528060038152602001620a69cb60eb1b81525081565b60006060611663612804565b905060005b815181101561176a57600082828151811061167f57fe5b602090810291909101810151600081815260099092526040918290205460085492516321f8a72160e01b81529193506001600160a01b0390811692610100900416906321f8a721906116d590859060040161594c565b60206040518083038186803b1580156116ed57600080fd5b505afa158015611701573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506117259190810190614708565b6001600160a01b031614158061175057506000818152600960205260409020546001600160a01b0316155b15611761576000935050505061122d565b50600101611668565b50600191505090565b61177b613400565b6117836132c9565b61178b6132b5565b60035460405163159fa0d560e11b81526001600160a01b0392831692632b3f41aa926116029286929091169060040161571c565b6117c761394f565b6002546040516001600160a01b039091169063907dff97906117f1908690869086906020016159f0565b604051602081830303815290604052600260405161180e9061566d565b6040519081900381206001600160e01b031960e086901b16825261183d9392918a906000908190600401615a6a565b600060405180830381600087803b15801561185757600080fd5b505af115801561186b573d6000803e3d6000fd5b5050505050505050565b601281565b61188261394f565b6002546040516001600160a01b039091169063907dff97906118b090889088908890889088906020016159a4565b60405160208183030381529060405260026040516118cd90615657565b60405180910390206118de8b613987565b6000806040518763ffffffff1660e01b815260040161190296959493929190615a6a565b600060405180830381600087803b15801561191c57600080fd5b505af1158015611930573d6000803e3d6000fd5b50505050505050505050565b6000858461194a8282613388565b6119526132c9565b61195a6133e9565b6003546040516327c319e960e11b81526001600160a01b0392831692634f8633d29261199c9291169081908d908d908d9084906000908f908f906004016157fb565b6040805180830381600087803b1580156119b557600080fd5b505af11580156119c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506119ed9190810190614b99565b5098975050505050505050565b60085460ff1681565b611a0b613400565b611a136132c9565b611a1b6132b5565b60035460405163fd864ccf60e01b81526001600160a01b039283169263fd864ccf926116029286929091169060040161571c565b6000611a596132b5565b6001600160a01b03166332608039836040518263ffffffff1660e01b8152600401611a84919061594c565b60206040518083038186803b158015611a9c57600080fd5b505afa158015611ab0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610baf9190810190614b0f565b6000611ade6132b5565b6001600160a01b0316637b1001b78360016040518363ffffffff1660e01b8152600401610b5f929190615968565b60008584611b1a8282613388565b611b226132c9565b611b2a6133e9565b60035460405162674ed160e71b81526001600160a01b03928316926333a7688092611b66929116908c908c908c9084908d908d906004016158d1565b602060405180830381600087803b158015611b8057600080fd5b505af1158015611b94573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611bb891908101906149e2565b98975050505050505050565b6000611bce6132b5565b6001600160a01b0316634e99bda96040518163ffffffff1660e01b815260040160206040518083038186803b158015611c0657600080fd5b505afa158015611c1a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611c3e91908101906149a6565b905090565b6000611c4d613576565b611c556132c9565b6003546001600160a01b0316611c69613993565b6001600160a01b031663c00007b0826040518263ffffffff1660e01b8152600401611c9491906156e5565b600060405180830381600087803b158015611cae57600080fd5b505af1158015611cc2573d6000803e3d6000fd5b50505050600080611cd16132b5565b6001600160a01b03166372c658168460016040518363ffffffff1660e01b8152600401611cff9291906158a8565b606060405180830381600087803b158015611d1957600080fd5b505af1158015611d2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611d519190810190614bc9565b509150915060008111611d765760405162461bcd60e51b8152600401610a7190615c6c565b611d82838383866139b2565b6000611d9684611d90613993565b85613a2e565b905080611db55760405162461bcd60e51b8152600401610a7190615c11565b611dbd613993565b6001600160a01b0316633c6b16ab846040518263ffffffff1660e01b8152600401611de8919061594c565b600060405180830381600087803b158015611e0257600080fd5b505af1158015611e16573d6000803e3d6000fd5b5092965050505050505090565b6001546001600160a01b031681565b60008584611e408282613388565b611e486132c9565b611e506133e9565b6003546040516327c319e960e11b81526001600160a01b0392831692634f8633d29261199c9291169081908d908d908d9032906000908f908f90600401615775565b6000611e9c613576565b611ea46132c9565b600354610baf9083906000906001600160a01b0316613a3b565b680a6f2dce8d0cae8d2f60bb1b81565b611ed6613e3d565b5050565b6000611ee46132b5565b600480546040516370a0823160e01b81526001600160a01b0393841693636bed0415938793909116916370a0823191611f1f918591016156e5565b60206040518083038186803b158015611f3757600080fd5b505afa158015611f4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611f6f91908101906149e2565b6040518363ffffffff1660e01b8152600401611f8c9291906158c3565b604080518083038186803b158015611fa357600080fd5b505afa158015611fb7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611fdb9190810190614b69565b5092915050565b611fea6130af565b6004546000906001600160a01b03166370a08231612006613e55565b6040518263ffffffff1660e01b815260040161202291906156e5565b60206040518083038186803b15801561203a57600080fd5b505afa15801561204e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061207291908101906149e2565b9050611ed661207f613e55565b612087613933565b836130d9565b61209561394f565b6002546040516001600160a01b039091169063907dff97906120c390889088908890889088906020016159a4565b60405160208183030381529060405260026040516118cd90615698565b6120e861394f565b6002546040516001600160a01b039091169063907dff97906121109085908590602001615976565b604051602081830303815290604052600260405161212d906156ae565b604051809103902061213e88613987565b6000806040518763ffffffff1660e01b815260040161216296959493929190615a6a565b600060405180830381600087803b15801561217c57600080fd5b505af1158015612190573d6000803e3d6000fd5b50505050505050565b60006121a3613576565b6121ab6132c9565b6003546113cf90849084906001600160a01b0316613a3b565b600480546040516370a0823160e01b81526000926001600160a01b03909216916370a0823191610b5f918691016156e5565b60606122006132b5565b6001600160a01b03166372cb051f6040518163ffffffff1660e01b815260040160006040518083038186803b15801561223857600080fd5b505afa15801561224c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611c3e9190810190614971565b606061227e612804565b905060005b8151811015611ed657600082828151811061229a57fe5b602002602001015190506000600860019054906101000a90046001600160a01b03166001600160a01b031663dacb2d0183846040516020016122dc91906156cf565b6040516020818303038152906040526040518363ffffffff1660e01b8152600401612308929190615984565b60206040518083038186803b15801561232057600080fd5b505afa158015612334573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506123589190810190614708565b6000838152600960205260409081902080546001600160a01b0319166001600160a01b038416179055519091507f88a93678a3692f6789d9546fc621bf7234b101ddb7d4fe479455112831b8aa68906123b4908490849061595a565b60405180910390a15050600101612283565b6001546001600160a01b031633146123f05760405162461bcd60e51b8152600401610a7190615b27565b6000546001546040517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c92612433926001600160a01b039182169291169061571c565b60405180910390a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b600061246c6132b5565b6001600160a01b031663835e119c836040518263ffffffff1660e01b8152600401611a84919061594c565b60006124a16132b5565b6001600160a01b0316637b1001b78360006040518363ffffffff1660e01b8152600401610b5f929190615968565b6000806124da613576565b6008546040516321f8a72160e01b815260009161010090046001600160a01b0316906321f8a721906125299075446562744d69677261746f724f6e457468657265756d60501b9060040161594c565b60206040518083038186803b15801561254157600080fd5b505afa158015612555573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506125799190810190614708565b9050336001600160a01b038216148061263557506008546040516321f8a72160e01b81526101009091046001600160a01b0316906321f8a721906125d0906b131959d858de53585c9ad95d60a21b9060040161594c565b60206040518083038186803b1580156125e857600080fd5b505afa1580156125fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506126209190810190614708565b6001600160a01b0316336001600160a01b0316145b6126515760405162461bcd60e51b8152600401610a7190615c21565b600480546040516370a0823160e01b81526001600160a01b03909116916370a0823191612680918891016156e5565b60206040518083038186803b15801561269857600080fd5b505afa1580156126ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506126d091908101906149e2565b915081156127065760006126e5853385613a2e565b9050806127045760405162461bcd60e51b8152600401610a7190615bb1565b505b61270e613933565b6001600160a01b031663326a3cfb856040518263ffffffff1660e01b815260040161273991906156e5565b60206040518083038186803b15801561275157600080fd5b505afa158015612765573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061278991908101906149e2565b925082156127fe57612799613933565b6001600160a01b031663de065f6785338660006040518563ffffffff1660e01b81526004016127cb9493929190615737565b600060405180830381600087803b1580156127e557600080fd5b505af11580156127f9573d6000803e3d6000fd5b505050505b50915091565b60608061280f613e6f565b6040805160028082526060808301845293945090916020830190803883390190505090506b526577617264457363726f7760a01b8160008151811061285057fe5b6020026020010181815250506d537570706c795363686564756c6560901b8160018151811061287b57fe5b6020026020010181815250506128918282613fb8565b9250505090565b6128a0613400565b6128a86132c9565b6128b06132b5565b6003546040516285c0d160e31b81526001600160a01b039283169263042e0688926116029291169085906004016158c3565b6000546001600160a01b031681565b600085846128ff8282613388565b6129076132c9565b61290f6133e9565b6003546040516327c319e960e11b81526001600160a01b0392831692634f8633d292612952928e92909116908d908d908d9085906000908f908f906004016157fb565b6040805180830381600087803b15801561296b57600080fd5b505af115801561297f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506129a39190810190614b99565b509998505050505050505050565b631cd554d160e21b81565b6006805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610c3d5780601f10610c1257610100808354040283529160200191610c3d565b612a1f6130af565b600280546001600160a01b0319166001600160a01b0383161790556040517ffc80377ca9c49cc11ae6982f390a42db976d5530af7c43889264b13fbbd7c57e906112839083906156f3565b612a72613400565b612a7a6132c9565b612a826132b5565b6003546040516324beb82560e11b81526001600160a01b039283169263497d704a92612ab3929116906004016156e5565b600060405180830381600087803b158015612acd57600080fd5b505af1158015610b0f573d6000803e3d6000fd5b565b6000806000612af06132c9565b612af86133e9565b6003546040516306c5a00b60e21b81526001600160a01b0392831692631b16802c92612b2b9291169088906004016158c3565b606060405180830381600087803b158015612b4557600080fd5b505af1158015610e45573d6000803e3d6000fd5b612b6161406d565b600480546001600160a01b0319166001600160a01b038316179055611635816140db565b6000612b8f6132b5565b6001600160a01b031663a311c7c2836040518263ffffffff1660e01b8152600401610b5f91906156e5565b6000612bc46132b5565b6001600160a01b031663a5fdc5de836040518263ffffffff1660e01b8152600401610b5f91906156e5565b6000612bf9613521565b612c01613576565b600354612c17906001600160a01b0316836135b6565b50600354612c2f906001600160a01b03168484613a2e565b5060019392505050565b612c4161394f565b6002546040516001600160a01b039091169063907dff9790612c699085908590602001615976565b604051602081830303815290604052600260405161212d90615662565b612c8e613400565b612c966132c9565b612c9e6132b5565b60035460405163644bb89960e11b81526001600160a01b039283169263c897713292612ab3929116906004016156e5565b612cd761414d565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b612d01613400565b612d096132c9565b612d116132b5565b600354604051632694552d60e21b81526001600160a01b0392831692639a5154b492612d4792879290911690869060040161584b565b600060405180830381600087803b158015612d6157600080fd5b505af1158015612d75573d6000803e3d6000fd5b505050505050565b60008382612d8b8282613388565b612d936132c9565b612d9b6133e9565b6003546040516327c319e960e11b81526001600160a01b0392831692634f8633d292612dde928c92909116908b908b908b908590600090829082906004016157fb565b6040805180830381600087803b158015612df757600080fd5b505af1158015612e0b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250612e2f9190810190614b99565b50979650505050505050565b6000612e456132b5565b6001600160a01b031663d37c4d8b84846040518363ffffffff1660e01b8152600401612e729291906158c3565b60206040518083038186803b158015612e8a57600080fd5b505afa158015612e9e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506113cf91908101906149e2565b6003546001600160a01b031681565b611635613e3d565b6000612ee36132b5565b6001600160a01b031663dbf633406040518163ffffffff1660e01b815260040160206040518083038186803b158015612f1b57600080fd5b505afa158015612f2f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611c3e91908101906149e2565b60048054604051636eb1769f60e11b81526000926001600160a01b039092169163dd62ed3e91612e7291879187910161571c565b612f8f613400565b612f976132c9565b612f9f6132b5565b60035460405163227635b160e11b81526001600160a01b03928316926344ec6b6292612d4792879290911690869060040161584b565b6004546001600160a01b031681565b6002546001600160a01b031681565b600083826130018282613388565b6130096132c9565b6130116133e9565b6003546040516327c319e960e11b81526001600160a01b0392831692634f8633d2926130539291169081908b908b908b908490600090829082906004016157fb565b6040805180830381600087803b15801561306c57600080fd5b505af1158015613080573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506130a49190810190614b99565b509695505050505050565b6000546001600160a01b03163314612ae15760405162461bcd60e51b8152600401610a7190615c01565b60006001600160a01b038316158015906130fc57506001600160a01b0383163014155b801561311657506002546001600160a01b03848116911614155b6131325760405162461bcd60e51b8152600401610a7190615b0a565b600480546040516370a0823160e01b81526001600160a01b039091169163b46310f69187916131cd91879186916370a0823191613171918791016156e5565b60206040518083038186803b15801561318957600080fd5b505afa15801561319d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506131c191908101906149e2565b9063ffffffff6134d416565b6040518363ffffffff1660e01b81526004016131ea9291906158c3565b600060405180830381600087803b15801561320457600080fd5b505af1158015613218573d6000803e3d6000fd5b5050600480546040516370a0823160e01b81526001600160a01b03909116935063b46310f69250869161325b91879186916370a082319161103f918791016156e5565b6040518363ffffffff1660e01b81526004016132789291906158c3565b600060405180830381600087803b15801561329257600080fd5b505af11580156132a6573d6000803e3d6000fd5b50505050612c2f848484613491565b6000611c3e6524b9b9bab2b960d11b614177565b6002546001600160a01b031633148015906132ef57506003546001600160a01b03163314155b15612ae157600380546001600160a01b03191633179055565b6002546040516001600160a01b039091169063907dff979061332e90849060200161594c565b604051602081830303815290604052600360405161334b906156a3565b604051809103902061335c88613987565b61336588613987565b60006040518763ffffffff1660e01b815260040161216296959493929190615aa4565b6133906141d4565b6001600160a01b0316631ce00ba283836040518363ffffffff1660e01b81526004016133bd929190615976565b60006040518083038186803b1580156133d557600080fd5b505afa158015612d75573d6000803e3d6000fd5b6000611c3e6822bc31b430b733b2b960b91b614177565b6134086141d4565b6001600160a01b0316637c3125416040518163ffffffff1660e01b815260040160006040518083038186803b15801561344057600080fd5b505afa158015610b0f573d6000803e3d6000fd5b6000611c3e722932bbb0b93239a234b9ba3934b13aba34b7b760691b614177565b6000611c3e6d537570706c795363686564756c6560901b614177565b6002546040516001600160a01b039091169063907dff97906134b790849060200161594c565b604051602081830303815290604052600360405161334b906156da565b6000828211156134f65760405162461bcd60e51b8152600401610a7190615ba1565b50900390565b6000828201838110156113cf5760405162461bcd60e51b8152600401610a7190615b74565b6002546001600160a01b031633141561353957612ae1565b613542336141ee565b1561355e57600380546001600160a01b03191633179055612ae1565b60405162461bcd60e51b8152600401610a7190615c99565b61357e6141d4565b6001600160a01b031663086dabd16040518163ffffffff1660e01b815260040160006040518083038186803b15801561344057600080fd5b6008546040516321f8a72160e01b815260009182916101009091046001600160a01b0316906321f8a721906135fe906b131959d858de53585c9ad95d60a21b9060040161594c565b60206040518083038186803b15801561361657600080fd5b505afa15801561362a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061364e9190810190614708565b6003549091506001600160a01b03161580159061367857506003546001600160a01b038281169116145b806136945750806001600160a01b0316846001600160a01b0316145b156136a3576001915050610ccc565b60006136ad6132b5565b6001600160a01b031663d37c4d8b86631cd554d160e21b6040518363ffffffff1660e01b81526004016136e19291906158c3565b60206040518083038186803b1580156136f957600080fd5b505afa15801561370d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061373191908101906149e2565b1115610cc6576000806137426132b5565b600480546040516370a0823160e01b81526001600160a01b0393841693636bed0415938b93909116916370a082319161377d918591016156e5565b60206040518083038186803b15801561379557600080fd5b505afa1580156137a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506137cd91908101906149e2565b6040518363ffffffff1660e01b81526004016137ea9291906158c3565b604080518083038186803b15801561380157600080fd5b505afa158015613815573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506138399190810190614b69565b915091508185111561385d5760405162461bcd60e51b8152600401610a7190615bd1565b801561387b5760405162461bcd60e51b8152600401610a7190615be1565b50600195945050505050565b60048054604051636eb1769f60e11b81526000926001600160a01b039092169163da46098c91879189916138cd918891879163dd62ed3e9161317191889188910161571c565b6040518463ffffffff1660e01b81526004016138eb9392919061584b565b600060405180830381600087803b15801561390557600080fd5b505af1158015613919573d6000803e3d6000fd5b505050506139288484846130d9565b90505b949350505050565b6000611c3e6d2932bbb0b93222b9b1b937bbab1960911b614177565b6139576133e9565b6001600160a01b0316336001600160a01b031614612ae15760405162461bcd60e51b8152600401610a7190615b54565b6001600160a01b031690565b6000611c3e704c697175696461746f725265776172647360781b614177565b6002546040516001600160a01b039091169063907dff97906139dc90869086908690602001615cff565b60405160208183030381529060405260026040516139f9906156c4565b6040518091039020613a0a89613987565b6000806040518763ffffffff1660e01b815260040161183d96959493929190615a6a565b60006113cc8484846130d9565b6000613a45613993565b6001600160a01b031663c00007b0856040518263ffffffff1660e01b8152600401613a7091906156e5565b600060405180830381600087803b158015613a8a57600080fd5b505af1158015613a9e573d6000803e3d6000fd5b505050506000806000613aaf6132b5565b6001600160a01b03166372c658168860006040518363ffffffff1660e01b8152600401613add9291906158a8565b606060405180830381600087803b158015613af757600080fd5b505af1158015613b0b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250613b2f9190810190614bc9565b919450925090508015613ba857613b44613933565b6001600160a01b031663de065f678889848a6040518563ffffffff1660e01b8152600401613b759493929190615873565b600060405180830381600087803b158015613b8f57600080fd5b505af1158015613ba3573d6000803e3d6000fd5b505050505b613bb4878484886139b2565b6000613bbe61459d565b6001600160a01b0316638074b3726040518163ffffffff1660e01b815260040160206040518083038186803b158015613bf657600080fd5b505afa158015613c0a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250613c2e91908101906149e2565b90506000613c3a61459d565b6001600160a01b03166331e4e0306040518163ffffffff1660e01b815260040160206040518083038186803b158015613c7257600080fd5b505afa158015613c86573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250613caa91908101906149e2565b90506000613cb661459d565b6001600160a01b0316635616c9578b6040518263ffffffff1660e01b8152600401613ce191906156e5565b60206040518083038186803b158015613cf957600080fd5b505afa158015613d0d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250613d319190810190614708565b90506000613d408b8386613a2e565b905080613d5f5760405162461bcd60e51b8152600401610a7190615b84565b6000613d6c8c8b86613a2e565b905080613d8b5760405162461bcd60e51b8152600401610a7190615c5c565b8715613e2b576000613da58d613d9f613993565b8b613a2e565b905080613dc45760405162461bcd60e51b8152600401610a7190615c11565b613dcc613993565b6001600160a01b0316633c6b16ab8a6040518263ffffffff1660e01b8152600401613df7919061594c565b600060405180830381600087803b158015613e1157600080fd5b505af1158015613e25573d6000803e3d6000fd5b50505050505b5060019b9a5050505050505050505050565b60405162461bcd60e51b8152600401610a7190615bc1565b6000611c3e6b526577617264457363726f7760a01b614177565b60408051600780825261010082019092526060916020820160e0803883390190505090506b53797374656d53746174757360a01b81600081518110613eb057fe5b6020026020010181815250506822bc31b430b733b2b960b91b81600181518110613ed657fe5b6020026020010181815250506524b9b9bab2b960d11b81600281518110613ef957fe5b602002602001018181525050722932bbb0b93239a234b9ba3934b13aba34b7b760691b81600381518110613f2957fe5b602002602001018181525050704c697175696461746f725265776172647360781b81600481518110613f5757fe5b602002602001018181525050692634b8bab4b230ba37b960b11b81600581518110613f7e57fe5b6020026020010181815250506d2932bbb0b93222b9b1b937bbab1960911b81600681518110613fa957fe5b60200260200101818152505090565b60608151835101604051908082528060200260200182016040528015613fe8578160200160208202803883390190505b50905060005b835181101561402a5783818151811061400357fe5b602002602001015182828151811061401757fe5b6020908102919091010152600101613fee565b5060005b8251811015611fdb5782818151811061404357fe5b602002602001015182828651018151811061405a57fe5b602090810291909101015260010161402e565b6002546001600160a01b0316331480159061409357506003546001600160a01b03163314155b156140ab57600380546001600160a01b031916331790555b6000546003546001600160a01b03908116911614612ae15760405162461bcd60e51b8152600401610a7190615b44565b6002546040516001600160a01b039091169063907dff97906141019084906020016156e5565b604051602081830303815290604052600160405161411e906156b9565b6040519081900381206001600160e01b031960e086901b16825261160293929160009081908190600401615a0b565b6002546001600160a01b03163314612ae15760405162461bcd60e51b8152600401610a7190615c99565b60008181526009602090815260408083205490516001600160a01b0390911691821515916141a791869101615678565b60405160208183030381529060405290611fdb5760405162461bcd60e51b8152600401610a719190615af9565b6000611c3e6b53797374656d53746174757360a01b614177565b6008546040516321f8a72160e01b815260009161010090046001600160a01b0316906321f8a7219061422290600401615ca9565b60206040518083038186803b15801561423a57600080fd5b505afa15801561424e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506142729190810190614708565b6001600160a01b0316826001600160a01b0316148061432357506008546040516321f8a72160e01b81526101009091046001600160a01b0316906321f8a721906142be90600401615c31565b60206040518083038186803b1580156142d657600080fd5b505afa1580156142ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061430e9190810190614708565b6001600160a01b0316826001600160a01b0316145b806143c057506008546040516321f8a72160e01b81526101009091046001600160a01b0316906321f8a7219061435b90600401615b1a565b60206040518083038186803b15801561437357600080fd5b505afa158015614387573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506143ab9190810190614708565b6001600160a01b0316826001600160a01b0316145b8061445d57506008546040516321f8a72160e01b81526101009091046001600160a01b0316906321f8a721906143f890600401615b94565b60206040518083038186803b15801561441057600080fd5b505afa158015614424573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506144489190810190614708565b6001600160a01b0316826001600160a01b0316145b806144fa57506008546040516321f8a72160e01b81526101009091046001600160a01b0316906321f8a7219061449590600401615b37565b60206040518083038186803b1580156144ad57600080fd5b505afa1580156144c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506144e59190810190614708565b6001600160a01b0316826001600160a01b0316145b80610baf57506008546040516321f8a72160e01b81526101009091046001600160a01b0316906321f8a7219061453290600401615c7c565b60206040518083038186803b15801561454a57600080fd5b505afa15801561455e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506145829190810190614708565b6001600160a01b0316826001600160a01b0316149050919050565b6000611c3e692634b8bab4b230ba37b960b11b614177565b604080518082019091526000808252602082015290565b8035610ccc81615e18565b8051610ccc81615e18565b600082601f8301126145f357600080fd5b815161460661460182615d5c565b615d35565b9150818183526020840193506020810190508385602084028201111561462b57600080fd5b60005b8381101561465757816146418882614677565b845250602092830192919091019060010161462e565b5050505092915050565b8051610ccc81615e2c565b8035610ccc81615e35565b8051610ccc81615e35565b8051610ccc81615e3e565b8035610ccc81615e3e565b6000604082840312156146aa57600080fd5b6146b46040615d35565b905060006146c284846146df565b82525060206146d384848301614677565b60208301525092915050565b8051610ccc81615e47565b6000602082840312156146fc57600080fd5b600061392b84846145cc565b60006020828403121561471a57600080fd5b600061392b84846145d7565b6000806040838503121561473957600080fd5b600061474585856145cc565b9250506020614756858286016145cc565b9150509250929050565b60008060006060848603121561477557600080fd5b600061478186866145cc565b9350506020614792868287016145cc565b92505060406147a38682870161466c565b9150509250925092565b600080604083850312156147c057600080fd5b60006147cc85856145cc565b92505060206147568582860161466c565b6000806000606084860312156147f257600080fd5b60006147fe86866145cc565b93505060206147928682870161466c565b6000806000806080858703121561482557600080fd5b600061483187876145cc565b94505060206148428782880161466c565b93505060406148538782880161466c565b92505060606148648782880161466c565b91505092959194509250565b60008060008060008060c0878903121561488957600080fd5b600061489589896145cc565b96505060206148a689828a0161466c565b95505060406148b789828a0161466c565b94505060606148c889828a0161466c565b93505060806148d989828a016145cc565b92505060a06148ea89828a0161466c565b9150509295509295509295565b60008060008060008060c0878903121561491057600080fd5b600061491c89896145cc565b965050602061492d89828a0161466c565b955050604061493e89828a0161466c565b945050606061494f89828a0161466c565b935050608061496089828a0161466c565b92505060a06148ea89828a016145cc565b60006020828403121561498357600080fd5b815167ffffffffffffffff81111561499a57600080fd5b61392b848285016145e2565b6000602082840312156149b857600080fd5b600061392b8484614661565b6000602082840312156149d657600080fd5b600061392b848461466c565b6000602082840312156149f457600080fd5b600061392b8484614677565b60008060008060808587031215614a1657600080fd5b6000614831878761466c565b600080600060608486031215614a3757600080fd5b60006147fe868661466c565b600080600080600060a08688031215614a5b57600080fd5b6000614a67888861466c565b9550506020614a788882890161466c565b9450506040614a898882890161466c565b9350506060614a9a888289016145cc565b9250506080614aab8882890161466c565b9150509295509295909350565b600080600080600060a08688031215614ad057600080fd5b6000614adc888861466c565b9550506020614aed8882890161466c565b9450506040614afe8882890161466c565b9350506060614a9a8882890161466c565b600060208284031215614b2157600080fd5b600061392b8484614682565b600060208284031215614b3f57600080fd5b600061392b848461468d565b600060408284031215614b5d57600080fd5b600061392b8484614698565b60008060408385031215614b7c57600080fd5b6000614b888585614677565b925050602061475685828601614661565b60008060408385031215614bac57600080fd5b6000614bb88585614677565b925050602061475685828601614682565b600080600060608486031215614bde57600080fd5b6000614bea8686614677565b9350506020614bfb86828701614677565b92505060406147a386828701614677565b6000614c188383614c9a565b505060200190565b614c2981615dbe565b82525050565b614c2981615d90565b6000614c4382615d83565b614c4d8185615d87565b9350614c5883615d7d565b8060005b83811015614c86578151614c708882614c0c565b9750614c7b83615d7d565b925050600101614c5c565b509495945050505050565b614c2981615d9b565b614c298161122d565b614c29614caf8261122d565b61122d565b6000614cbf82615d83565b614cc98185615d87565b9350614cd9818560208601615de2565b614ce281615e0e565b9093019392505050565b614c2981615da0565b614c2981615dc9565b614c2981615dd7565b6000614d14601f83615d87565b7f43616e6e6f74207472616e7366657220746f2074686973206164647265737300815260200192915050565b75446562744d69677261746f724f6e4f7074696d69736d60501b9052565b6000614d6b603583615d87565b7f596f75206d757374206265206e6f6d696e61746564206265666f726520796f7581527402063616e20616363657074206f776e65727368697605c1b602082015260400192915050565b6e53796e746865746978457363726f7760881b9052565b6000614dd9601383615d87565b7227bbb732b91037b7363c90333ab731ba34b7b760691b815260200192915050565b6000614e08601e83615d87565b7f4f6e6c792045786368616e6765722063616e20696e766f6b6520746869730000815260200192915050565b6000614e41604483610bb2565b7f41746f6d696353796e746845786368616e676528616464726573732c6279746581527f7333322c75696e743235362c627974657333322c75696e743235362c616464726020820152636573732960e01b604082015260440192915050565b6000614ead601483615d87565b73616c6c20656e747269657320617265207a65726f60601b815260200192915050565b6000614edd601b83615d87565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000815260200192915050565b6000614f16602483615d87565b7f466c616720726577617264207472616e7366657220646964206e6f742073756381526318d9595960e21b602082015260400192915050565b6b526577617264457363726f7760a01b9052565b6000614f70601883615d87565b7f4e657720657363726f77206164647265737320756e7365740000000000000000815260200192915050565b6000614fa9602883610bb2565b7f45786368616e67655265636c61696d28616464726573732c627974657333322c81526775696e743235362960c01b602082015260280192915050565b6000614ff3601e83615d87565b7f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815260200192915050565b600061502c601383615d87565b721cdb9e081d1c985b9cd9995c8819985a5b1959606a1b815260200192915050565b600061505b601b83615d87565b7f43616e6e6f742062652072756e206f6e2074686973206c617965720000000000815260200192915050565b6000615094603183610bb2565b7f45786368616e6765547261636b696e6728627974657333322c627974657333328152702c75696e743235362c75696e743235362960781b602082015260310192915050565b60006150e7601183610bb2565b70026b4b9b9b4b7339030b2323932b9b99d1607d1b815260110192915050565b6000615114603e83610bb2565b7f53796e746845786368616e676528616464726573732c627974657333322c756981527f6e743235362c627974657333322c75696e743235362c616464726573732900006020820152603e0192915050565b6000615173602683615d87565b7f43616e6e6f74207472616e73666572207374616b6564206f7220657363726f778152650cac840a69cb60d31b602082015260400192915050565b60006151bb601e83615d87565b7f412073796e7468206f7220534e58207261746520697320696e76616c69640000815260200192915050565b60006151f4601b83615d87565b7f52657761726473446973747269627574696f6e206e6f74207365740000000000815260200192915050565b600061522d602f83615d87565b7f4f6e6c792074686520636f6e7472616374206f776e6572206d6179207065726681526e37b936903a3434b99030b1ba34b7b760891b602082015260400192915050565b600061527e602483615d87565b7f5472616e7366657220746f204c697175696461746f72526577617264732066618152631a5b195960e21b602082015260400192915050565b60006152c4602183610bb2565b7f417070726f76616c28616464726573732c616464726573732c75696e743235368152602960f81b602082015260210192915050565b6000615307602783610bb2565b7f45786368616e676552656261746528616464726573732c627974657333322c75815266696e743235362960c81b602082015260270192915050565b6000615350602483615d87565b7f4f6e6c79204c3120446562744d69677261746f72206f72204c65676163794d618152631c9ad95d60e21b602082015260400192915050565b6000615396601a83610bb2565b7f546f6b656e5374617465557064617465642861646472657373290000000000008152601a0192915050565b60006153cf603283610bb2565b7f4163636f756e744c69717569646174656428616464726573732c75696e743235815271362c75696e743235362c616464726573732960701b602082015260320192915050565b6d2932bbb0b93222b9b1b937bbab1960911b9052565b6000615439601983610bb2565b7f5265736f6c766572206d697373696e67207461726765743a2000000000000000815260190192915050565b6000615472602983615d87565b7f4c697175696461746520726577617264207472616e7366657220646964206e6f8152681d081cdd58d8d9595960ba1b602082015260400192915050565b60006154bd601583615d87565b7463616e6e6f742073656c66206c697175696461746560581b815260200192915050565b6411195c1bdd60da1b9052565b60006154fb601583615d87565b744e6f20737570706c79206973206d696e7461626c6560581b815260200192915050565b600061552c601883615d87565b7f4f6c6420657363726f77206164647265737320756e7365740000000000000000815260200192915050565b6000615565602183610bb2565b7f5472616e7366657228616464726573732c616464726573732c75696e743235368152602960f81b602082015260210192915050565b60006155a8601783615d87565b7f4f6e6c79207468652070726f78792063616e2063616c6c000000000000000000815260200192915050565b7f53796e746865746978427269646765546f4f7074696d69736d000000000000009052565b6000615606601e83615d87565b7f63616e6e6f74206d69677261746520746f2073616d6520616464726573730000815260200192915050565b732932bbb0b93222b9b1b937bbab19233937bd32b760611b9052565b614c2981615db8565b6000610ccc82614e34565b6000610ccc82614f9c565b6000610ccc82615087565b6000615683826150da565b915061568f8284614ca3565b50602001919050565b6000610ccc82615107565b6000610ccc826152b7565b6000610ccc826152fa565b6000610ccc82615389565b6000610ccc826153c2565b60006156838261542c565b6000610ccc82615558565b60208101610ccc8284614c2f565b60208101610ccc8284614c20565b6040810161570f8285614c20565b6113cf6020830184614c9a565b6040810161572a8285614c2f565b6113cf6020830184614c2f565b608081016157458287614c2f565b6157526020830186614c20565b61575f6040830185614c9a565b61576c6060830184614cfe565b95945050505050565b6101208101615784828c614c2f565b615791602083018b614c2f565b61579e604083018a614c9a565b6157ab6060830189614c9a565b6157b86080830188614c9a565b6157c560a0830187614c20565b6157d260c0830186614c91565b6157df60e0830185614c2f565b6157ed610100830184614c9a565b9a9950505050505050505050565b610120810161580a828c614c2f565b615817602083018b614c2f565b615824604083018a614c9a565b6158316060830189614c9a565b61583e6080830188614c9a565b6157c560a0830187614c2f565b606081016158598286614c2f565b6158666020830185614c2f565b61392b6040830184614c9a565b608081016158818287614c2f565b61588e6020830186614c2f565b61589b6040830185614c9a565b61576c6060830184614c9a565b604081016158b68285614c2f565b6113cf6020830184614c91565b6040810161570f8285614c2f565b60e081016158df828a614c2f565b6158ec6020830189614c9a565b6158f96040830188614c9a565b6159066060830187614c9a565b6159136080830186614c2f565b61592060a0830185614c9a565b611bb860c0830184614c9a565b602080825281016113cf8184614c38565b60208101610ccc8284614c91565b60208101610ccc8284614c9a565b6040810161572a8285614c9a565b604081016158b68285614c9a565b6040810161570f8285614c9a565b604081016159928285614c9a565b81810360208301526113cc8184614cb4565b60a081016159b28288614c9a565b6159bf6020830187614c9a565b6159cc6040830186614c9a565b6159d96060830185614c9a565b6159e66080830184614c2f565b9695505050505050565b606081016159fe8286614c9a565b6158666020830185614c9a565b60c08082528101615a1c8189614cb4565b9050615a2b6020830188614cfe565b615a386040830187614c9a565b615a456060830186614cf5565b615a526080830185614cf5565b615a5f60a0830184614cf5565b979650505050505050565b60c08082528101615a7b8189614cb4565b9050615a8a6020830188614cfe565b615a976040830187614c9a565b615a456060830186614c9a565b60c08082528101615ab58189614cb4565b9050615ac46020830188614cfe565b615ad16040830187614c9a565b615ade6060830186614c9a565b615a526080830185614c9a565b60208101610ccc8284614cec565b602080825281016113cf8184614cb4565b60208082528101610baf81614d07565b60208101610bb282614d40565b60208082528101610baf81614d5e565b60208101610bb282614db5565b60208082528101610baf81614dcc565b60208082528101610baf81614dfb565b60208082528101610baf81614ea0565b60208082528101610baf81614ed0565b60208082528101610baf81614f09565b60208101610bb282614f4f565b60208082528101610baf81614fe6565b60208082528101610baf8161501f565b60208082528101610baf8161504e565b60208082528101610baf81615166565b60208082528101610baf816151ae565b60208082528101610baf816151e7565b60208082528101610baf81615220565b60208082528101610baf81615271565b60208082528101610baf81615343565b60208101610bb282615416565b60408101615c4b82615416565b8181036020830152610baf81614f63565b60208082528101610baf81615465565b60208082528101610baf816154b0565b60208101610bb2826154e1565b60208082528101610baf816154ee565b60208082528101610baf8161559b565b60208101610bb2826155d4565b60208082528101610baf816155f9565b60408101615cd382615632565b8181036020830152610baf8161551f565b60408101615cf28285614c9a565b6113cf6020830184614cec565b60608101615d0d8286614c9a565b615d1a6020830185614c9a565b61392b6040830184614c2f565b60208101610ccc828461564e565b60405181810167ffffffffffffffff81118282101715615d5457600080fd5b604052919050565b600067ffffffffffffffff821115615d7357600080fd5b5060209081020190565b60200190565b5190565b90815260200190565b6000610baf82613987565b151590565b6000610baf82615d90565b67ffffffffffffffff1690565b60ff1690565b6000610baf82615da0565b6000610baf614caf8361122d565b6000610baf8261122d565b60005b83811015615dfd578181015183820152602001615de5565b83811115610b0f5750506000910152565b601f01601f191690565b615e2181615d90565b811461163557600080fd5b615e2181615d9b565b615e218161122d565b615e2181615da0565b615e2181615dab56fea365627a7a723158203da0feefa4691535959e364a24e007dd888c79a90e82c413a86ee4cbd7ef59b36c6578706572696d656e74616cf564736f6c63430005100040000000000000000000000000c011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f0000000000000000000000005b1b5fea1b99d83ad479df0c222f0492385381dd000000000000000000000000ede8a407913a874dd7e3d5b731afca135d30375e0000000000000000000000000000000000000000010f7997d2882ebe53a2cb800000000000000000000000004e3b31eb0e5cb73641ee1e65e7dcefe520ba3ef2

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106104495760003560e01c80636c00f310116102415780639f7698071161013b578063d37c4d8b116100c3578063e8e09b8b11610087578063e8e09b8b146108f3578063e90dd9e214610906578063ec5568891461090e578063edef719a146106b0578063ee52a2f31461091657610449565b8063d37c4d8b146108aa578063d67bdd25146108bd578063d8a1f76f146108c5578063dbf63340146108d8578063dd62ed3e146108e057610449565b8063ace88afd1161010a578063ace88afd14610856578063af086c7e14610869578063bc67f83214610871578063c2bf388014610884578063c836fa0a1461089757610449565b80639f7698071461080a578063a311c7c21461081d578063a5fdc5de14610830578063a9059cbb1461084357610449565b806384358843116101c95780639324cac71161018d5780639324cac7146107cc57806395d89b41146107d457806397107d6d146107dc5780639741fb22146107ef578063987757dd146107f757610449565b80638435884314610775578063899ffef4146107965780638a2900141461079e5780638da5cb5b146107b157806391e56b68146107b957610449565b806372cb051f1161021057806372cb051f1461072a578063741853601461073f57806379ba509714610747578063835e119c1461074f57806383d625d41461076257610449565b80636c00f310146106de5780636f01a986146106f1578063704e7b851461070457806370a082311461071757610449565b80632c955fa71161035257806344b3e923116102da5780635e22846a1161029e5780635e22846a14610695578063614d08f8146106a8578063666ed4f1146106b05780636ac0bf9c146106c35780636b76222f146106d657610449565b806344b3e9231461064a5780634e99bda91461065d578063528c7efb1461066557806353a47bb71461066d5780635af090ef1461068257610449565b806330ead7601161032157806330ead760146105f6578063313ce56714610609578063320223db1461061157806332608039146106245780633e89b9e51461063757610449565b80632c955fa7146105a85780632d3169eb146105bb5780632e0f2625146105ce5780632f7206ce146105e357610449565b806316b2213f116103d557806323b872dd116103a457806323b872dd1461055f5780632621716f14610572578063295da87d146105855780632a905318146105985780632af64bd3146105a057610449565b806316b2213f1461052957806318160ddd1461053c57806318821400146105445780631fce304d1461054c57610449565b8063095ea7b31161041c578063095ea7b3146104ab5780630e30963c146104cb5780631137aedf146104ec5780631249c58b1461050e5780631627540c1461051657610449565b806303fbc5471461044e57806304f3bcec1461045857806305b3c1c91461047657806306fdde0314610496575b600080fd5b610456610929565b005b610460610b16565b60405161046d9190615aeb565b60405180910390f35b6104896104843660046146ea565b610b2a565b60405161046d919061594c565b61049e610bb7565b60405161046d9190615af9565b6104be6104b93660046147ad565b610c45565b60405161046d919061593e565b6104de6104d9366004614a00565b610cd2565b60405161046d929190615ce4565b6104ff6104fa3660046146ea565b610de1565b60405161046d939291906159f0565b6104be610e76565b6104566105243660046146ea565b611230565b6104896105373660046146ea565b61128e565b6104896112c3565b61049e6112c9565b6104be61055a3660046149c4565b611302565b6104be61056d366004614760565b611397565b6104896105803660046146ea565b6113d6565b6104566105933660046149c4565b6115b7565b61049e611638565b6104be611657565b6104566105b63660046146ea565b611773565b6104566105c9366004614a00565b6117bf565b6105d6611875565b60405161046d9190615d27565b6104566105f13660046148f7565b61187a565b610489610604366004614a43565b61193c565b6105d66119fa565b61045661061f3660046146ea565b611a03565b6104606106323660046149c4565b611a4f565b6104896106453660046149c4565b611ad4565b610489610658366004614ab8565b611b0c565b6104be611bc4565b6104be611c43565b610675611e23565b60405161046d91906156e5565b610489610690366004614a43565b611e32565b6104be6106a33660046146ea565b611e92565b610489611ebe565b6104566106be3660046147ad565b611ece565b6104896106d13660046146ea565b611eda565b610456611fe2565b6104566106ec3660046148f7565b61208d565b6104566106ff3660046147dd565b6120e0565b6104be6107123660046147ad565b612199565b6104896107253660046146ea565b6121c4565b6107326121f6565b60405161046d919061592d565b610456612274565b6104566123c6565b61046061075d3660046149c4565b612462565b6104896107703660046149c4565b612497565b6107886107833660046146ea565b6124cf565b60405161046d929190615976565b610732612804565b6104566107ac3660046149c4565b612898565b6106756128e2565b6104896107c7366004614870565b6128f1565b6104896129b1565b61049e6129bc565b6104566107ea3660046146ea565b612a17565b610456612a6a565b6104ff6108053660046149c4565b612ae3565b610456610818366004614b2d565b612b59565b61048961082b3660046146ea565b612b85565b61048961083e3660046146ea565b612bba565b6104be6108513660046147ad565b612bef565b6104566108643660046147dd565b612c39565b610456612c86565b61045661087f3660046146ea565b612ccf565b6104566108923660046147ad565b612cf9565b6104896108a536600461480f565b612d7d565b6104896108b83660046147ad565b612e3b565b610675612ec2565b6104566108d33660046149c4565b612ed1565b610489612ed9565b6104896108ee366004614726565b612f53565b6104566109013660046147ad565b612f87565b610460612fd5565b610460612fe4565b610489610924366004614a22565b612ff3565b6109316130af565b60085460405163dacb2d0160e01b815260009161010090046001600160a01b03169063dacb2d019061096590600401615cc6565b60206040518083038186803b15801561097d57600080fd5b505afa158015610991573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506109b59190810190614708565b60085460405163dacb2d0160e01b81529192506000916101009091046001600160a01b03169063dacb2d01906109ed90600401615c3e565b60206040518083038186803b158015610a0557600080fd5b505afa158015610a19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610a3d9190810190614708565b9050816001600160a01b0316816001600160a01b03161415610a7a5760405162461bcd60e51b8152600401610a7190615cb6565b60405180910390fd5b600480546040516370a0823160e01b81526000926001600160a01b03909216916370a0823191610aac918791016156e5565b60206040518083038186803b158015610ac457600080fd5b505afa158015610ad8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610afc91908101906149e2565b90508015610b1157610b0f8383836130d9565b505b505050565b60085461010090046001600160a01b031681565b6000610b346132b5565b6001600160a01b03166305b3c1c9836040518263ffffffff1660e01b8152600401610b5f91906156e5565b60206040518083038186803b158015610b7757600080fd5b505afa158015610b8b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610baf91908101906149e2565b90505b919050565b6005805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610c3d5780601f10610c1257610100808354040283529160200191610c3d565b820191906000526020600020905b815481529060010190602001808311610c2057829003601f168201915b505050505081565b6000610c4f6132c9565b60035460048054604051633691826360e21b81526001600160a01b03938416939091169163da46098c91610c89918591899189910161584b565b600060405180830381600087803b158015610ca357600080fd5b505af1158015610cb7573d6000803e3d6000fd5b50505050610cc6818585613308565b60019150505b92915050565b6000808584610ce18282613388565b610ce96132c9565b610cf16133e9565b6001600160a01b0316634f8633d2600360009054906101000a90046001600160a01b0316600360009054906101000a90046001600160a01b03168b8b8b600360009054906101000a90046001600160a01b03166001600360009054906101000a90046001600160a01b03168e6040518a63ffffffff1660e01b8152600401610d81999897969594939291906157fb565b6040805180830381600087803b158015610d9a57600080fd5b505af1158015610dae573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610dd29190810190614b99565b93509350505094509492505050565b6000806000610dee6132b5565b6001600160a01b0316631137aedf856040518263ffffffff1660e01b8152600401610e1991906156e5565b60606040518083038186803b158015610e3157600080fd5b505afa158015610e45573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610e699190810190614bc9565b9250925092509193909250565b6000610e80613400565b6000610e8a613454565b6001600160a01b03161415610eb15760405162461bcd60e51b8152600401610a7190615bf1565b6000610ebb613475565b90506000610ec7613454565b90506000826001600160a01b031663cc5c095c6040518163ffffffff1660e01b815260040160206040518083038186803b158015610f0457600080fd5b505afa158015610f18573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610f3c91908101906149e2565b905060008111610f5e5760405162461bcd60e51b8152600401610a7190615c89565b610f6a60003083613491565b604051637e7961d760e01b81526000906001600160a01b03851690637e7961d790610f9990859060040161594c565b602060405180830381600087803b158015610fb357600080fd5b505af1158015610fc7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610feb91908101906149e2565b90506000610fff838363ffffffff6134d416565b600480546040516370a0823160e01b81529293506001600160a01b03169163b46310f691879161109b91869186916370a082319161103f918791016156e5565b60206040518083038186803b15801561105757600080fd5b505afa15801561106b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061108f91908101906149e2565b9063ffffffff6134fc16565b6040518363ffffffff1660e01b81526004016110b89291906158c3565b600060405180830381600087803b1580156110d257600080fd5b505af11580156110e6573d6000803e3d6000fd5b505050506110f5308583613491565b604051630b32e9c760e31b81526001600160a01b038516906359974e389061112190849060040161594c565b602060405180830381600087803b15801561113b57600080fd5b505af115801561114f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061117391908101906149a6565b50600480546040516370a0823160e01b81526001600160a01b039091169163b46310f69133916111b391879186916370a082319161103f918791016156f3565b6040518363ffffffff1660e01b81526004016111d0929190615701565b600060405180830381600087803b1580156111ea57600080fd5b505af11580156111fe573d6000803e3d6000fd5b5050505061120d303384613491565b600754611220908463ffffffff6134fc16565b6007555060019450505050505b90565b6112386130af565b600180546001600160a01b0319166001600160a01b0383161790556040517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce22906112839083906156e5565b60405180910390a150565b60006112986132b5565b6001600160a01b03166316b2213f836040518263ffffffff1660e01b8152600401610b5f91906156e5565b60075481565b6040518060400160405280601781526020017f53796e746865746978204e6574776f726b20546f6b656e00000000000000000081525081565b60008061130d6133e9565b6003546040516301670a7b60e21b81526001600160a01b039283169263059c29ec926113409291169087906004016158c3565b60206040518083038186803b15801561135857600080fd5b505afa15801561136c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061139091908101906149e2565b1192915050565b60006113a1613521565b6113a9613576565b6113b384836135b6565b506003546113cc906001600160a01b0316858585613887565b90505b9392505050565b6000806113e1613933565b6001600160a01b031663204b676a846040518263ffffffff1660e01b815260040161140c91906156e5565b60206040518083038186803b15801561142457600080fd5b505afa158015611438573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061145c91908101906149e2565b905060006114686145b5565b60005b8381101561159e5761147b613933565b6001600160a01b031663ae58254987836040518363ffffffff1660e01b81526004016114a89291906158c3565b60206040518083038186803b1580156114c057600080fd5b505afa1580156114d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506114f891908101906149e2565b9250611502613933565b6001600160a01b03166345626bd687856040518363ffffffff1660e01b815260040161152f9291906158c3565b604080518083038186803b15801561154657600080fd5b505afa15801561155a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061157e9190810190614b4b565b602081015190925015611596579350610bb292505050565b60010161146b565b5060405162461bcd60e51b8152600401610a7190615b64565b6115bf613400565b6115c76132c9565b6115cf6132b5565b60035460405163b06e8c6560e01b81526001600160a01b039283169263b06e8c65926116029291169085906004016158c3565b600060405180830381600087803b15801561161c57600080fd5b505af1158015611630573d6000803e3d6000fd5b505050505b50565b604051806040016040528060038152602001620a69cb60eb1b81525081565b60006060611663612804565b905060005b815181101561176a57600082828151811061167f57fe5b602090810291909101810151600081815260099092526040918290205460085492516321f8a72160e01b81529193506001600160a01b0390811692610100900416906321f8a721906116d590859060040161594c565b60206040518083038186803b1580156116ed57600080fd5b505afa158015611701573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506117259190810190614708565b6001600160a01b031614158061175057506000818152600960205260409020546001600160a01b0316155b15611761576000935050505061122d565b50600101611668565b50600191505090565b61177b613400565b6117836132c9565b61178b6132b5565b60035460405163159fa0d560e11b81526001600160a01b0392831692632b3f41aa926116029286929091169060040161571c565b6117c761394f565b6002546040516001600160a01b039091169063907dff97906117f1908690869086906020016159f0565b604051602081830303815290604052600260405161180e9061566d565b6040519081900381206001600160e01b031960e086901b16825261183d9392918a906000908190600401615a6a565b600060405180830381600087803b15801561185757600080fd5b505af115801561186b573d6000803e3d6000fd5b5050505050505050565b601281565b61188261394f565b6002546040516001600160a01b039091169063907dff97906118b090889088908890889088906020016159a4565b60405160208183030381529060405260026040516118cd90615657565b60405180910390206118de8b613987565b6000806040518763ffffffff1660e01b815260040161190296959493929190615a6a565b600060405180830381600087803b15801561191c57600080fd5b505af1158015611930573d6000803e3d6000fd5b50505050505050505050565b6000858461194a8282613388565b6119526132c9565b61195a6133e9565b6003546040516327c319e960e11b81526001600160a01b0392831692634f8633d29261199c9291169081908d908d908d9084906000908f908f906004016157fb565b6040805180830381600087803b1580156119b557600080fd5b505af11580156119c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506119ed9190810190614b99565b5098975050505050505050565b60085460ff1681565b611a0b613400565b611a136132c9565b611a1b6132b5565b60035460405163fd864ccf60e01b81526001600160a01b039283169263fd864ccf926116029286929091169060040161571c565b6000611a596132b5565b6001600160a01b03166332608039836040518263ffffffff1660e01b8152600401611a84919061594c565b60206040518083038186803b158015611a9c57600080fd5b505afa158015611ab0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610baf9190810190614b0f565b6000611ade6132b5565b6001600160a01b0316637b1001b78360016040518363ffffffff1660e01b8152600401610b5f929190615968565b60008584611b1a8282613388565b611b226132c9565b611b2a6133e9565b60035460405162674ed160e71b81526001600160a01b03928316926333a7688092611b66929116908c908c908c9084908d908d906004016158d1565b602060405180830381600087803b158015611b8057600080fd5b505af1158015611b94573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611bb891908101906149e2565b98975050505050505050565b6000611bce6132b5565b6001600160a01b0316634e99bda96040518163ffffffff1660e01b815260040160206040518083038186803b158015611c0657600080fd5b505afa158015611c1a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611c3e91908101906149a6565b905090565b6000611c4d613576565b611c556132c9565b6003546001600160a01b0316611c69613993565b6001600160a01b031663c00007b0826040518263ffffffff1660e01b8152600401611c9491906156e5565b600060405180830381600087803b158015611cae57600080fd5b505af1158015611cc2573d6000803e3d6000fd5b50505050600080611cd16132b5565b6001600160a01b03166372c658168460016040518363ffffffff1660e01b8152600401611cff9291906158a8565b606060405180830381600087803b158015611d1957600080fd5b505af1158015611d2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611d519190810190614bc9565b509150915060008111611d765760405162461bcd60e51b8152600401610a7190615c6c565b611d82838383866139b2565b6000611d9684611d90613993565b85613a2e565b905080611db55760405162461bcd60e51b8152600401610a7190615c11565b611dbd613993565b6001600160a01b0316633c6b16ab846040518263ffffffff1660e01b8152600401611de8919061594c565b600060405180830381600087803b158015611e0257600080fd5b505af1158015611e16573d6000803e3d6000fd5b5092965050505050505090565b6001546001600160a01b031681565b60008584611e408282613388565b611e486132c9565b611e506133e9565b6003546040516327c319e960e11b81526001600160a01b0392831692634f8633d29261199c9291169081908d908d908d9032906000908f908f90600401615775565b6000611e9c613576565b611ea46132c9565b600354610baf9083906000906001600160a01b0316613a3b565b680a6f2dce8d0cae8d2f60bb1b81565b611ed6613e3d565b5050565b6000611ee46132b5565b600480546040516370a0823160e01b81526001600160a01b0393841693636bed0415938793909116916370a0823191611f1f918591016156e5565b60206040518083038186803b158015611f3757600080fd5b505afa158015611f4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611f6f91908101906149e2565b6040518363ffffffff1660e01b8152600401611f8c9291906158c3565b604080518083038186803b158015611fa357600080fd5b505afa158015611fb7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611fdb9190810190614b69565b5092915050565b611fea6130af565b6004546000906001600160a01b03166370a08231612006613e55565b6040518263ffffffff1660e01b815260040161202291906156e5565b60206040518083038186803b15801561203a57600080fd5b505afa15801561204e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061207291908101906149e2565b9050611ed661207f613e55565b612087613933565b836130d9565b61209561394f565b6002546040516001600160a01b039091169063907dff97906120c390889088908890889088906020016159a4565b60405160208183030381529060405260026040516118cd90615698565b6120e861394f565b6002546040516001600160a01b039091169063907dff97906121109085908590602001615976565b604051602081830303815290604052600260405161212d906156ae565b604051809103902061213e88613987565b6000806040518763ffffffff1660e01b815260040161216296959493929190615a6a565b600060405180830381600087803b15801561217c57600080fd5b505af1158015612190573d6000803e3d6000fd5b50505050505050565b60006121a3613576565b6121ab6132c9565b6003546113cf90849084906001600160a01b0316613a3b565b600480546040516370a0823160e01b81526000926001600160a01b03909216916370a0823191610b5f918691016156e5565b60606122006132b5565b6001600160a01b03166372cb051f6040518163ffffffff1660e01b815260040160006040518083038186803b15801561223857600080fd5b505afa15801561224c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611c3e9190810190614971565b606061227e612804565b905060005b8151811015611ed657600082828151811061229a57fe5b602002602001015190506000600860019054906101000a90046001600160a01b03166001600160a01b031663dacb2d0183846040516020016122dc91906156cf565b6040516020818303038152906040526040518363ffffffff1660e01b8152600401612308929190615984565b60206040518083038186803b15801561232057600080fd5b505afa158015612334573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506123589190810190614708565b6000838152600960205260409081902080546001600160a01b0319166001600160a01b038416179055519091507f88a93678a3692f6789d9546fc621bf7234b101ddb7d4fe479455112831b8aa68906123b4908490849061595a565b60405180910390a15050600101612283565b6001546001600160a01b031633146123f05760405162461bcd60e51b8152600401610a7190615b27565b6000546001546040517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c92612433926001600160a01b039182169291169061571c565b60405180910390a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b600061246c6132b5565b6001600160a01b031663835e119c836040518263ffffffff1660e01b8152600401611a84919061594c565b60006124a16132b5565b6001600160a01b0316637b1001b78360006040518363ffffffff1660e01b8152600401610b5f929190615968565b6000806124da613576565b6008546040516321f8a72160e01b815260009161010090046001600160a01b0316906321f8a721906125299075446562744d69677261746f724f6e457468657265756d60501b9060040161594c565b60206040518083038186803b15801561254157600080fd5b505afa158015612555573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506125799190810190614708565b9050336001600160a01b038216148061263557506008546040516321f8a72160e01b81526101009091046001600160a01b0316906321f8a721906125d0906b131959d858de53585c9ad95d60a21b9060040161594c565b60206040518083038186803b1580156125e857600080fd5b505afa1580156125fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506126209190810190614708565b6001600160a01b0316336001600160a01b0316145b6126515760405162461bcd60e51b8152600401610a7190615c21565b600480546040516370a0823160e01b81526001600160a01b03909116916370a0823191612680918891016156e5565b60206040518083038186803b15801561269857600080fd5b505afa1580156126ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506126d091908101906149e2565b915081156127065760006126e5853385613a2e565b9050806127045760405162461bcd60e51b8152600401610a7190615bb1565b505b61270e613933565b6001600160a01b031663326a3cfb856040518263ffffffff1660e01b815260040161273991906156e5565b60206040518083038186803b15801561275157600080fd5b505afa158015612765573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061278991908101906149e2565b925082156127fe57612799613933565b6001600160a01b031663de065f6785338660006040518563ffffffff1660e01b81526004016127cb9493929190615737565b600060405180830381600087803b1580156127e557600080fd5b505af11580156127f9573d6000803e3d6000fd5b505050505b50915091565b60608061280f613e6f565b6040805160028082526060808301845293945090916020830190803883390190505090506b526577617264457363726f7760a01b8160008151811061285057fe5b6020026020010181815250506d537570706c795363686564756c6560901b8160018151811061287b57fe5b6020026020010181815250506128918282613fb8565b9250505090565b6128a0613400565b6128a86132c9565b6128b06132b5565b6003546040516285c0d160e31b81526001600160a01b039283169263042e0688926116029291169085906004016158c3565b6000546001600160a01b031681565b600085846128ff8282613388565b6129076132c9565b61290f6133e9565b6003546040516327c319e960e11b81526001600160a01b0392831692634f8633d292612952928e92909116908d908d908d9085906000908f908f906004016157fb565b6040805180830381600087803b15801561296b57600080fd5b505af115801561297f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506129a39190810190614b99565b509998505050505050505050565b631cd554d160e21b81565b6006805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610c3d5780601f10610c1257610100808354040283529160200191610c3d565b612a1f6130af565b600280546001600160a01b0319166001600160a01b0383161790556040517ffc80377ca9c49cc11ae6982f390a42db976d5530af7c43889264b13fbbd7c57e906112839083906156f3565b612a72613400565b612a7a6132c9565b612a826132b5565b6003546040516324beb82560e11b81526001600160a01b039283169263497d704a92612ab3929116906004016156e5565b600060405180830381600087803b158015612acd57600080fd5b505af1158015610b0f573d6000803e3d6000fd5b565b6000806000612af06132c9565b612af86133e9565b6003546040516306c5a00b60e21b81526001600160a01b0392831692631b16802c92612b2b9291169088906004016158c3565b606060405180830381600087803b158015612b4557600080fd5b505af1158015610e45573d6000803e3d6000fd5b612b6161406d565b600480546001600160a01b0319166001600160a01b038316179055611635816140db565b6000612b8f6132b5565b6001600160a01b031663a311c7c2836040518263ffffffff1660e01b8152600401610b5f91906156e5565b6000612bc46132b5565b6001600160a01b031663a5fdc5de836040518263ffffffff1660e01b8152600401610b5f91906156e5565b6000612bf9613521565b612c01613576565b600354612c17906001600160a01b0316836135b6565b50600354612c2f906001600160a01b03168484613a2e565b5060019392505050565b612c4161394f565b6002546040516001600160a01b039091169063907dff9790612c699085908590602001615976565b604051602081830303815290604052600260405161212d90615662565b612c8e613400565b612c966132c9565b612c9e6132b5565b60035460405163644bb89960e11b81526001600160a01b039283169263c897713292612ab3929116906004016156e5565b612cd761414d565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b612d01613400565b612d096132c9565b612d116132b5565b600354604051632694552d60e21b81526001600160a01b0392831692639a5154b492612d4792879290911690869060040161584b565b600060405180830381600087803b158015612d6157600080fd5b505af1158015612d75573d6000803e3d6000fd5b505050505050565b60008382612d8b8282613388565b612d936132c9565b612d9b6133e9565b6003546040516327c319e960e11b81526001600160a01b0392831692634f8633d292612dde928c92909116908b908b908b908590600090829082906004016157fb565b6040805180830381600087803b158015612df757600080fd5b505af1158015612e0b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250612e2f9190810190614b99565b50979650505050505050565b6000612e456132b5565b6001600160a01b031663d37c4d8b84846040518363ffffffff1660e01b8152600401612e729291906158c3565b60206040518083038186803b158015612e8a57600080fd5b505afa158015612e9e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506113cf91908101906149e2565b6003546001600160a01b031681565b611635613e3d565b6000612ee36132b5565b6001600160a01b031663dbf633406040518163ffffffff1660e01b815260040160206040518083038186803b158015612f1b57600080fd5b505afa158015612f2f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611c3e91908101906149e2565b60048054604051636eb1769f60e11b81526000926001600160a01b039092169163dd62ed3e91612e7291879187910161571c565b612f8f613400565b612f976132c9565b612f9f6132b5565b60035460405163227635b160e11b81526001600160a01b03928316926344ec6b6292612d4792879290911690869060040161584b565b6004546001600160a01b031681565b6002546001600160a01b031681565b600083826130018282613388565b6130096132c9565b6130116133e9565b6003546040516327c319e960e11b81526001600160a01b0392831692634f8633d2926130539291169081908b908b908b908490600090829082906004016157fb565b6040805180830381600087803b15801561306c57600080fd5b505af1158015613080573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506130a49190810190614b99565b509695505050505050565b6000546001600160a01b03163314612ae15760405162461bcd60e51b8152600401610a7190615c01565b60006001600160a01b038316158015906130fc57506001600160a01b0383163014155b801561311657506002546001600160a01b03848116911614155b6131325760405162461bcd60e51b8152600401610a7190615b0a565b600480546040516370a0823160e01b81526001600160a01b039091169163b46310f69187916131cd91879186916370a0823191613171918791016156e5565b60206040518083038186803b15801561318957600080fd5b505afa15801561319d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506131c191908101906149e2565b9063ffffffff6134d416565b6040518363ffffffff1660e01b81526004016131ea9291906158c3565b600060405180830381600087803b15801561320457600080fd5b505af1158015613218573d6000803e3d6000fd5b5050600480546040516370a0823160e01b81526001600160a01b03909116935063b46310f69250869161325b91879186916370a082319161103f918791016156e5565b6040518363ffffffff1660e01b81526004016132789291906158c3565b600060405180830381600087803b15801561329257600080fd5b505af11580156132a6573d6000803e3d6000fd5b50505050612c2f848484613491565b6000611c3e6524b9b9bab2b960d11b614177565b6002546001600160a01b031633148015906132ef57506003546001600160a01b03163314155b15612ae157600380546001600160a01b03191633179055565b6002546040516001600160a01b039091169063907dff979061332e90849060200161594c565b604051602081830303815290604052600360405161334b906156a3565b604051809103902061335c88613987565b61336588613987565b60006040518763ffffffff1660e01b815260040161216296959493929190615aa4565b6133906141d4565b6001600160a01b0316631ce00ba283836040518363ffffffff1660e01b81526004016133bd929190615976565b60006040518083038186803b1580156133d557600080fd5b505afa158015612d75573d6000803e3d6000fd5b6000611c3e6822bc31b430b733b2b960b91b614177565b6134086141d4565b6001600160a01b0316637c3125416040518163ffffffff1660e01b815260040160006040518083038186803b15801561344057600080fd5b505afa158015610b0f573d6000803e3d6000fd5b6000611c3e722932bbb0b93239a234b9ba3934b13aba34b7b760691b614177565b6000611c3e6d537570706c795363686564756c6560901b614177565b6002546040516001600160a01b039091169063907dff97906134b790849060200161594c565b604051602081830303815290604052600360405161334b906156da565b6000828211156134f65760405162461bcd60e51b8152600401610a7190615ba1565b50900390565b6000828201838110156113cf5760405162461bcd60e51b8152600401610a7190615b74565b6002546001600160a01b031633141561353957612ae1565b613542336141ee565b1561355e57600380546001600160a01b03191633179055612ae1565b60405162461bcd60e51b8152600401610a7190615c99565b61357e6141d4565b6001600160a01b031663086dabd16040518163ffffffff1660e01b815260040160006040518083038186803b15801561344057600080fd5b6008546040516321f8a72160e01b815260009182916101009091046001600160a01b0316906321f8a721906135fe906b131959d858de53585c9ad95d60a21b9060040161594c565b60206040518083038186803b15801561361657600080fd5b505afa15801561362a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061364e9190810190614708565b6003549091506001600160a01b03161580159061367857506003546001600160a01b038281169116145b806136945750806001600160a01b0316846001600160a01b0316145b156136a3576001915050610ccc565b60006136ad6132b5565b6001600160a01b031663d37c4d8b86631cd554d160e21b6040518363ffffffff1660e01b81526004016136e19291906158c3565b60206040518083038186803b1580156136f957600080fd5b505afa15801561370d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061373191908101906149e2565b1115610cc6576000806137426132b5565b600480546040516370a0823160e01b81526001600160a01b0393841693636bed0415938b93909116916370a082319161377d918591016156e5565b60206040518083038186803b15801561379557600080fd5b505afa1580156137a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506137cd91908101906149e2565b6040518363ffffffff1660e01b81526004016137ea9291906158c3565b604080518083038186803b15801561380157600080fd5b505afa158015613815573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506138399190810190614b69565b915091508185111561385d5760405162461bcd60e51b8152600401610a7190615bd1565b801561387b5760405162461bcd60e51b8152600401610a7190615be1565b50600195945050505050565b60048054604051636eb1769f60e11b81526000926001600160a01b039092169163da46098c91879189916138cd918891879163dd62ed3e9161317191889188910161571c565b6040518463ffffffff1660e01b81526004016138eb9392919061584b565b600060405180830381600087803b15801561390557600080fd5b505af1158015613919573d6000803e3d6000fd5b505050506139288484846130d9565b90505b949350505050565b6000611c3e6d2932bbb0b93222b9b1b937bbab1960911b614177565b6139576133e9565b6001600160a01b0316336001600160a01b031614612ae15760405162461bcd60e51b8152600401610a7190615b54565b6001600160a01b031690565b6000611c3e704c697175696461746f725265776172647360781b614177565b6002546040516001600160a01b039091169063907dff97906139dc90869086908690602001615cff565b60405160208183030381529060405260026040516139f9906156c4565b6040518091039020613a0a89613987565b6000806040518763ffffffff1660e01b815260040161183d96959493929190615a6a565b60006113cc8484846130d9565b6000613a45613993565b6001600160a01b031663c00007b0856040518263ffffffff1660e01b8152600401613a7091906156e5565b600060405180830381600087803b158015613a8a57600080fd5b505af1158015613a9e573d6000803e3d6000fd5b505050506000806000613aaf6132b5565b6001600160a01b03166372c658168860006040518363ffffffff1660e01b8152600401613add9291906158a8565b606060405180830381600087803b158015613af757600080fd5b505af1158015613b0b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250613b2f9190810190614bc9565b919450925090508015613ba857613b44613933565b6001600160a01b031663de065f678889848a6040518563ffffffff1660e01b8152600401613b759493929190615873565b600060405180830381600087803b158015613b8f57600080fd5b505af1158015613ba3573d6000803e3d6000fd5b505050505b613bb4878484886139b2565b6000613bbe61459d565b6001600160a01b0316638074b3726040518163ffffffff1660e01b815260040160206040518083038186803b158015613bf657600080fd5b505afa158015613c0a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250613c2e91908101906149e2565b90506000613c3a61459d565b6001600160a01b03166331e4e0306040518163ffffffff1660e01b815260040160206040518083038186803b158015613c7257600080fd5b505afa158015613c86573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250613caa91908101906149e2565b90506000613cb661459d565b6001600160a01b0316635616c9578b6040518263ffffffff1660e01b8152600401613ce191906156e5565b60206040518083038186803b158015613cf957600080fd5b505afa158015613d0d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250613d319190810190614708565b90506000613d408b8386613a2e565b905080613d5f5760405162461bcd60e51b8152600401610a7190615b84565b6000613d6c8c8b86613a2e565b905080613d8b5760405162461bcd60e51b8152600401610a7190615c5c565b8715613e2b576000613da58d613d9f613993565b8b613a2e565b905080613dc45760405162461bcd60e51b8152600401610a7190615c11565b613dcc613993565b6001600160a01b0316633c6b16ab8a6040518263ffffffff1660e01b8152600401613df7919061594c565b600060405180830381600087803b158015613e1157600080fd5b505af1158015613e25573d6000803e3d6000fd5b50505050505b5060019b9a5050505050505050505050565b60405162461bcd60e51b8152600401610a7190615bc1565b6000611c3e6b526577617264457363726f7760a01b614177565b60408051600780825261010082019092526060916020820160e0803883390190505090506b53797374656d53746174757360a01b81600081518110613eb057fe5b6020026020010181815250506822bc31b430b733b2b960b91b81600181518110613ed657fe5b6020026020010181815250506524b9b9bab2b960d11b81600281518110613ef957fe5b602002602001018181525050722932bbb0b93239a234b9ba3934b13aba34b7b760691b81600381518110613f2957fe5b602002602001018181525050704c697175696461746f725265776172647360781b81600481518110613f5757fe5b602002602001018181525050692634b8bab4b230ba37b960b11b81600581518110613f7e57fe5b6020026020010181815250506d2932bbb0b93222b9b1b937bbab1960911b81600681518110613fa957fe5b60200260200101818152505090565b60608151835101604051908082528060200260200182016040528015613fe8578160200160208202803883390190505b50905060005b835181101561402a5783818151811061400357fe5b602002602001015182828151811061401757fe5b6020908102919091010152600101613fee565b5060005b8251811015611fdb5782818151811061404357fe5b602002602001015182828651018151811061405a57fe5b602090810291909101015260010161402e565b6002546001600160a01b0316331480159061409357506003546001600160a01b03163314155b156140ab57600380546001600160a01b031916331790555b6000546003546001600160a01b03908116911614612ae15760405162461bcd60e51b8152600401610a7190615b44565b6002546040516001600160a01b039091169063907dff97906141019084906020016156e5565b604051602081830303815290604052600160405161411e906156b9565b6040519081900381206001600160e01b031960e086901b16825261160293929160009081908190600401615a0b565b6002546001600160a01b03163314612ae15760405162461bcd60e51b8152600401610a7190615c99565b60008181526009602090815260408083205490516001600160a01b0390911691821515916141a791869101615678565b60405160208183030381529060405290611fdb5760405162461bcd60e51b8152600401610a719190615af9565b6000611c3e6b53797374656d53746174757360a01b614177565b6008546040516321f8a72160e01b815260009161010090046001600160a01b0316906321f8a7219061422290600401615ca9565b60206040518083038186803b15801561423a57600080fd5b505afa15801561424e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506142729190810190614708565b6001600160a01b0316826001600160a01b0316148061432357506008546040516321f8a72160e01b81526101009091046001600160a01b0316906321f8a721906142be90600401615c31565b60206040518083038186803b1580156142d657600080fd5b505afa1580156142ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061430e9190810190614708565b6001600160a01b0316826001600160a01b0316145b806143c057506008546040516321f8a72160e01b81526101009091046001600160a01b0316906321f8a7219061435b90600401615b1a565b60206040518083038186803b15801561437357600080fd5b505afa158015614387573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506143ab9190810190614708565b6001600160a01b0316826001600160a01b0316145b8061445d57506008546040516321f8a72160e01b81526101009091046001600160a01b0316906321f8a721906143f890600401615b94565b60206040518083038186803b15801561441057600080fd5b505afa158015614424573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506144489190810190614708565b6001600160a01b0316826001600160a01b0316145b806144fa57506008546040516321f8a72160e01b81526101009091046001600160a01b0316906321f8a7219061449590600401615b37565b60206040518083038186803b1580156144ad57600080fd5b505afa1580156144c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506144e59190810190614708565b6001600160a01b0316826001600160a01b0316145b80610baf57506008546040516321f8a72160e01b81526101009091046001600160a01b0316906321f8a7219061453290600401615c7c565b60206040518083038186803b15801561454a57600080fd5b505afa15801561455e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506145829190810190614708565b6001600160a01b0316826001600160a01b0316149050919050565b6000611c3e692634b8bab4b230ba37b960b11b614177565b604080518082019091526000808252602082015290565b8035610ccc81615e18565b8051610ccc81615e18565b600082601f8301126145f357600080fd5b815161460661460182615d5c565b615d35565b9150818183526020840193506020810190508385602084028201111561462b57600080fd5b60005b8381101561465757816146418882614677565b845250602092830192919091019060010161462e565b5050505092915050565b8051610ccc81615e2c565b8035610ccc81615e35565b8051610ccc81615e35565b8051610ccc81615e3e565b8035610ccc81615e3e565b6000604082840312156146aa57600080fd5b6146b46040615d35565b905060006146c284846146df565b82525060206146d384848301614677565b60208301525092915050565b8051610ccc81615e47565b6000602082840312156146fc57600080fd5b600061392b84846145cc565b60006020828403121561471a57600080fd5b600061392b84846145d7565b6000806040838503121561473957600080fd5b600061474585856145cc565b9250506020614756858286016145cc565b9150509250929050565b60008060006060848603121561477557600080fd5b600061478186866145cc565b9350506020614792868287016145cc565b92505060406147a38682870161466c565b9150509250925092565b600080604083850312156147c057600080fd5b60006147cc85856145cc565b92505060206147568582860161466c565b6000806000606084860312156147f257600080fd5b60006147fe86866145cc565b93505060206147928682870161466c565b6000806000806080858703121561482557600080fd5b600061483187876145cc565b94505060206148428782880161466c565b93505060406148538782880161466c565b92505060606148648782880161466c565b91505092959194509250565b60008060008060008060c0878903121561488957600080fd5b600061489589896145cc565b96505060206148a689828a0161466c565b95505060406148b789828a0161466c565b94505060606148c889828a0161466c565b93505060806148d989828a016145cc565b92505060a06148ea89828a0161466c565b9150509295509295509295565b60008060008060008060c0878903121561491057600080fd5b600061491c89896145cc565b965050602061492d89828a0161466c565b955050604061493e89828a0161466c565b945050606061494f89828a0161466c565b935050608061496089828a0161466c565b92505060a06148ea89828a016145cc565b60006020828403121561498357600080fd5b815167ffffffffffffffff81111561499a57600080fd5b61392b848285016145e2565b6000602082840312156149b857600080fd5b600061392b8484614661565b6000602082840312156149d657600080fd5b600061392b848461466c565b6000602082840312156149f457600080fd5b600061392b8484614677565b60008060008060808587031215614a1657600080fd5b6000614831878761466c565b600080600060608486031215614a3757600080fd5b60006147fe868661466c565b600080600080600060a08688031215614a5b57600080fd5b6000614a67888861466c565b9550506020614a788882890161466c565b9450506040614a898882890161466c565b9350506060614a9a888289016145cc565b9250506080614aab8882890161466c565b9150509295509295909350565b600080600080600060a08688031215614ad057600080fd5b6000614adc888861466c565b9550506020614aed8882890161466c565b9450506040614afe8882890161466c565b9350506060614a9a8882890161466c565b600060208284031215614b2157600080fd5b600061392b8484614682565b600060208284031215614b3f57600080fd5b600061392b848461468d565b600060408284031215614b5d57600080fd5b600061392b8484614698565b60008060408385031215614b7c57600080fd5b6000614b888585614677565b925050602061475685828601614661565b60008060408385031215614bac57600080fd5b6000614bb88585614677565b925050602061475685828601614682565b600080600060608486031215614bde57600080fd5b6000614bea8686614677565b9350506020614bfb86828701614677565b92505060406147a386828701614677565b6000614c188383614c9a565b505060200190565b614c2981615dbe565b82525050565b614c2981615d90565b6000614c4382615d83565b614c4d8185615d87565b9350614c5883615d7d565b8060005b83811015614c86578151614c708882614c0c565b9750614c7b83615d7d565b925050600101614c5c565b509495945050505050565b614c2981615d9b565b614c298161122d565b614c29614caf8261122d565b61122d565b6000614cbf82615d83565b614cc98185615d87565b9350614cd9818560208601615de2565b614ce281615e0e565b9093019392505050565b614c2981615da0565b614c2981615dc9565b614c2981615dd7565b6000614d14601f83615d87565b7f43616e6e6f74207472616e7366657220746f2074686973206164647265737300815260200192915050565b75446562744d69677261746f724f6e4f7074696d69736d60501b9052565b6000614d6b603583615d87565b7f596f75206d757374206265206e6f6d696e61746564206265666f726520796f7581527402063616e20616363657074206f776e65727368697605c1b602082015260400192915050565b6e53796e746865746978457363726f7760881b9052565b6000614dd9601383615d87565b7227bbb732b91037b7363c90333ab731ba34b7b760691b815260200192915050565b6000614e08601e83615d87565b7f4f6e6c792045786368616e6765722063616e20696e766f6b6520746869730000815260200192915050565b6000614e41604483610bb2565b7f41746f6d696353796e746845786368616e676528616464726573732c6279746581527f7333322c75696e743235362c627974657333322c75696e743235362c616464726020820152636573732960e01b604082015260440192915050565b6000614ead601483615d87565b73616c6c20656e747269657320617265207a65726f60601b815260200192915050565b6000614edd601b83615d87565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000815260200192915050565b6000614f16602483615d87565b7f466c616720726577617264207472616e7366657220646964206e6f742073756381526318d9595960e21b602082015260400192915050565b6b526577617264457363726f7760a01b9052565b6000614f70601883615d87565b7f4e657720657363726f77206164647265737320756e7365740000000000000000815260200192915050565b6000614fa9602883610bb2565b7f45786368616e67655265636c61696d28616464726573732c627974657333322c81526775696e743235362960c01b602082015260280192915050565b6000614ff3601e83615d87565b7f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815260200192915050565b600061502c601383615d87565b721cdb9e081d1c985b9cd9995c8819985a5b1959606a1b815260200192915050565b600061505b601b83615d87565b7f43616e6e6f742062652072756e206f6e2074686973206c617965720000000000815260200192915050565b6000615094603183610bb2565b7f45786368616e6765547261636b696e6728627974657333322c627974657333328152702c75696e743235362c75696e743235362960781b602082015260310192915050565b60006150e7601183610bb2565b70026b4b9b9b4b7339030b2323932b9b99d1607d1b815260110192915050565b6000615114603e83610bb2565b7f53796e746845786368616e676528616464726573732c627974657333322c756981527f6e743235362c627974657333322c75696e743235362c616464726573732900006020820152603e0192915050565b6000615173602683615d87565b7f43616e6e6f74207472616e73666572207374616b6564206f7220657363726f778152650cac840a69cb60d31b602082015260400192915050565b60006151bb601e83615d87565b7f412073796e7468206f7220534e58207261746520697320696e76616c69640000815260200192915050565b60006151f4601b83615d87565b7f52657761726473446973747269627574696f6e206e6f74207365740000000000815260200192915050565b600061522d602f83615d87565b7f4f6e6c792074686520636f6e7472616374206f776e6572206d6179207065726681526e37b936903a3434b99030b1ba34b7b760891b602082015260400192915050565b600061527e602483615d87565b7f5472616e7366657220746f204c697175696461746f72526577617264732066618152631a5b195960e21b602082015260400192915050565b60006152c4602183610bb2565b7f417070726f76616c28616464726573732c616464726573732c75696e743235368152602960f81b602082015260210192915050565b6000615307602783610bb2565b7f45786368616e676552656261746528616464726573732c627974657333322c75815266696e743235362960c81b602082015260270192915050565b6000615350602483615d87565b7f4f6e6c79204c3120446562744d69677261746f72206f72204c65676163794d618152631c9ad95d60e21b602082015260400192915050565b6000615396601a83610bb2565b7f546f6b656e5374617465557064617465642861646472657373290000000000008152601a0192915050565b60006153cf603283610bb2565b7f4163636f756e744c69717569646174656428616464726573732c75696e743235815271362c75696e743235362c616464726573732960701b602082015260320192915050565b6d2932bbb0b93222b9b1b937bbab1960911b9052565b6000615439601983610bb2565b7f5265736f6c766572206d697373696e67207461726765743a2000000000000000815260190192915050565b6000615472602983615d87565b7f4c697175696461746520726577617264207472616e7366657220646964206e6f8152681d081cdd58d8d9595960ba1b602082015260400192915050565b60006154bd601583615d87565b7463616e6e6f742073656c66206c697175696461746560581b815260200192915050565b6411195c1bdd60da1b9052565b60006154fb601583615d87565b744e6f20737570706c79206973206d696e7461626c6560581b815260200192915050565b600061552c601883615d87565b7f4f6c6420657363726f77206164647265737320756e7365740000000000000000815260200192915050565b6000615565602183610bb2565b7f5472616e7366657228616464726573732c616464726573732c75696e743235368152602960f81b602082015260210192915050565b60006155a8601783615d87565b7f4f6e6c79207468652070726f78792063616e2063616c6c000000000000000000815260200192915050565b7f53796e746865746978427269646765546f4f7074696d69736d000000000000009052565b6000615606601e83615d87565b7f63616e6e6f74206d69677261746520746f2073616d6520616464726573730000815260200192915050565b732932bbb0b93222b9b1b937bbab19233937bd32b760611b9052565b614c2981615db8565b6000610ccc82614e34565b6000610ccc82614f9c565b6000610ccc82615087565b6000615683826150da565b915061568f8284614ca3565b50602001919050565b6000610ccc82615107565b6000610ccc826152b7565b6000610ccc826152fa565b6000610ccc82615389565b6000610ccc826153c2565b60006156838261542c565b6000610ccc82615558565b60208101610ccc8284614c2f565b60208101610ccc8284614c20565b6040810161570f8285614c20565b6113cf6020830184614c9a565b6040810161572a8285614c2f565b6113cf6020830184614c2f565b608081016157458287614c2f565b6157526020830186614c20565b61575f6040830185614c9a565b61576c6060830184614cfe565b95945050505050565b6101208101615784828c614c2f565b615791602083018b614c2f565b61579e604083018a614c9a565b6157ab6060830189614c9a565b6157b86080830188614c9a565b6157c560a0830187614c20565b6157d260c0830186614c91565b6157df60e0830185614c2f565b6157ed610100830184614c9a565b9a9950505050505050505050565b610120810161580a828c614c2f565b615817602083018b614c2f565b615824604083018a614c9a565b6158316060830189614c9a565b61583e6080830188614c9a565b6157c560a0830187614c2f565b606081016158598286614c2f565b6158666020830185614c2f565b61392b6040830184614c9a565b608081016158818287614c2f565b61588e6020830186614c2f565b61589b6040830185614c9a565b61576c6060830184614c9a565b604081016158b68285614c2f565b6113cf6020830184614c91565b6040810161570f8285614c2f565b60e081016158df828a614c2f565b6158ec6020830189614c9a565b6158f96040830188614c9a565b6159066060830187614c9a565b6159136080830186614c2f565b61592060a0830185614c9a565b611bb860c0830184614c9a565b602080825281016113cf8184614c38565b60208101610ccc8284614c91565b60208101610ccc8284614c9a565b6040810161572a8285614c9a565b604081016158b68285614c9a565b6040810161570f8285614c9a565b604081016159928285614c9a565b81810360208301526113cc8184614cb4565b60a081016159b28288614c9a565b6159bf6020830187614c9a565b6159cc6040830186614c9a565b6159d96060830185614c9a565b6159e66080830184614c2f565b9695505050505050565b606081016159fe8286614c9a565b6158666020830185614c9a565b60c08082528101615a1c8189614cb4565b9050615a2b6020830188614cfe565b615a386040830187614c9a565b615a456060830186614cf5565b615a526080830185614cf5565b615a5f60a0830184614cf5565b979650505050505050565b60c08082528101615a7b8189614cb4565b9050615a8a6020830188614cfe565b615a976040830187614c9a565b615a456060830186614c9a565b60c08082528101615ab58189614cb4565b9050615ac46020830188614cfe565b615ad16040830187614c9a565b615ade6060830186614c9a565b615a526080830185614c9a565b60208101610ccc8284614cec565b602080825281016113cf8184614cb4565b60208082528101610baf81614d07565b60208101610bb282614d40565b60208082528101610baf81614d5e565b60208101610bb282614db5565b60208082528101610baf81614dcc565b60208082528101610baf81614dfb565b60208082528101610baf81614ea0565b60208082528101610baf81614ed0565b60208082528101610baf81614f09565b60208101610bb282614f4f565b60208082528101610baf81614fe6565b60208082528101610baf8161501f565b60208082528101610baf8161504e565b60208082528101610baf81615166565b60208082528101610baf816151ae565b60208082528101610baf816151e7565b60208082528101610baf81615220565b60208082528101610baf81615271565b60208082528101610baf81615343565b60208101610bb282615416565b60408101615c4b82615416565b8181036020830152610baf81614f63565b60208082528101610baf81615465565b60208082528101610baf816154b0565b60208101610bb2826154e1565b60208082528101610baf816154ee565b60208082528101610baf8161559b565b60208101610bb2826155d4565b60208082528101610baf816155f9565b60408101615cd382615632565b8181036020830152610baf8161551f565b60408101615cf28285614c9a565b6113cf6020830184614cec565b60608101615d0d8286614c9a565b615d1a6020830185614c9a565b61392b6040830184614c2f565b60208101610ccc828461564e565b60405181810167ffffffffffffffff81118282101715615d5457600080fd5b604052919050565b600067ffffffffffffffff821115615d7357600080fd5b5060209081020190565b60200190565b5190565b90815260200190565b6000610baf82613987565b151590565b6000610baf82615d90565b67ffffffffffffffff1690565b60ff1690565b6000610baf82615da0565b6000610baf614caf8361122d565b6000610baf8261122d565b60005b83811015615dfd578181015183820152602001615de5565b83811115610b0f5750506000910152565b601f01601f191690565b615e2181615d90565b811461163557600080fd5b615e2181615d9b565b615e218161122d565b615e2181615da0565b615e2181615dab56fea365627a7a723158203da0feefa4691535959e364a24e007dd888c79a90e82c413a86ee4cbd7ef59b36c6578706572696d656e74616cf564736f6c63430005100040

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

000000000000000000000000c011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f0000000000000000000000005b1b5fea1b99d83ad479df0c222f0492385381dd000000000000000000000000ede8a407913a874dd7e3d5b731afca135d30375e0000000000000000000000000000000000000000010f7997d2882ebe53a2cb800000000000000000000000004e3b31eb0e5cb73641ee1e65e7dcefe520ba3ef2

-----Decoded View---------------
Arg [0] : _proxy (address): 0xC011a73ee8576Fb46F5E1c5751cA3B9Fe0af2a6F
Arg [1] : _tokenState (address): 0x5b1b5fEa1b99D83aD479dF0C222F0492385381dD
Arg [2] : _owner (address): 0xEde8a407913A874Dd7e3d5B731AFcA135D30375E
Arg [3] : _totalSupply (uint256): 328193104088773603337882496
Arg [4] : _resolver (address): 0x4E3b31eB0E5CB73641EE1E65E7dCEFe520bA3ef2

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 000000000000000000000000c011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f
Arg [1] : 0000000000000000000000005b1b5fea1b99d83ad479df0c222f0492385381dd
Arg [2] : 000000000000000000000000ede8a407913a874dd7e3d5b731afca135d30375e
Arg [3] : 0000000000000000000000000000000000000000010f7997d2882ebe53a2cb80
Arg [4] : 0000000000000000000000004e3b31eb0e5cb73641ee1e65e7dcefe520ba3ef2


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

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