Contract 0x2fb33E35829D2bb04D8b5eB9531DA129E72BceD4

Contract Overview

Balance:
0 Ether
Txn Hash Method
Block
From
To
Value
0x282b75031707231e0f629a39931c0dd9ee1f49c9db679af69f7e146e06722ab0Accept Ownership243391052021-04-19 22:10:1228 days 21 hrs ago0x73570075092502472e4b61a7058df1a4a1db12f2 IN  0x2fb33e35829d2bb04d8b5eb9531da129e72bced40 Ether0.0000217631
0xe222efb8dbe7d025f8241ff1e5ec18da0b91e58f924630c02ee5a7796d009f32Nominate New Own...243380922021-04-19 21:01:3228 days 23 hrs ago0xb64ff7a4a33acdf48d97dab0d764afd0f6176882 IN  0x2fb33e35829d2bb04d8b5eb9531da129e72bced40 Ether0.0000444591
0x2ac826b8adfb087d49ccd2e3c36fef75204ced541f17f2c07093a265842565a7Approve234261312021-02-11 21:36:1295 days 22 hrs ago0x3aad40a8a3fe3ba8fc21a223dcf0988516ee7d8c IN  0x2fb33e35829d2bb04d8b5eb9531da129e72bced40 Ether0.0005887539.5
0xf31a4521d45d205d6b5a0b8e9849b973ee5bb5fb3b3b2899891e67f08cc9b03c0x60806040227146062020-12-22 13:37:40147 days 6 hrs ago0xb64ff7a4a33acdf48d97dab0d764afd0f6176882 IN  Contract Creation0 Ether0.0053261582
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0xdb28144cc8eee2b4ed6a943efd5e7c750d856aa1c1949d23eabe1a997a99c769248090072021-05-13 6:18:325 days 13 hrs ago 0xdcb48e969e69df65f72f77b2aae145509733e5c0 0x2fb33e35829d2bb04d8b5eb9531da129e72bced40 Ether
0x3c9511b6aacae18707e9eeabbaca6793799f00f02cd17c49592ba4e9fcef6ee1248063692021-05-13 1:57:445 days 18 hrs ago 0xdcb48e969e69df65f72f77b2aae145509733e5c0 0x2fb33e35829d2bb04d8b5eb9531da129e72bced40 Ether
0x3c9511b6aacae18707e9eeabbaca6793799f00f02cd17c49592ba4e9fcef6ee1248063692021-05-13 1:57:445 days 18 hrs ago 0x2fb33e35829d2bb04d8b5eb9531da129e72bced4 0x54c4b5cb58c880dd1734123c8b588e49edf442fb0 Ether
0x3c9511b6aacae18707e9eeabbaca6793799f00f02cd17c49592ba4e9fcef6ee1248063692021-05-13 1:57:445 days 18 hrs ago 0x2fb33e35829d2bb04d8b5eb9531da129e72bced4 0x54c4b5cb58c880dd1734123c8b588e49edf442fb0 Ether
0x3c9511b6aacae18707e9eeabbaca6793799f00f02cd17c49592ba4e9fcef6ee1248063692021-05-13 1:57:445 days 18 hrs ago 0x2fb33e35829d2bb04d8b5eb9531da129e72bced4 0xfbb6526ed92da8915d4843a86166020d0b7baad00 Ether
0x3c9511b6aacae18707e9eeabbaca6793799f00f02cd17c49592ba4e9fcef6ee1248063692021-05-13 1:57:445 days 18 hrs ago 0x2fb33e35829d2bb04d8b5eb9531da129e72bced4 0xfbb6526ed92da8915d4843a86166020d0b7baad00 Ether
0x3c9511b6aacae18707e9eeabbaca6793799f00f02cd17c49592ba4e9fcef6ee1248063692021-05-13 1:57:445 days 18 hrs ago 0x2fb33e35829d2bb04d8b5eb9531da129e72bced4 0x53bae964339e8a742b5b47f6c10bbfa8ff138f340 Ether
0x3c9511b6aacae18707e9eeabbaca6793799f00f02cd17c49592ba4e9fcef6ee1248063692021-05-13 1:57:445 days 18 hrs ago 0xf1d0ee19af243bcbc140a2259290b490e4df92a9 0x2fb33e35829d2bb04d8b5eb9531da129e72bced40 Ether
0x2b66d93a64fe10eb5a820a61e38130e78363148d25251a737edbe929ea6780c2248040602021-05-12 22:08:325 days 21 hrs ago 0x53bae964339e8a742b5b47f6c10bbfa8ff138f34 0x2fb33e35829d2bb04d8b5eb9531da129e72bced40 Ether
0x2b66d93a64fe10eb5a820a61e38130e78363148d25251a737edbe929ea6780c2248040602021-05-12 22:08:325 days 21 hrs ago 0xdcb48e969e69df65f72f77b2aae145509733e5c0 0x2fb33e35829d2bb04d8b5eb9531da129e72bced40 Ether
0xd825781ff60114b6b44789f0f99893951e2bc57c2ab624fa747916bf03265485248017742021-05-12 18:22:206 days 1 hr ago 0x2fb33e35829d2bb04d8b5eb9531da129e72bced4 0xfbb6526ed92da8915d4843a86166020d0b7baad00 Ether
0xd825781ff60114b6b44789f0f99893951e2bc57c2ab624fa747916bf03265485248017742021-05-12 18:22:206 days 1 hr ago 0x54c4b5cb58c880dd1734123c8b588e49edf442fb 0x2fb33e35829d2bb04d8b5eb9531da129e72bced40 Ether
0xd825781ff60114b6b44789f0f99893951e2bc57c2ab624fa747916bf03265485248017742021-05-12 18:22:206 days 1 hr ago 0xff196c6526d73a8fc17c0c6b8283ddf21ca34654 0x2fb33e35829d2bb04d8b5eb9531da129e72bced40 Ether
0xd825781ff60114b6b44789f0f99893951e2bc57c2ab624fa747916bf03265485248017742021-05-12 18:22:206 days 1 hr ago 0x2fb33e35829d2bb04d8b5eb9531da129e72bced4 0xfbb6526ed92da8915d4843a86166020d0b7baad00 Ether
0xd825781ff60114b6b44789f0f99893951e2bc57c2ab624fa747916bf03265485248017742021-05-12 18:22:206 days 1 hr ago 0x54c4b5cb58c880dd1734123c8b588e49edf442fb 0x2fb33e35829d2bb04d8b5eb9531da129e72bced40 Ether
0xd825781ff60114b6b44789f0f99893951e2bc57c2ab624fa747916bf03265485248017742021-05-12 18:22:206 days 1 hr ago 0xff196c6526d73a8fc17c0c6b8283ddf21ca34654 0x2fb33e35829d2bb04d8b5eb9531da129e72bced40 Ether
0xf64f55b2500658b2a75424c5ce17a4c4dbe2b48e9f0d3eaf0761d828b3b74635247991052021-05-12 13:58:446 days 6 hrs ago 0x53bae964339e8a742b5b47f6c10bbfa8ff138f34 0x2fb33e35829d2bb04d8b5eb9531da129e72bced40 Ether
0xf64f55b2500658b2a75424c5ce17a4c4dbe2b48e9f0d3eaf0761d828b3b74635247991052021-05-12 13:58:446 days 6 hrs ago 0xdcb48e969e69df65f72f77b2aae145509733e5c0 0x2fb33e35829d2bb04d8b5eb9531da129e72bced40 Ether
0xb32e1ac2da7975d604fb5af6d02e26fe26e989b2b63adca006be65c18ec92490247941352021-05-12 5:48:326 days 14 hrs ago 0x53bae964339e8a742b5b47f6c10bbfa8ff138f34 0x2fb33e35829d2bb04d8b5eb9531da129e72bced40 Ether
0xb32e1ac2da7975d604fb5af6d02e26fe26e989b2b63adca006be65c18ec92490247941352021-05-12 5:48:326 days 14 hrs ago 0xdcb48e969e69df65f72f77b2aae145509733e5c0 0x2fb33e35829d2bb04d8b5eb9531da129e72bced40 Ether
0xd7104cb52ff939253ab97cd3bdfba91019f4c0ff62a44253d8e5ab0c3e470255247891572021-05-11 21:38:446 days 22 hrs ago 0x53bae964339e8a742b5b47f6c10bbfa8ff138f34 0x2fb33e35829d2bb04d8b5eb9531da129e72bced40 Ether
0xd7104cb52ff939253ab97cd3bdfba91019f4c0ff62a44253d8e5ab0c3e470255247891572021-05-11 21:38:446 days 22 hrs ago 0xdcb48e969e69df65f72f77b2aae145509733e5c0 0x2fb33e35829d2bb04d8b5eb9531da129e72bced40 Ether
0xba1d1a6e824d56ffe309189276c47b6eb7a4c3e469a68f6d65baf6d5a2eb7fc4247842112021-05-11 13:28:367 days 6 hrs ago 0x53bae964339e8a742b5b47f6c10bbfa8ff138f34 0x2fb33e35829d2bb04d8b5eb9531da129e72bced40 Ether
0xba1d1a6e824d56ffe309189276c47b6eb7a4c3e469a68f6d65baf6d5a2eb7fc4247842112021-05-11 13:28:367 days 6 hrs ago 0xdcb48e969e69df65f72f77b2aae145509733e5c0 0x2fb33e35829d2bb04d8b5eb9531da129e72bced40 Ether
0x9d6c46543d0a028c7c723ee8178c382ef3e38480c3ab5f10f1346b2761fb6ddf247841532021-05-11 13:22:487 days 6 hrs ago 0xdcb48e969e69df65f72f77b2aae145509733e5c0 0x2fb33e35829d2bb04d8b5eb9531da129e72bced40 Ether
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
MultiCollateralSynth

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 2020-12-22
*/

/*

⚠⚠⚠ 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 can be found by looking up the PROXY property on this contract.

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

* Synthetix: MultiCollateralSynth.sol
*
* Latest source (may be newer): https://github.com/Synthetixio/synthetix/blob/master/contracts/MultiCollateralSynth.sol
* Docs: https://docs.synthetix.io/contracts/MultiCollateralSynth
*
* Contract Dependencies: 
*	- ExternStateToken
*	- IAddressResolver
*	- IERC20
*	- ISynth
*	- MixinResolver
*	- Owned
*	- Proxyable
*	- State
*	- Synth
* Libraries: 
*	- SafeDecimalMath
*	- SafeMath
*
* MIT License
* ===========
*
* Copyright (c) 2020 Synthetix
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
*/



pragma solidity ^0.5.16;


// https://docs.synthetix.io/contracts/source/contracts/owned
contract Owned {
    address public owner;
    address public nominatedOwner;

    constructor(address _owner) public {
        require(_owner != address(0), "Owner address cannot be 0");
        owner = _owner;
        emit OwnerChanged(address(0), _owner);
    }

    function nominateNewOwner(address _owner) external onlyOwner {
        nominatedOwner = _owner;
        emit OwnerNominated(_owner);
    }

    function acceptOwnership() external {
        require(msg.sender == nominatedOwner, "You must be nominated before you can accept ownership");
        emit OwnerChanged(owner, nominatedOwner);
        owner = nominatedOwner;
        nominatedOwner = address(0);
    }

    modifier onlyOwner {
        _onlyOwner();
        _;
    }

    function _onlyOwner() private view {
        require(msg.sender == owner, "Only the contract owner may perform this action");
    }

    event OwnerNominated(address newOwner);
    event OwnerChanged(address oldOwner, address newOwner);
}


// Inheritance


// 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;
    Proxy public integrationProxy;

    /* 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 setIntegrationProxy(address payable _integrationProxy) external onlyOwner {
        integrationProxy = Proxy(_integrationProxy);
    }

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

    modifier onlyProxy {
        _onlyProxy();
        _;
    }

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

    modifier optionalProxy {
        _optionalProxy();
        _;
    }

    function _optionalProxy() private {
        if (Proxy(msg.sender) != proxy && Proxy(msg.sender) != integrationProxy && 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 && Proxy(msg.sender) != integrationProxy && 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;
    }
}


// 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 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 excludeEtherCollateral) external view returns (uint);

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

    // Restricted: used internally to Synthetix
    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 liquidateDelinquentAccount(
        address account,
        uint susdAmount,
        address liquidator
    ) external returns (uint totalRedeemed, uint amountToLiquidate);
}


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


// solhint-disable payable-fallback

// https://docs.synthetix.io/contracts/source/contracts/readproxy
contract ReadProxy is Owned {
    address public target;

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

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

    function() external {
        // The basics of a proxy read call
        // Note that msg.sender in the underlying will always be the address of this contract.
        assembly {
            calldatacopy(0, 0, calldatasize)

            // Use of staticcall - this will revert if the underlying function mutates state
            let result := staticcall(gas, sload(target_slot), 0, calldatasize, 0, 0)
            returndatacopy(0, 0, returndatasize)

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

    event TargetUpdated(address newTarget);
}


// Inheritance


// 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() external {
        bytes32[] memory requiredAddresses = resolverAddressesRequired();
        // The resolver must call this function whenver it updates its state
        for (uint i = 0; i < requiredAddresses.length; i++) {
            bytes32 name = requiredAddresses[i];
            // Note: can only be invoked once the resolver has all the targets needed added
            address destination = resolver.requireAndGetAddress(
                name,
                string(abi.encodePacked("Resolver missing target: ", name))
            );
            addressCache[name] = destination;
            emit CacheUpdated(name, destination);
        }
    }

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

    function isResolverCached() external view returns (bool) {
        bytes32[] memory requiredAddresses = resolverAddressesRequired();
        for (uint i = 0; i < requiredAddresses.length; i++) {
            bytes32 name = requiredAddresses[i];
            // false if our cache is invalid or if the resolver doesn't have the required address
            if (resolver.getAddress(name) != addressCache[name] || addressCache[name] == address(0)) {
                return false;
            }
        }

        return true;
    }

    /* ========== INTERNAL FUNCTIONS ========== */

    function requireAndGetAddress(bytes32 name) internal view returns (address) {
        address _foundAddress = addressCache[name];
        require(_foundAddress != address(0), string(abi.encodePacked("Missing address: ", name)));
        return _foundAddress;
    }

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

    event CacheUpdated(bytes32 name, address destination);
}


// https://docs.synthetix.io/contracts/source/interfaces/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/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 requireIssuanceActive() external view;

    function requireExchangeActive() external view;

    function requireSynthActive(bytes32 currencyKey) external view;

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

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

    // Restricted functions
    function suspendSynth(bytes32 currencyKey, uint256 reason) external;

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


// https://docs.synthetix.io/contracts/source/interfaces/ifeepool
interface IFeePool {
    // Views

    // solhint-disable-next-line func-name-mixedcase
    function FEE_ADDRESS() external view returns (address);

    function feesAvailable(address account) external view returns (uint, uint);

    function feePeriodDuration() external view returns (uint);

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

    function targetThreshold() external view returns (uint);

    function totalFeesAvailable() external view returns (uint);

    function totalRewardsAvailable() external view returns (uint);

    // Mutative Functions
    function claimFees() external returns (bool);

    function claimOnBehalf(address claimingForAddress) external returns (bool);

    function closeCurrentFeePeriod() external;

    // Restricted: used internally to Synthetix
    function appendAccountIssuanceRecord(
        address account,
        uint lockedAmount,
        uint debtEntryIndex
    ) external;

    function recordFeePaid(uint sUSDAmount) external;

    function setRewardsToDistribute(uint amount) external;
}


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/iexchanger
interface IExchanger {
    // 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 exchangeFeeRate);

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

    // Mutative functions
    function exchange(
        address from,
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey,
        address destinationAddress
    ) external returns (uint amountReceived);

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

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

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

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

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

    function setLastExchangeRateForSynth(bytes32 currencyKey, uint rate) external;

    function suspendSynthWithInvalidRate(bytes32 currencyKey) external;
}


// Inheritance


// Internal references


// https://docs.synthetix.io/contracts/source/contracts/synth
contract Synth is Owned, IERC20, ExternStateToken, MixinResolver, ISynth {
    /* ========== STATE VARIABLES ========== */

    // Currency key which identifies this Synth to the Synthetix system
    bytes32 public currencyKey;

    uint8 public constant DECIMALS = 18;

    // Where fees are pooled in sUSD
    address public constant FEE_ADDRESS = 0xfeEFEEfeefEeFeefEEFEEfEeFeefEEFeeFEEFEeF;

    /* ========== 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_FEEPOOL = "FeePool";

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

    constructor(
        address payable _proxy,
        TokenState _tokenState,
        string memory _tokenName,
        string memory _tokenSymbol,
        address _owner,
        bytes32 _currencyKey,
        uint _totalSupply,
        address _resolver
    )
        public
        ExternStateToken(_proxy, _tokenState, _tokenName, _tokenSymbol, _totalSupply, DECIMALS, _owner)
        MixinResolver(_resolver)
    {
        require(_proxy != address(0), "_proxy cannot be 0");
        require(_owner != address(0), "_owner cannot be 0");

        currencyKey = _currencyKey;
    }

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

    function transfer(address to, uint value) public optionalProxy returns (bool) {
        _ensureCanTransfer(messageSender, value);

        // transfers to FEE_ADDRESS will be exchanged into sUSD and recorded as fee
        if (to == FEE_ADDRESS) {
            return _transferToFeeAddress(to, value);
        }

        // transfers to 0x address will be burned
        if (to == address(0)) {
            return _internalBurn(messageSender, value);
        }

        return super._internalTransfer(messageSender, to, value);
    }

    function transferAndSettle(address to, uint value) public optionalProxy returns (bool) {
        // Exchanger.settle ensures synth is active
        (, , uint numEntriesSettled) = exchanger().settle(messageSender, currencyKey);

        // Save gas instead of calling transferableSynths
        uint balanceAfter = value;

        if (numEntriesSettled > 0) {
            balanceAfter = tokenState.balanceOf(messageSender);
        }

        // Reduce the value to transfer if balance is insufficient after reclaimed
        value = value > balanceAfter ? balanceAfter : value;

        return super._internalTransfer(messageSender, to, value);
    }

    function transferFrom(
        address from,
        address to,
        uint value
    ) public optionalProxy returns (bool) {
        _ensureCanTransfer(from, value);

        return _internalTransferFrom(from, to, value);
    }

    function transferFromAndSettle(
        address from,
        address to,
        uint value
    ) public optionalProxy returns (bool) {
        // Exchanger.settle() ensures synth is active
        (, , uint numEntriesSettled) = exchanger().settle(from, currencyKey);

        // Save gas instead of calling transferableSynths
        uint balanceAfter = value;

        if (numEntriesSettled > 0) {
            balanceAfter = tokenState.balanceOf(from);
        }

        // Reduce the value to transfer if balance is insufficient after reclaimed
        value = value >= balanceAfter ? balanceAfter : value;

        return _internalTransferFrom(from, to, value);
    }

    /**
     * @notice _transferToFeeAddress function
     * non-sUSD synths are exchanged into sUSD via synthInitiatedExchange
     * notify feePool to record amount as fee paid to feePool */
    function _transferToFeeAddress(address to, uint value) internal returns (bool) {
        uint amountInUSD;

        // sUSD can be transferred to FEE_ADDRESS directly
        if (currencyKey == "sUSD") {
            amountInUSD = value;
            super._internalTransfer(messageSender, to, value);
        } else {
            // else exchange synth into sUSD and send to FEE_ADDRESS
            amountInUSD = exchanger().exchange(messageSender, currencyKey, value, "sUSD", FEE_ADDRESS);
        }

        // Notify feePool to record sUSD to distribute as fees
        feePool().recordFeePaid(amountInUSD);

        return true;
    }

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

    function burn(address account, uint amount) external onlyInternalContracts {
        _internalBurn(account, amount);
    }

    function _internalIssue(address account, uint amount) internal {
        tokenState.setBalanceOf(account, tokenState.balanceOf(account).add(amount));
        totalSupply = totalSupply.add(amount);
        emitTransfer(address(0), account, amount);
        emitIssued(account, amount);
    }

    function _internalBurn(address account, uint amount) internal returns (bool) {
        tokenState.setBalanceOf(account, tokenState.balanceOf(account).sub(amount));
        totalSupply = totalSupply.sub(amount);
        emitTransfer(account, address(0), amount);
        emitBurned(account, amount);

        return true;
    }

    // Allow owner to set the total supply on import.
    function setTotalSupply(uint amount) external optionalProxy_onlyOwner {
        totalSupply = amount;
    }

    /* ========== 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[](4);
        addresses[0] = CONTRACT_SYSTEMSTATUS;
        addresses[1] = CONTRACT_EXCHANGER;
        addresses[2] = CONTRACT_ISSUER;
        addresses[3] = CONTRACT_FEEPOOL;
    }

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

    function feePool() internal view returns (IFeePool) {
        return IFeePool(requireAndGetAddress(CONTRACT_FEEPOOL));
    }

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

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

    function _ensureCanTransfer(address from, uint value) internal view {
        require(exchanger().maxSecsLeftInWaitingPeriod(from, currencyKey) == 0, "Cannot transfer during waiting period");
        require(transferableSynths(from) >= value, "Insufficient balance after any settlement owing");
        systemStatus().requireSynthActive(currencyKey);
    }

    function transferableSynths(address account) public view returns (uint) {
        (uint reclaimAmount, , ) = exchanger().settlementOwing(account, currencyKey);

        // Note: ignoring rebate amount here because a settle() is required in order to
        // allow the transfer to actually work

        uint balance = tokenState.balanceOf(account);

        if (reclaimAmount > balance) {
            return 0;
        } else {
            return balance.sub(reclaimAmount);
        }
    }

    /* ========== INTERNAL FUNCTIONS ========== */

    function _internalTransferFrom(
        address from,
        address to,
        uint value
    ) internal returns (bool) {
        // Skip allowance update in case of infinite allowance
        if (tokenState.allowance(from, messageSender) != uint(-1)) {
            // Reduce the allowance by the amount we're transferring.
            // The safeSub call will handle an insufficient allowance.
            tokenState.setAllowance(from, messageSender, tokenState.allowance(from, messageSender).sub(value));
        }

        return super._internalTransfer(from, to, value);
    }

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

    modifier onlyInternalContracts() {
        bool isFeePool = msg.sender == address(feePool());
        bool isExchanger = msg.sender == address(exchanger());
        bool isIssuer = msg.sender == address(issuer());

        require(isFeePool || isExchanger || isIssuer, "Only FeePool, Exchanger or Issuer contracts allowed");
        _;
    }

    /* ========== EVENTS ========== */
    event Issued(address indexed account, uint value);
    bytes32 private constant ISSUED_SIG = keccak256("Issued(address,uint256)");

    function emitIssued(address account, uint value) internal {
        proxy._emit(abi.encode(value), 2, ISSUED_SIG, addressToBytes32(account), 0, 0);
    }

    event Burned(address indexed account, uint value);
    bytes32 private constant BURNED_SIG = keccak256("Burned(address,uint256)");

    function emitBurned(address account, uint value) internal {
        proxy._emit(abi.encode(value), 2, BURNED_SIG, addressToBytes32(account), 0, 0);
    }
}


interface ICollateralManager {
    // Manager information
    function hasCollateral(address collateral) external view returns (bool);

    // State information
    function long(bytes32 synth) external view returns (uint amount);

    function short(bytes32 synth) external view returns (uint amount);

    function totalLong() external view returns (uint susdValue, bool anyRateIsInvalid);

    function totalShort() external view returns (uint susdValue, bool anyRateIsInvalid);

    function getBorrowRate() external view returns (uint borrowRate, bool anyRateIsInvalid);

    function getShortRate(bytes32 synth) external view returns (uint shortRate, bool rateIsInvalid);

    function getRatesAndTime(uint index)
        external
        view
        returns (
            uint entryRate,
            uint lastRate,
            uint lastUpdated,
            uint newIndex
        );

    function getShortRatesAndTime(bytes32 currency, uint index)
        external
        view
        returns (
            uint entryRate,
            uint lastRate,
            uint lastUpdated,
            uint newIndex
        );

    function exceedsDebtLimit(uint amount, bytes32 currency) external view returns (bool canIssue, bool anyRateIsInvalid);

    // Loans
    function getLoanId() external returns (uint id);

    // Manager mutative
    function addCollaterals(address[] calldata collaterals) external;

    function removeCollaterals(address[] calldata collaterals) external;

    function addSynths(bytes32[] calldata synths) external;

    function removeSynths(bytes32[] calldata synths) external;

    function addShortableSynths(bytes32[2][] calldata synthsWithInverses) external;

    function removeShortableSynths(bytes32[] calldata synths) external;

    function addSynthsToFlexibleStorage() external;

    function addShortableSynthsToState() external;

    // State mutative
    function updateBorrowRates(uint rate) external;

    function updateShortRates(bytes32 currency, uint rate) external;

    function incrementLongs(bytes32 synth, uint amount) external;

    function decrementLongs(bytes32 synth, uint amount) external;

    function incrementShorts(bytes32 synth, uint amount) external;

    function decrementShorts(bytes32 synth, uint amount) external;
}


// https://docs.synthetix.io/contracts/source/interfaces/iethercollateralsusd
interface IEtherCollateralsUSD {
    // Views
    function totalIssuedSynths() external view returns (uint256);

    function totalLoansCreated() external view returns (uint256);

    function totalOpenLoanCount() external view returns (uint256);

    // Mutative functions
    function openLoan(uint256 _loanAmount) external payable returns (uint256 loanID);

    function closeLoan(uint256 loanID) external;

    function liquidateUnclosedLoan(address _loanCreatorsAddress, uint256 _loanID) external;

    function depositCollateral(address account, uint256 loanID) external payable;

    function withdrawCollateral(uint256 loanID, uint256 withdrawAmount) external;

    function repayLoan(
        address _loanCreatorsAddress,
        uint256 _loanID,
        uint256 _repayAmount
    ) external;
}


// https://docs.synthetix.io/contracts/source/interfaces/iethercollateral
interface IEtherCollateral {
    // Views
    function totalIssuedSynths() external view returns (uint256);

    function totalLoansCreated() external view returns (uint256);

    function totalOpenLoanCount() external view returns (uint256);

    // Mutative functions
    function openLoan() external payable returns (uint256 loanID);

    function closeLoan(uint256 loanID) external;

    function liquidateUnclosedLoan(address _loanCreatorsAddress, uint256 _loanID) external;
}


// Inheritance


// Internal references


// https://docs.synthetix.io/contracts/source/contracts/multicollateralsynth
contract MultiCollateralSynth is Synth {
    /* ========== ADDRESS RESOLVER CONFIGURATION ========== */

    bytes32 private constant CONTRACT_COLLATERALMANAGER = "CollateralManager";
    bytes32 private constant CONTRACT_ETH_COLLATERAL = "EtherCollateral";
    bytes32 private constant CONTRACT_ETH_COLLATERAL_SUSD = "EtherCollateralsUSD";

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

    constructor(
        address payable _proxy,
        TokenState _tokenState,
        string memory _tokenName,
        string memory _tokenSymbol,
        address _owner,
        bytes32 _currencyKey,
        uint _totalSupply,
        address _resolver
    ) public Synth(_proxy, _tokenState, _tokenName, _tokenSymbol, _owner, _currencyKey, _totalSupply, _resolver) {}

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

    function collateralManager() internal view returns (ICollateralManager) {
        return ICollateralManager(requireAndGetAddress(CONTRACT_COLLATERALMANAGER));
    }

    function etherCollateral() internal view returns (IEtherCollateral) {
        return IEtherCollateral(requireAndGetAddress(CONTRACT_ETH_COLLATERAL));
    }

    function etherCollateralsUSD() internal view returns (IEtherCollateralsUSD) {
        return IEtherCollateralsUSD(requireAndGetAddress(CONTRACT_ETH_COLLATERAL_SUSD));
    }

    function resolverAddressesRequired() public view returns (bytes32[] memory addresses) {
        bytes32[] memory existingAddresses = Synth.resolverAddressesRequired();
        bytes32[] memory newAddresses = new bytes32[](3);
        newAddresses[0] = CONTRACT_COLLATERALMANAGER;
        newAddresses[1] = CONTRACT_ETH_COLLATERAL;
        newAddresses[2] = CONTRACT_ETH_COLLATERAL_SUSD;
        addresses = combineArrays(existingAddresses, newAddresses);
    }

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

    /**
     * @notice Function that allows multi Collateral to issue a certain number of synths from an account.
     * @param account Account to issue synths to
     * @param amount Number of synths
     */
    function issue(address account, uint amount) external onlyInternalContracts {
        super._internalIssue(account, amount);
    }

    /**
     * @notice Function that allows multi Collateral to burn a certain number of synths from an account.
     * @param account Account to burn synths from
     * @param amount Number of synths
     */
    function burn(address account, uint amount) external onlyInternalContracts {
        super._internalBurn(account, amount);
    }

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

    // Contracts directly interacting with multiCollateralSynth to issue and burn
    modifier onlyInternalContracts() {
        bool isFeePool = msg.sender == address(feePool());
        bool isExchanger = msg.sender == address(exchanger());
        bool isIssuer = msg.sender == address(issuer());
        bool isEtherCollateral = msg.sender == address(etherCollateral());
        bool isEtherCollateralsUSD = msg.sender == address(etherCollateralsUSD());
        bool isMultiCollateral = collateralManager().hasCollateral(msg.sender);

        require(
            isFeePool || isExchanger || isIssuer || isEtherCollateral || isEtherCollateralsUSD || isMultiCollateral,
            "Only FeePool, Exchanger, Issuer or MultiCollateral contracts allowed"
        );
        _;
    }
}

Contract ABI

[{"inputs":[{"internalType":"address payable","name":"_proxy","type":"address"},{"internalType":"contract TokenState","name":"_tokenState","type":"address"},{"internalType":"string","name":"_tokenName","type":"string"},{"internalType":"string","name":"_tokenSymbol","type":"string"},{"internalType":"address","name":"_owner","type":"address"},{"internalType":"bytes32","name":"_currencyKey","type":"bytes32"},{"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":"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":"uint256","name":"value","type":"uint256"}],"name":"Burned","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":"uint256","name":"value","type":"uint256"}],"name":"Issued","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":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":"DECIMALS","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"FEE_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"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":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":[{"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":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burn","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"currencyKey","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":"integrationProxy","outputs":[{"internalType":"contract Proxy","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isResolverCached","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"issue","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"messageSender","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","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":[],"name":"resolver","outputs":[{"internalType":"contract AddressResolver","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"resolverAddressesRequired","outputs":[{"internalType":"bytes32[]","name":"addresses","type":"bytes32[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address payable","name":"_integrationProxy","type":"address"}],"name":"setIntegrationProxy","outputs":[],"payable":false,"stateMutability":"nonpayable","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":"uint256","name":"amount","type":"uint256"}],"name":"setTotalSupply","outputs":[],"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":[],"name":"tokenState","outputs":[{"internalType":"contract TokenState","name":"","type":"address"}],"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":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transferAndSettle","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":false,"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transferFromAndSettle","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"transferableSynths","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"}]

60806040523480156200001157600080fd5b50604051620030d4380380620030d483398181016040526101008110156200003857600080fd5b815160208301516040808501805191519395929483019291846401000000008211156200006457600080fd5b9083019060208201858111156200007a57600080fd5b82516401000000008111828201881017156200009557600080fd5b82525081516020918201929091019080838360005b83811015620000c4578181015183820152602001620000aa565b50505050905090810190601f168015620000f25780820380516001836020036101000a031916815260200191505b50604052602001805160405193929190846401000000008211156200011657600080fd5b9083019060208201858111156200012c57600080fd5b82516401000000008111828201881017156200014757600080fd5b82525081516020918201929091019080838360005b83811015620001765781810151838201526020016200015c565b50505050905090810190601f168015620001a45780820380516001836020036101000a031916815260200191505b50604090815260208201519082015160608301516080909301519194509250878787878787878780888888888660128a86816001600160a01b03811662000232576040805162461bcd60e51b815260206004820152601960248201527f4f776e657220616464726573732063616e6e6f74206265203000000000000000604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b038316908117825560408051928352602083019190915280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a1506000546001600160a01b0316620002dd576040805162461bcd60e51b815260206004820152601160248201527013dddb995c881b5d5cdd081899481cd95d607a1b604482015290519081900360640190fd5b600280546001600160a01b0383166001600160a01b0319909116811790915560408051918252517ffc80377ca9c49cc11ae6982f390a42db976d5530af7c43889264b13fbbd7c57e9181900360200190a150600580546001600160a01b0319166001600160a01b03881617905584516200035f90600690602088019062000464565b5083516200037590600790602087019062000464565b50506008919091556009805460ff191660ff90921691909117610100600160a81b0319166101006001600160a01b03978816021790555050509089169050620003fa576040805162461bcd60e51b815260206004820152601260248201527105f70726f78792063616e6e6f7420626520360741b604482015290519081900360640190fd5b6001600160a01b0384166200044b576040805162461bcd60e51b815260206004820152601260248201527105f6f776e65722063616e6e6f7420626520360741b604482015290519081900360640190fd5b5050600b5550620005099b505050505050505050505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10620004a757805160ff1916838001178555620004d7565b82800160010185558215620004d7579182015b82811115620004d7578251825591602001919060010190620004ba565b50620004e5929150620004e9565b5090565b6200050691905b80821115620004e55760008155600101620004f0565b90565b612bbb80620005196000396000f3fe608060405234801561001057600080fd5b50600436106102065760003560e01c806395d89b411161011a578063d67bdd25116100ad578063e90dd9e21161007c578063e90dd9e2146105fc578063eb1edd6114610604578063ec5568891461060c578063f7ea7a3d14610614578063ffff51d61461063157610206565b8063d67bdd2514610588578063dbd06c8514610590578063dd62ed3e14610598578063e73cced3146105c657610206565b80639f769807116100e95780639f769807146104e4578063a9059cbb1461050a578063b014c3a314610536578063bc67f8321461056257610206565b806395d89b411461048257806397107d6d1461048a5780639cbdaeb6146104b05780639dc29fac146104b857610206565b80632e0f26251161019d578063741853601161016c57806374185360146103e657806379ba5097146103ee578063867904b4146103f6578063899ffef4146104225780638da5cb5b1461047a57610206565b80632e0f262514610392578063313ce567146103b057806353a47bb7146103b857806370a08231146103c057610206565b80631627540c116101d95780631627540c1461031457806318160ddd1461033a57806323b872dd146103545780632af64bd31461038a57610206565b806304f3bcec1461020b57806306fdde031461022f578063095ea7b3146102ac578063131b0ae7146102ec575b600080fd5b610213610657565b604080516001600160a01b039092168252519081900360200190f35b61023761066b565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610271578181015183820152602001610259565b50505050905090810190601f16801561029e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102d8600480360360408110156102c257600080fd5b506001600160a01b0381351690602001356106f9565b604080519115158252519081900360200190f35b6103126004803603602081101561030257600080fd5b50356001600160a01b0316610794565b005b6103126004803603602081101561032a57600080fd5b50356001600160a01b03166107be565b61034261081a565b60408051918252519081900360200190f35b6102d86004803603606081101561036a57600080fd5b506001600160a01b03813581169160208101359091169060400135610820565b6102d8610847565b61039a610959565b6040805160ff9092168252519081900360200190f35b61039a61095e565b610213610967565b610342600480360360208110156103d657600080fd5b50356001600160a01b0316610976565b6103126109fb565b610312610bd8565b6103126004803603604081101561040c57600080fd5b506001600160a01b038135169060200135610c94565b61042a610e39565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561046657818101518382015260200161044e565b505050509050019250505060405180910390f35b610213610f05565b610237610f14565b610312600480360360208110156104a057600080fd5b50356001600160a01b0316610f6f565b610213610fcb565b610312600480360360408110156104ce57600080fd5b506001600160a01b038135169060200135610fda565b610312600480360360208110156104fa57600080fd5b50356001600160a01b0316611180565b6102d86004803603604081101561052057600080fd5b506001600160a01b0381351690602001356111af565b6102d86004803603604081101561054c57600080fd5b506001600160a01b038135169060200135611247565b6103126004803603602081101561057857600080fd5b50356001600160a01b03166113a0565b6102136113ca565b6103426113d9565b610342600480360360408110156105ae57600080fd5b506001600160a01b03813581169160200135166113df565b6102d8600480360360608110156105dc57600080fd5b506001600160a01b0381358116916020810135909116906040013561146b565b6102136115bb565b6102136115ca565b6102136115e2565b6103126004803603602081101561062a57600080fd5b50356115f1565b6103426004803603602081101561064757600080fd5b50356001600160a01b03166115fe565b60095461010090046001600160a01b031681565b6006805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156106f15780601f106106c6576101008083540402835291602001916106f1565b820191906000526020600020905b8154815290600101906020018083116106d457829003601f168201915b505050505081565b6000610703611741565b6004805460055460408051633691826360e21b81526001600160a01b039384169481018590528784166024820152604481018790529051919092169163da46098c91606480830192600092919082900301818387803b15801561076557600080fd5b505af1158015610779573d6000803e3d6000fd5b50505050610788818585611798565b60019150505b92915050565b61079c6118d1565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b6107c66118d1565b600180546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce229181900360200190a150565b60085481565b600061082a611741565b610834848361191a565b61083f848484611a99565b949350505050565b60006060610853610e39565b905060005b815181101561094f57600082828151811061086f57fe5b6020908102919091018101516000818152600a83526040908190205460095482516321f8a72160e01b81526004810185905292519395506001600160a01b0391821694610100909104909116926321f8a721926024808201939291829003018186803b1580156108de57600080fd5b505afa1580156108f2573d6000803e3d6000fd5b505050506040513d602081101561090857600080fd5b50516001600160a01b031614158061093557506000818152600a60205260409020546001600160a01b0316155b156109465760009350505050610956565b50600101610858565b5060019150505b90565b601281565b60095460ff1681565b6001546001600160a01b031681565b600554604080516370a0823160e01b81526001600160a01b038481166004830152915160009392909216916370a0823191602480820192602092909190829003018186803b1580156109c757600080fd5b505afa1580156109db573d6000803e3d6000fd5b505050506040513d60208110156109f157600080fd5b505190505b919050565b6060610a05610e39565b905060005b8151811015610bd4576000828281518110610a2157fe5b602002602001015190506000600960019054906101000a90046001600160a01b03166001600160a01b031663dacb2d01838460405160200180807f5265736f6c766572206d697373696e67207461726765743a20000000000000008152506019018281526020019150506040516020818303038152906040526040518363ffffffff1660e01b81526004018083815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610aec578181015183820152602001610ad4565b50505050905090810190601f168015610b195780820380516001836020036101000a031916815260200191505b50935050505060206040518083038186803b158015610b3757600080fd5b505afa158015610b4b573d6000803e3d6000fd5b505050506040513d6020811015610b6157600080fd5b50516000838152600a602090815260409182902080546001600160a01b0319166001600160a01b03851690811790915582518681529182015281519293507f88a93678a3692f6789d9546fc621bf7234b101ddb7d4fe479455112831b8aa68929081900390910190a15050600101610a0a565b5050565b6001546001600160a01b03163314610c215760405162461bcd60e51b8152600401808060200182810382526035815260200180612a496035913960400191505060405180910390fd5b600054600154604080516001600160a01b03938416815292909116602083015280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b6000610c9e611c5a565b6001600160a01b0316336001600160a01b03161490506000610cbe611c74565b6001600160a01b0316336001600160a01b03161490506000610cde611c8b565b6001600160a01b0316336001600160a01b03161490506000610cfe611c9f565b6001600160a01b0316336001600160a01b03161490506000610d1e611cbc565b6001600160a01b0316336001600160a01b03161490506000610d3e611cdd565b6001600160a01b031663b38988f7336040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b158015610d9357600080fd5b505afa158015610da7573d6000803e3d6000fd5b505050506040513d6020811015610dbd57600080fd5b505190508580610dca5750845b80610dd25750835b80610dda5750825b80610de25750815b80610dea5750805b610e255760405162461bcd60e51b8152600401808060200182810382526044815260200180612aad6044913960600191505060405180910390fd5b610e2f8888611cfc565b5050505050505050565b606080610e44611e26565b60408051600380825260808201909252919250606091906020820183803883390190505090507021b7b63630ba32b930b626b0b730b3b2b960791b81600081518110610e8c57fe5b6020026020010181815250506e115d1a195c90dbdb1b185d195c985b608a1b81600181518110610eb857fe5b60200260200101818152505072115d1a195c90dbdb1b185d195c985b1cd554d1606a1b81600281518110610ee857fe5b602002602001018181525050610efe8282611ee2565b9250505090565b6000546001600160a01b031681565b6007805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156106f15780601f106106c6576101008083540402835291602001916106f1565b610f776118d1565b600280546001600160a01b0383166001600160a01b0319909116811790915560408051918252517ffc80377ca9c49cc11ae6982f390a42db976d5530af7c43889264b13fbbd7c57e9181900360200190a150565b6003546001600160a01b031681565b6000610fe4611c5a565b6001600160a01b0316336001600160a01b03161490506000611004611c74565b6001600160a01b0316336001600160a01b03161490506000611024611c8b565b6001600160a01b0316336001600160a01b03161490506000611044611c9f565b6001600160a01b0316336001600160a01b03161490506000611064611cbc565b6001600160a01b0316336001600160a01b03161490506000611084611cdd565b6001600160a01b031663b38988f7336040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b1580156110d957600080fd5b505afa1580156110ed573d6000803e3d6000fd5b505050506040513d602081101561110357600080fd5b5051905085806111105750845b806111185750835b806111205750825b806111285750815b806111305750805b61116b5760405162461bcd60e51b8152600401808060200182810382526044815260200180612aad6044913960600191505060405180910390fd5b6111758888611f9e565b505050505050505050565b61118861209b565b600580546001600160a01b0319166001600160a01b0383161790556111ac8161214b565b50565b60006111b9611741565b6004546111cf906001600160a01b03168361191a565b6001600160a01b03831673feefeefeefeefeefeefeefeefeefeefeefeefeef1415611205576111fe8383612291565b905061078e565b6001600160a01b038316611229576004546111fe906001600160a01b031683611f9e565b600454611240906001600160a01b031684846123f4565b9392505050565b6000611251611741565b600061125b611c74565b60048054600b54604080516306c5a00b60e21b81526001600160a01b0393841694810194909452602484019190915251921691631b16802c916044808201926060929091908290030181600087803b1580156112b657600080fd5b505af11580156112ca573d6000803e3d6000fd5b505050506040513d60608110156112e057600080fd5b5060400151905082811561136e5760055460048054604080516370a0823160e01b81526001600160a01b0392831693810193909352519216916370a0823191602480820192602092909190829003018186803b15801561133f57600080fd5b505afa158015611353573d6000803e3d6000fd5b505050506040513d602081101561136957600080fd5b505190505b80841161137b578361137d565b805b600454909450611397906001600160a01b031686866123f4565b95945050505050565b6113a8612621565b600480546001600160a01b0319166001600160a01b0392909216919091179055565b6004546001600160a01b031681565b600b5481565b60055460408051636eb1769f60e11b81526001600160a01b03858116600483015284811660248301529151600093929092169163dd62ed3e91604480820192602092909190829003018186803b15801561143857600080fd5b505afa15801561144c573d6000803e3d6000fd5b505050506040513d602081101561146257600080fd5b50519392505050565b6000611475611741565b600061147f611c74565b6001600160a01b0316631b16802c86600b546040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050606060405180830381600087803b1580156114e057600080fd5b505af11580156114f4573d6000803e3d6000fd5b505050506040513d606081101561150a57600080fd5b5060400151905082811561159457600554604080516370a0823160e01b81526001600160a01b038981166004830152915191909216916370a08231916024808301926020929190829003018186803b15801561156557600080fd5b505afa158015611579573d6000803e3d6000fd5b505050506040513d602081101561158f57600080fd5b505190505b808410156115a257836115a4565b805b93506115b1868686611a99565b9695505050505050565b6005546001600160a01b031681565b73feefeefeefeefeefeefeefeefeefeefeefeefeef81565b6002546001600160a01b031681565b6115f961209b565b600855565b600080611609611c74565b6001600160a01b03166319d5c66584600b546040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b031681526020018281526020019250505060606040518083038186803b15801561166857600080fd5b505afa15801561167c573d6000803e3d6000fd5b505050506040513d606081101561169257600080fd5b5051600554604080516370a0823160e01b81526001600160a01b038781166004830152915193945060009391909216916370a08231916024808301926020929190829003018186803b1580156116e757600080fd5b505afa1580156116fb573d6000803e3d6000fd5b505050506040513d602081101561171157600080fd5b5051905080821115611728576000925050506109f6565b611738818363ffffffff61269516565b925050506109f6565b6002546001600160a01b0316331480159061176757506003546001600160a01b03163314155b801561177e57506004546001600160a01b03163314155b1561179657600480546001600160a01b031916331790555b565b60025460408051602080820185905282518083039091018152908201918290526001600160a01b039092169163907dff9791600390806021612b208239602101905060405180910390206117eb886126f2565b6117f4886126f2565b60006040518763ffffffff1660e01b815260040180806020018781526020018681526020018581526020018481526020018360001b8152602001828103825288818151815260200191508051906020019080838360005b8381101561186357818101518382015260200161184b565b50505050905090810190601f1680156118905780820380516001836020036101000a031916815260200191505b50975050505050505050600060405180830381600087803b1580156118b457600080fd5b505af11580156118c8573d6000803e3d6000fd5b50505050505050565b6000546001600160a01b031633146117965760405162461bcd60e51b815260040180806020018281038252602f815260200180612af1602f913960400191505060405180910390fd5b611922611c74565b6001600160a01b031663059c29ec83600b546040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b031681526020018281526020019250505060206040518083038186803b15801561198157600080fd5b505afa158015611995573d6000803e3d6000fd5b505050506040513d60208110156119ab57600080fd5b5051156119e95760405162461bcd60e51b8152600401808060200182810382526025815260200180612b416025913960400191505060405180910390fd5b806119f3836115fe565b1015611a305760405162461bcd60e51b815260040180806020018281038252602f815260200180612a7e602f913960400191505060405180910390fd5b611a386126fe565b6001600160a01b03166342a28e21600b546040518263ffffffff1660e01b81526004018082815260200191505060006040518083038186803b158015611a7d57600080fd5b505afa158015611a91573d6000803e3d6000fd5b505050505050565b6005546004805460408051636eb1769f60e11b81526001600160a01b038881169482019490945291831660248301525160009360001993169163dd62ed3e916044808301926020929190829003018186803b158015611af757600080fd5b505afa158015611b0b573d6000803e3d6000fd5b505050506040513d6020811015611b2157600080fd5b505114611c4f576005546004805460408051636eb1769f60e11b81526001600160a01b0389811694820194909452918316602483018190529051929093169263da46098c928892611bce918891879163dd62ed3e91604480820192602092909190829003018186803b158015611b9657600080fd5b505afa158015611baa573d6000803e3d6000fd5b505050506040513d6020811015611bc057600080fd5b50519063ffffffff61269516565b6040518463ffffffff1660e01b815260040180846001600160a01b03166001600160a01b03168152602001836001600160a01b03166001600160a01b031681526020018281526020019350505050600060405180830381600087803b158015611c3657600080fd5b505af1158015611c4a573d6000803e3d6000fd5b505050505b61083f8484846123f4565b6000611c6f66119959541bdbdb60ca1b612714565b905090565b6000611c6f6822bc31b430b733b2b960b91b612714565b6000611c6f6524b9b9bab2b960d11b612714565b6000611c6f6e115d1a195c90dbdb1b185d195c985b608a1b612714565b6000611c6f72115d1a195c90dbdb1b185d195c985b1cd554d1606a1b612714565b6000611c6f7021b7b63630ba32b930b626b0b730b3b2b960791b612714565b600554604080516370a0823160e01b81526001600160a01b0385811660048301529151919092169163b46310f6918591611d9291869186916370a0823191602480820192602092909190829003018186803b158015611d5a57600080fd5b505afa158015611d6e573d6000803e3d6000fd5b505050506040513d6020811015611d8457600080fd5b50519063ffffffff6127f116565b6040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050600060405180830381600087803b158015611de157600080fd5b505af1158015611df5573d6000803e3d6000fd5b5050600854611e0d925090508263ffffffff6127f116565b600855611e1c6000838361284b565b610bd4828261289e565b60408051600480825260a08201909252606091602082016080803883390190505090506b53797374656d53746174757360a01b81600081518110611e6657fe5b6020026020010181815250506822bc31b430b733b2b960b91b81600181518110611e8c57fe5b6020026020010181815250506524b9b9bab2b960d11b81600281518110611eaf57fe5b60200260200101818152505066119959541bdbdb60ca1b81600381518110611ed357fe5b60200260200101818152505090565b60608151835101604051908082528060200260200182016040528015611f12578160200160208202803883390190505b50905060005b8351811015611f5457838181518110611f2d57fe5b6020026020010151828281518110611f4157fe5b6020908102919091010152600101611f18565b5060005b8251811015611f9757828181518110611f6d57fe5b6020026020010151828286510181518110611f8457fe5b6020908102919091010152600101611f58565b5092915050565b600554604080516370a0823160e01b81526001600160a01b0385811660048301529151600093929092169163b46310f6918691611ffe91879186916370a08231916024808301926020929190829003018186803b158015611b9657600080fd5b6040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050600060405180830381600087803b15801561204d57600080fd5b505af1158015612061573d6000803e3d6000fd5b5050600854612079925090508363ffffffff61269516565b6008556120888360008461284b565b61209283836129df565b50600192915050565b6002546001600160a01b031633148015906120c157506003546001600160a01b03163314155b80156120d857506004546001600160a01b03163314155b156120f057600480546001600160a01b031916331790555b6000546004546001600160a01b03908116911614611796576040805162461bcd60e51b815260206004820152601360248201527227bbb732b91037b7363c90333ab731ba34b7b760691b604482015290519081900360640190fd5b600254604080516001600160a01b038481166020808401919091528351808403820181528385018086527f546f6b656e5374617465557064617465642861646472657373290000000000009052935192839003605a01832063907dff9760e01b8452600160248501819052604485018290526000606486018190526084860181905260a4860181905260c060048701908152875160c48801528751959098169763907dff97979692959394919384938493839260e490920191908a0190808383885b8381101561222557818101518382015260200161220d565b50505050905090810190601f1680156122525780820380516001836020036101000a031916815260200191505b50975050505050505050600060405180830381600087803b15801561227657600080fd5b505af115801561228a573d6000803e3d6000fd5b5050505050565b600080600b54631cd554d160e21b14156122c5575060045482906122bf906001600160a01b031685836123f4565b50612385565b6122cd611c74565b60048054600b5460408051630a1e187d60e01b81526001600160a01b0393841694810194909452602484019190915260448301879052631cd554d160e21b606484015273feefeefeefeefeefeefeefeefeefeefeefeefeef608484015251921691630a1e187d9160a4808201926020929091908290030181600087803b15801561235657600080fd5b505af115801561236a573d6000803e3d6000fd5b505050506040513d602081101561238057600080fd5b505190505b61238d611c5a565b6001600160a01b03166322bf55ef826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156123d257600080fd5b505af11580156123e6573d6000803e3d6000fd5b506001979650505050505050565b60006001600160a01b0383161580159061241757506001600160a01b0383163014155b801561243157506002546001600160a01b03848116911614155b612482576040805162461bcd60e51b815260206004820152601f60248201527f43616e6e6f74207472616e7366657220746f2074686973206164647265737300604482015290519081900360640190fd5b600554604080516370a0823160e01b81526001600160a01b0387811660048301529151919092169163b46310f69187916124e091879186916370a0823191602480820192602092909190829003018186803b158015611b9657600080fd5b6040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050600060405180830381600087803b15801561252f57600080fd5b505af1158015612543573d6000803e3d6000fd5b5050600554604080516370a0823160e01b81526001600160a01b038881166004830152915191909216935063b46310f6925086916125a591879186916370a0823191602480820192602092909190829003018186803b158015611d5a57600080fd5b6040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050600060405180830381600087803b1580156125f457600080fd5b505af1158015612608573d6000803e3d6000fd5b5050505061261784848461284b565b5060019392505050565b6002546001600160a01b031633148061264457506003546001600160a01b031633145b611796576040805162461bcd60e51b815260206004820152601760248201527f4f6e6c79207468652070726f78792063616e2063616c6c000000000000000000604482015290519081900360640190fd5b6000828211156126ec576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6001600160a01b031690565b6000611c6f6b53797374656d53746174757360a01b5b6000818152600a6020908152604080832054815170026b4b9b9b4b7339030b2323932b9b99d1607d1b9381019390935260318084018690528251808503909101815260519093019091526001600160a01b03169081611f975760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156127b657818101518382015260200161279e565b50505050905090810190601f1680156127e35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b600082820183811015611240576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60025460408051602080820185905282518083039091018152908201918290526001600160a01b039092169163907dff9791600390806021612b668239602101905060405180910390206117eb886126f2565b60028054604080516020808201869052825180830390910181528183018084527f49737375656428616464726573732c75696e7432353629000000000000000000905291519081900360570190206001600160a01b039092169263907dff9792612907876126f2565b6000806040518763ffffffff1660e01b815260040180806020018781526020018681526020018581526020018460001b81526020018360001b8152602001828103825288818151815260200191508051906020019080838360005b8381101561297a578181015183820152602001612962565b50505050905090810190601f1680156129a75780820380516001836020036101000a031916815260200191505b50975050505050505050600060405180830381600087803b1580156129cb57600080fd5b505af1158015611a91573d6000803e3d6000fd5b60028054604080516020808201869052825180830390910181528183018084527f4275726e656428616464726573732c75696e7432353629000000000000000000905291519081900360570190206001600160a01b039092169263907dff9792612907876126f256fe596f75206d757374206265206e6f6d696e61746564206265666f726520796f752063616e20616363657074206f776e657273686970496e73756666696369656e742062616c616e636520616674657220616e7920736574746c656d656e74206f77696e674f6e6c7920466565506f6f6c2c2045786368616e6765722c20497373756572206f72204d756c7469436f6c6c61746572616c20636f6e74726163747320616c6c6f7765644f6e6c792074686520636f6e7472616374206f776e6572206d617920706572666f726d207468697320616374696f6e417070726f76616c28616464726573732c616464726573732c75696e743235362943616e6e6f74207472616e7366657220647572696e672077616974696e6720706572696f645472616e7366657228616464726573732c616464726573732c75696e7432353629a265627a7a723158209d6f6180ceaeef6e561a6ae2270191967c2819f75fbd7aa0fef9659b4345639264736f6c6343000510003200000000000000000000000054c4b5cb58c880dd1734123c8b588e49edf442fb000000000000000000000000fbb6526ed92da8915d4843a86166020d0b7baad000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000b64ff7a4a33acdf48d97dab0d764afd0f617688273455448000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005c2ed6bbe44128cd6be000000000000000000000000242a3df52c375bee81b1c668741d7c63af68fdd2000000000000000000000000000000000000000000000000000000000000000a53796e746820734554480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000047345544800000000000000000000000000000000000000000000000000000000

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

00000000000000000000000054c4b5cb58c880dd1734123c8b588e49edf442fb000000000000000000000000fbb6526ed92da8915d4843a86166020d0b7baad000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000b64ff7a4a33acdf48d97dab0d764afd0f617688273455448000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005c2ed6bbe44128cd6be000000000000000000000000242a3df52c375bee81b1c668741d7c63af68fdd2000000000000000000000000000000000000000000000000000000000000000a53796e746820734554480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000047345544800000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : _proxy (address): 0x54c4b5cb58c880dd1734123c8b588e49edf442fb
Arg [1] : _tokenState (address): 0xfbb6526ed92da8915d4843a86166020d0b7baad0
Arg [2] : _tokenName (string): Synth sETH
Arg [3] : _tokenSymbol (string): sETH
Arg [4] : _owner (address): 0xb64ff7a4a33acdf48d97dab0d764afd0f6176882
Arg [5] : _currencyKey (bytes32): 0x7345544800000000000000000000000000000000000000000000000000000000
Arg [6] : _totalSupply (uint256): 27207608741456954316478
Arg [7] : _resolver (address): 0x242a3df52c375bee81b1c668741d7c63af68fdd2

-----Encoded View---------------
12 Constructor Arguments found :
Arg [0] : 00000000000000000000000054c4b5cb58c880dd1734123c8b588e49edf442fb
Arg [1] : 000000000000000000000000fbb6526ed92da8915d4843a86166020d0b7baad0
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000100
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000140
Arg [4] : 000000000000000000000000b64ff7a4a33acdf48d97dab0d764afd0f6176882
Arg [5] : 7345544800000000000000000000000000000000000000000000000000000000
Arg [6] : 0000000000000000000000000000000000000000000005c2ed6bbe44128cd6be
Arg [7] : 000000000000000000000000242a3df52c375bee81b1c668741d7c63af68fdd2
Arg [8] : 000000000000000000000000000000000000000000000000000000000000000a
Arg [9] : 53796e7468207345544800000000000000000000000000000000000000000000
Arg [10] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [11] : 7345544800000000000000000000000000000000000000000000000000000000


Library Used

SafeDecimalMath : 0x1a60e2e2a8be0bc2b6381dd31fd3fd5f9a28de4c

Block Transaction Difficulty Gas Used Reward
Block Uncle Number Difficulty Gas Used Reward
Loading