Contract 0x3Cc79dA9bF8f7e320Ae4927063b4275B83B815a2

Contract Overview

Balance:
0 Ether
Txn Hash Method
Block
From
To
Value
0x1f48fc90873a1033fcc4bb68a25c3bde33278a67d9bc5a34bc0b22dbd8141c68Set Resolver And...85942622020-08-31 16:38:48226 days 21 hrs ago0xb64ff7a4a33acdf48d97dab0d764afd0f6176882 IN  0x3cc79da9bf8f7e320ae4927063b4275b83b815a20 Ether0.0421585500
0xd66a40a1c6022d0ee8ffaa06b1af4b18d735d4466664d8b1994197c48bc4ccb3Set Resolver And...83932582020-07-29 18:33:36259 days 19 hrs ago0xb64ff7a4a33acdf48d97dab0d764afd0f6176882 IN  0x3cc79da9bf8f7e320ae4927063b4275b83b815a20 Ether0.0003585855
0x67b0e0221d617e660019f479b4ce3752f44ebf9437037b9bed7224e577f4397cSet Resolver And...82038282020-07-01 3:10:29288 days 11 hrs ago0xb64ff7a4a33acdf48d97dab0d764afd0f6176882 IN  0x3cc79da9bf8f7e320ae4927063b4275b83b815a20 Ether0.0021515130
0xf92ad0739e8beed45e9419c15a2040b0aa3ff078f92d396ebb1d0df1dc58a902Set Resolver And...81955492020-06-29 21:24:14289 days 17 hrs ago0xb64ff7a4a33acdf48d97dab0d764afd0f6176882 IN  0x3cc79da9bf8f7e320ae4927063b4275b83b815a20 Ether0.0004425855
0xb98421233fb36ed1e7b762aff56566fcebc179727ba3760f79d45a4f4f3027fdSet Resolver And...80318532020-06-04 22:11:03314 days 16 hrs ago0xb64ff7a4a33acdf48d97dab0d764afd0f6176882 IN  0x3cc79da9bf8f7e320ae4927063b4275b83b815a20 Ether0.00102008412
0xd3d19d081e5bd5f7f51c8a48de5df32366444168f0df4f40a19fa7b4ed812558Set Resolver And...76366862020-04-02 7:42:52378 days 6 hrs ago0xb64ff7a4a33acdf48d97dab0d764afd0f6176882 IN  0x3cc79da9bf8f7e320ae4927063b4275b83b815a20 Ether0.0032841420
0xca4134903c48bcf016a29f34c2512a1aee2a2746107ca9b87b696b41faa7e46f0x6101206076365392020-04-02 6:42:59378 days 7 hrs ago0xb64ff7a4a33acdf48d97dab0d764afd0f6176882 IN  Contract Creation0 Ether0.0685010220
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0xc1b3b660862bad62f691724a8b012219fc46da612d8f2badb9ae94743429128e95641262021-01-30 3:22:2275 days 11 hrs ago 0x3cc79da9bf8f7e320ae4927063b4275b83b815a2 0xddb882a06ebc7dc4abb93ad4bbba83644a33dd880 Ether
0xc1b3b660862bad62f691724a8b012219fc46da612d8f2badb9ae94743429128e95641262021-01-30 3:22:2275 days 11 hrs ago 0x3cc79da9bf8f7e320ae4927063b4275b83b815a2 0xddb882a06ebc7dc4abb93ad4bbba83644a33dd880 Ether
0xc1b3b660862bad62f691724a8b012219fc46da612d8f2badb9ae94743429128e95641262021-01-30 3:22:2275 days 11 hrs ago 0x3cc79da9bf8f7e320ae4927063b4275b83b815a2 0x0a1e5cd9405f10f29fcc739a338bcb18245001ac0 Ether
0xc1b3b660862bad62f691724a8b012219fc46da612d8f2badb9ae94743429128e95641262021-01-30 3:22:2275 days 11 hrs ago 0x3cc79da9bf8f7e320ae4927063b4275b83b815a2 0x0a1e5cd9405f10f29fcc739a338bcb18245001ac0 Ether
0xc1b3b660862bad62f691724a8b012219fc46da612d8f2badb9ae94743429128e95641262021-01-30 3:22:2275 days 11 hrs ago 0xf973f1ab453a3fbf7fac2be80161a62c456c4350 0x3cc79da9bf8f7e320ae4927063b4275b83b815a20 Ether
0x7a38875b7dad33f0a0bcb8b5cdd92cf0713cc9ac26a131c460f8a53f2b028a5d95640852021-01-30 3:13:1375 days 11 hrs ago 0x3cc79da9bf8f7e320ae4927063b4275b83b815a2 0xddb882a06ebc7dc4abb93ad4bbba83644a33dd880 Ether
0x7a38875b7dad33f0a0bcb8b5cdd92cf0713cc9ac26a131c460f8a53f2b028a5d95640852021-01-30 3:13:1375 days 11 hrs ago 0x3cc79da9bf8f7e320ae4927063b4275b83b815a2 0x0a1e5cd9405f10f29fcc739a338bcb18245001ac0 Ether
0x7a38875b7dad33f0a0bcb8b5cdd92cf0713cc9ac26a131c460f8a53f2b028a5d95640852021-01-30 3:13:1375 days 11 hrs ago 0x3cc79da9bf8f7e320ae4927063b4275b83b815a2 0x0a1e5cd9405f10f29fcc739a338bcb18245001ac0 Ether
0x7a38875b7dad33f0a0bcb8b5cdd92cf0713cc9ac26a131c460f8a53f2b028a5d95640852021-01-30 3:13:1375 days 11 hrs ago 0x3cc79da9bf8f7e320ae4927063b4275b83b815a2 0x0a1e5cd9405f10f29fcc739a338bcb18245001ac0 Ether
0x7a38875b7dad33f0a0bcb8b5cdd92cf0713cc9ac26a131c460f8a53f2b028a5d95640852021-01-30 3:13:1375 days 11 hrs ago 0x3cc79da9bf8f7e320ae4927063b4275b83b815a2 0x0a1e5cd9405f10f29fcc739a338bcb18245001ac0 Ether
0x7a38875b7dad33f0a0bcb8b5cdd92cf0713cc9ac26a131c460f8a53f2b028a5d95640852021-01-30 3:13:1375 days 11 hrs ago 0x3cc79da9bf8f7e320ae4927063b4275b83b815a2 0x0800ca66234e4691690485d9e45d8a8c9e6f9b520 Ether
0x7a38875b7dad33f0a0bcb8b5cdd92cf0713cc9ac26a131c460f8a53f2b028a5d95640852021-01-30 3:13:1375 days 11 hrs ago 0x3cc79da9bf8f7e320ae4927063b4275b83b815a2 0x0a1e5cd9405f10f29fcc739a338bcb18245001ac0 Ether
0x7a38875b7dad33f0a0bcb8b5cdd92cf0713cc9ac26a131c460f8a53f2b028a5d95640852021-01-30 3:13:1375 days 11 hrs ago 0x3cc79da9bf8f7e320ae4927063b4275b83b815a2 0xf973f1ab453a3fbf7fac2be80161a62c456c43500 Ether
0x7a38875b7dad33f0a0bcb8b5cdd92cf0713cc9ac26a131c460f8a53f2b028a5d95640852021-01-30 3:13:1375 days 11 hrs ago 0x3cc79da9bf8f7e320ae4927063b4275b83b815a2 0xf973f1ab453a3fbf7fac2be80161a62c456c43500 Ether
0x7a38875b7dad33f0a0bcb8b5cdd92cf0713cc9ac26a131c460f8a53f2b028a5d95640852021-01-30 3:13:1375 days 11 hrs ago 0xddb882a06ebc7dc4abb93ad4bbba83644a33dd88 0x3cc79da9bf8f7e320ae4927063b4275b83b815a20 Ether
0x7a38875b7dad33f0a0bcb8b5cdd92cf0713cc9ac26a131c460f8a53f2b028a5d95640852021-01-30 3:13:1375 days 11 hrs ago 0xddb882a06ebc7dc4abb93ad4bbba83644a33dd88 0x3cc79da9bf8f7e320ae4927063b4275b83b815a20 Ether
0x333db3620677f01f0f9cb5aaccc8a1a76f9a83d19f734a75368bfea36cd8db9595105012021-01-21 16:48:2083 days 21 hrs ago 0x3cc79da9bf8f7e320ae4927063b4275b83b815a2 0xddb882a06ebc7dc4abb93ad4bbba83644a33dd880 Ether
0x333db3620677f01f0f9cb5aaccc8a1a76f9a83d19f734a75368bfea36cd8db9595105012021-01-21 16:48:2083 days 21 hrs ago 0x3cc79da9bf8f7e320ae4927063b4275b83b815a2 0xddb882a06ebc7dc4abb93ad4bbba83644a33dd880 Ether
0x333db3620677f01f0f9cb5aaccc8a1a76f9a83d19f734a75368bfea36cd8db9595105012021-01-21 16:48:2083 days 21 hrs ago 0x3cc79da9bf8f7e320ae4927063b4275b83b815a2 0x0a1e5cd9405f10f29fcc739a338bcb18245001ac0 Ether
0x333db3620677f01f0f9cb5aaccc8a1a76f9a83d19f734a75368bfea36cd8db9595105012021-01-21 16:48:2083 days 21 hrs ago 0x3cc79da9bf8f7e320ae4927063b4275b83b815a2 0x0a1e5cd9405f10f29fcc739a338bcb18245001ac0 Ether
0x333db3620677f01f0f9cb5aaccc8a1a76f9a83d19f734a75368bfea36cd8db9595105012021-01-21 16:48:2083 days 21 hrs ago 0xf973f1ab453a3fbf7fac2be80161a62c456c4350 0x3cc79da9bf8f7e320ae4927063b4275b83b815a20 Ether
0xa00ff5a08b24e2dee6729125ea2fcc142476ae5e39bc77b8508e35ee9c937f2788180002020-10-05 2:37:15192 days 11 hrs ago 0xba46d4cd44c9eb5f2d5a2c72d53add0782b3806f 0x3cc79da9bf8f7e320ae4927063b4275b83b815a20 Ether
0x6122c57e3340d9667bf0e8d96d268eeeb1e88f270c89e31e40785649d8476ddc87768202020-09-28 21:13:36198 days 17 hrs ago 0xba46d4cd44c9eb5f2d5a2c72d53add0782b3806f 0x3cc79da9bf8f7e320ae4927063b4275b83b815a20 Ether
0xda8a3843831872e6073f598fa0adcca4b68fe4fb8cbe897c3b56161b1cfa12e587320392020-09-22 8:25:12205 days 6 hrs ago 0xba46d4cd44c9eb5f2d5a2c72d53add0782b3806f 0x3cc79da9bf8f7e320ae4927063b4275b83b815a20 Ether
0xee1e101fc0a9a4d385bdb2f9fee57396903041980837c12a2a2ba505d5e8a9b487320332020-09-22 8:24:01205 days 6 hrs ago 0xba46d4cd44c9eb5f2d5a2c72d53add0782b3806f 0x3cc79da9bf8f7e320ae4927063b4275b83b815a20 Ether
[ Download CSV Export 
Loading

Contract Source Code Verified (Similar Match)
Note: This contract matches the deployed ByteCode of the Source Code for Contract 0x5Eb054cfAc1e39e3C1b5C11A1b9C019e803fA033

Contract Name:
Synth

Compiler Version
v0.4.25+commit.59dbf8f1

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2020-03-30
*/

/*

⚠⚠⚠ 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: Synth.sol
*
* Latest source (may be newer): https://github.com/Synthetixio/synthetix/blob/master/contracts/Synth.sol
* Docs: https://docs.synthetix.io/contracts/Synth
*
* Contract Dependencies: 
*	- ExternStateToken
*	- MixinResolver
*	- Owned
*	- Proxyable
*	- SelfDestructible
*	- State
* 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
*/

/* ===============================================
* Flattened with Solidifier by Coinage
* 
* https://solidifier.coina.ge
* ===============================================
*/


pragma solidity ^0.4.24;

/**
 * @title SafeMath
 * @dev Math operations with safety checks that revert on error
 */
library SafeMath {

  /**
  * @dev Multiplies two numbers, reverts on 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);

    return c;
  }

  /**
  * @dev Integer division of two numbers truncating the quotient, reverts on division by zero.
  */
  function div(uint256 a, uint256 b) internal pure returns (uint256) {
    require(b > 0); // Solidity only automatically asserts when dividing by 0
    uint256 c = a / b;
    // assert(a == b * c + a % b); // There is no case in which this doesn't hold

    return c;
  }

  /**
  * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).
  */
  function sub(uint256 a, uint256 b) internal pure returns (uint256) {
    require(b <= a);
    uint256 c = a - b;

    return c;
  }

  /**
  * @dev Adds two numbers, reverts on overflow.
  */
  function add(uint256 a, uint256 b) internal pure returns (uint256) {
    uint256 c = a + b;
    require(c >= a);

    return c;
  }

  /**
  * @dev Divides two numbers and returns the remainder (unsigned integer modulo),
  * reverts when dividing by zero.
  */
  function mod(uint256 a, uint256 b) internal pure returns (uint256) {
    require(b != 0);
    return a % b;
  }
}


// https://docs.synthetix.io/contracts/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;
    }
}


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

    /**
     * @dev Owned Constructor
     */
    constructor(address _owner) public {
        require(_owner != address(0), "Owner address cannot be 0");
        owner = _owner;
        emit OwnerChanged(address(0), _owner);
    }

    /**
     * @notice Nominate a new owner of this contract.
     * @dev Only the current owner may nominate a new owner.
     */
    function nominateNewOwner(address _owner) external onlyOwner {
        nominatedOwner = _owner;
        emit OwnerNominated(_owner);
    }

    /**
     * @notice Accept the nomination to be 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 {
        require(msg.sender == owner, "Only the contract owner may perform this action");
        _;
    }

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


// https://docs.synthetix.io/contracts/SelfDestructible
contract SelfDestructible is Owned {
    uint public initiationTime;
    bool public selfDestructInitiated;
    address public selfDestructBeneficiary;
    uint public constant SELFDESTRUCT_DELAY = 4 weeks;

    /**
     * @dev Constructor
     * @param _owner The account which controls this contract.
     */
    constructor(address _owner) public Owned(_owner) {
        require(_owner != address(0), "Owner must not be zero");
        selfDestructBeneficiary = _owner;
        emit SelfDestructBeneficiaryUpdated(_owner);
    }

    /**
     * @notice Set the beneficiary address of this contract.
     * @dev Only the contract owner may call this. The provided beneficiary must be non-null.
     * @param _beneficiary The address to pay any eth contained in this contract to upon self-destruction.
     */
    function setSelfDestructBeneficiary(address _beneficiary) external onlyOwner {
        require(_beneficiary != address(0), "Beneficiary must not be zero");
        selfDestructBeneficiary = _beneficiary;
        emit SelfDestructBeneficiaryUpdated(_beneficiary);
    }

    /**
     * @notice Begin the self-destruction counter of this contract.
     * Once the delay has elapsed, the contract may be self-destructed.
     * @dev Only the contract owner may call this.
     */
    function initiateSelfDestruct() external onlyOwner {
        initiationTime = now;
        selfDestructInitiated = true;
        emit SelfDestructInitiated(SELFDESTRUCT_DELAY);
    }

    /**
     * @notice Terminate and reset the self-destruction timer.
     * @dev Only the contract owner may call this.
     */
    function terminateSelfDestruct() external onlyOwner {
        initiationTime = 0;
        selfDestructInitiated = false;
        emit SelfDestructTerminated();
    }

    /**
     * @notice If the self-destruction delay has elapsed, destroy this contract and
     * remit any ether it owns to the beneficiary address.
     * @dev Only the contract owner may call this.
     */
    function selfDestruct() external onlyOwner {
        require(selfDestructInitiated, "Self Destruct not yet initiated");
        require(initiationTime + SELFDESTRUCT_DELAY < now, "Self destruct delay not met");
        address beneficiary = selfDestructBeneficiary;
        emit SelfDestructed(beneficiary);
        selfdestruct(beneficiary);
    }

    event SelfDestructTerminated();
    event SelfDestructed(address beneficiary);
    event SelfDestructInitiated(uint selfDestructDelay);
    event SelfDestructBeneficiaryUpdated(address newBeneficiary);
}


// https://docs.synthetix.io/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 _owner, address _associatedContract) public Owned(_owner) {
        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);
}


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

    /**
     * @dev Constructor
     * @param _owner The address which controls this contract.
     * @param _associatedContract The ERC20 contract whose state this composes.
     */
    constructor(address _owner, address _associatedContract) public State(_owner, _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;
    }
}


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

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

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

    function setUseDELEGATECALL(bool value) external onlyOwner {
        useDELEGATECALL = value;
    }

    function _emit(bytes 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)
                }
        }
    }

    function() external payable {
        if (useDELEGATECALL) {
            assembly {
                /* Copy call data into free memory region. */
                let free_ptr := mload(0x40)
                calldatacopy(free_ptr, 0, calldatasize)

                /* Forward all gas and call data to the target contract. */
                let result := delegatecall(gas, sload(target_slot), free_ptr, calldatasize, 0, 0)
                returndatacopy(free_ptr, 0, returndatasize)

                /* Revert if the call failed, otherwise return the result. */
                if iszero(result) {
                    revert(free_ptr, returndatasize)
                }
                return(free_ptr, returndatasize)
            }
        } else {
            /* Here we are as above, but must send the messageSender explicitly
             * since we are using CALL rather than 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);
}


// https://docs.synthetix.io/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 _proxy, address _owner) public Owned(_owner) {
        proxy = Proxy(_proxy);
        emit ProxyUpdated(_proxy);
    }

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

    function setIntegrationProxy(address _integrationProxy) external onlyOwner {
        integrationProxy = Proxy(_integrationProxy);
    }

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

    modifier onlyProxy {
        require(Proxy(msg.sender) == proxy || Proxy(msg.sender) == integrationProxy, "Only the proxy can call");
        _;
    }

    modifier optionalProxy {
        if (Proxy(msg.sender) != proxy && Proxy(msg.sender) != integrationProxy && messageSender != msg.sender) {
            messageSender = msg.sender;
        }
        _;
    }

    modifier optionalProxy_onlyOwner {
        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);
}


// https://docs.synthetix.io/contracts/ExternStateToken
contract ExternStateToken is SelfDestructible, 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;

    /**
     * @dev Constructor.
     * @param _proxy The proxy associated with this contract.
     * @param _name Token's ERC20 name.
     * @param _symbol Token's ERC20 symbol.
     * @param _totalSupply The total supply of the token.
     * @param _tokenState The TokenState contract address.
     * @param _owner The owner of this contract.
     */
    constructor(
        address _proxy,
        TokenState _tokenState,
        string _name,
        string _symbol,
        uint _totalSupply,
        uint8 _decimals,
        address _owner
    ) public SelfDestructible(_owner) Proxyable(_proxy, _owner) {
        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) public 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(_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 _transfer_byProxy(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 _transferFrom_byProxy(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 ========== */

    event Transfer(address indexed from, address indexed to, uint value);
    bytes32 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, bytes32(from), bytes32(to), 0);
    }

    event Approval(address indexed owner, address indexed spender, uint value);
    bytes32 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, bytes32(owner), bytes32(spender), 0);
    }

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

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


interface ISystemStatus {
    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;
}


/**
 * @title FeePool Interface
 * @notice Abstract contract to hold public getters
 */
contract IFeePool {
    address public FEE_ADDRESS;
    uint public exchangeFeeRate;

    function amountReceivedFromExchange(uint value) external view returns (uint);

    function amountReceivedFromTransfer(uint value) external view returns (uint);

    function recordFeePaid(uint sUSDAmount) external;

    function appendAccountIssuanceRecord(address account, uint lockedAmount, uint debtEntryIndex) external;

    function setRewardsToDistribute(uint amount) external;
}


/**
 * @title SynthetixState interface contract
 * @notice Abstract contract to hold public getters
 */
contract ISynthetixState {
    // A struct for handing values associated with an individual user's debt position
    struct IssuanceData {
        // Percentage of the total debt owned at the time
        // of issuance. This number is modified by the global debt
        // delta array. You can figure out a user's exit price and
        // collateralisation ratio using a combination of their initial
        // debt and the slice of global debt delta which applies to them.
        uint initialDebtOwnership;
        // This lets us know when (in relative terms) the user entered
        // the debt pool so we can calculate their exit price and
        // collateralistion ratio
        uint debtEntryIndex;
    }

    uint[] public debtLedger;
    uint public issuanceRatio;
    mapping(address => IssuanceData) public issuanceData;

    function debtLedgerLength() external view returns (uint);

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

    function incrementTotalIssuerCount() external;

    function decrementTotalIssuerCount() external;

    function setCurrentIssuanceData(address account, uint initialDebtOwnership) external;

    function lastDebtLedgerEntry() external view returns (uint);

    function appendDebtLedgerValue(uint value) external;

    function clearIssuanceData(address account) external;
}


interface ISynth {
    function burn(address account, uint amount) external;

    function issue(address account, uint amount) external;

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

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

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

    function balanceOf(address owner) external view returns (uint);
}


/**
 * @title SynthetixEscrow interface
 */
interface ISynthetixEscrow {
    function balanceOf(address account) public view returns (uint);

    function appendVestingEntry(address account, uint quantity) public;
}


/**
 * @title ExchangeRates interface
 */
interface IExchangeRates {
    function effectiveValue(bytes32 sourceCurrencyKey, uint sourceAmount, bytes32 destinationCurrencyKey)
        external
        view
        returns (uint);

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

    function ratesForCurrencies(bytes32[] currencyKeys) external view returns (uint[] memory);

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

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

    function anyRateIsStale(bytes32[] currencyKeys) external view returns (bool);

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

    function effectiveValueAtRound(
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey,
        uint roundIdForSrc,
        uint roundIdForDest
    ) external view returns (uint);

    function getLastRoundIdBeforeElapsedSecs(
        bytes32 currencyKey,
        uint startingRoundId,
        uint startingTimestamp,
        uint timediff
    ) external view returns (uint);

    function ratesAndStaleForCurrencies(bytes32[] currencyKeys) external view returns (uint[], bool);

    function rateAndTimestampAtRound(bytes32 currencyKey, uint roundId) external view returns (uint rate, uint time);
}


/**
 * @title Synthetix interface contract
 * @notice Abstract contract to hold public getters
 * @dev pseudo interface, actually declared as contract to hold the public getters
 */


contract ISynthetix {
    // ========== PUBLIC STATE VARIABLES ==========

    uint public totalSupply;

    mapping(bytes32 => Synth) public synths;

    mapping(address => bytes32) public synthsByAddress;

    // ========== PUBLIC FUNCTIONS ==========

    function balanceOf(address account) public view returns (uint);

    function transfer(address to, uint value) public returns (bool);

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

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

    function issueSynths(uint amount) external;

    function issueMaxSynths() external;

    function burnSynths(uint amount) external;

    function burnSynthsToTarget() external;

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

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

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

    function totalIssuedSynthsExcludeEtherCollateral(bytes32 currencyKey) public view returns (uint);

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

    function debtBalanceOfAndTotalDebt(address issuer, bytes32 currencyKey)
        public
        view
        returns (uint debtBalance, uint totalSystemValue);

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

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

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

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

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

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


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

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

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

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

    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 calculateAmountAfterSettlement(address from, bytes32 currencyKey, uint amount, uint refunded)
        external
        view
        returns (uint amountAfterSettlement);
}


interface IIssuer {
    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 canBurnSynths(address account) external view returns (bool);

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


// https://docs.synthetix.io/contracts/AddressResolver
contract AddressResolver is Owned {
    mapping(bytes32 => address) public repository;

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

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

    function importAddresses(bytes32[] names, address[] destinations) public onlyOwner {
        require(names.length == destinations.length, "Input lengths must match");

        for (uint i = 0; i < names.length; i++) {
            repository[names[i]] = destinations[i];
        }
    }

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

    function getAddress(bytes32 name) public view returns (address) {
        return repository[name];
    }

    function requireAndGetAddress(bytes32 name, string reason) public view returns (address) {
        address _foundAddress = repository[name];
        require(_foundAddress != address(0), reason);
        return _foundAddress;
    }
}


// https://docs.synthetix.io/contracts/MixinResolver
contract MixinResolver is Owned {
    AddressResolver public resolver;

    mapping(bytes32 => address) private addressCache;

    bytes32[] public resolverAddressesRequired;

    uint public constant MAX_ADDRESSES_FROM_RESOLVER = 24;

    constructor(address _owner, address _resolver, bytes32[MAX_ADDRESSES_FROM_RESOLVER] _addressesToCache)
        public
        Owned(_owner)
    {
        for (uint i = 0; i < _addressesToCache.length; i++) {
            if (_addressesToCache[i] != bytes32(0)) {
                resolverAddressesRequired.push(_addressesToCache[i]);
            } else {
                // End early once an empty item is found - assumes there are no empty slots in
                // _addressesToCache
                break;
            }
        }
        resolver = AddressResolver(_resolver);
        // Do not sync the cache as addresses may not be in the resolver yet
    }

    /* ========== SETTERS ========== */
    function setResolverAndSyncCache(AddressResolver _resolver) external onlyOwner {
        resolver = _resolver;

        for (uint i = 0; i < resolverAddressesRequired.length; i++) {
            bytes32 name = resolverAddressesRequired[i];
            // Note: can only be invoked once the resolver has all the targets needed added
            addressCache[name] = resolver.requireAndGetAddress(name, "Resolver missing target");
        }
    }

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

    function requireAndGetAddress(bytes32 name, string reason) internal view returns (address) {
        address _foundAddress = addressCache[name];
        require(_foundAddress != address(0), reason);
        return _foundAddress;
    }

    // Note: this could be made external in a utility contract if addressCache was made public
    // (used for deployment)
    function isResolverCached(AddressResolver _resolver) external view returns (bool) {
        if (resolver != _resolver) {
            return false;
        }

        // otherwise, check everything
        for (uint i = 0; i < resolverAddressesRequired.length; i++) {
            bytes32 name = resolverAddressesRequired[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;
    }

    // Note: can be made external into a utility contract (used for deployment)
    function getResolverAddressesRequired() external view returns (bytes32[MAX_ADDRESSES_FROM_RESOLVER] addressesRequired) {
        for (uint i = 0; i < resolverAddressesRequired.length; i++) {
            addressesRequired[i] = resolverAddressesRequired[i];
        }
    }

    /* ========== INTERNAL FUNCTIONS ========== */
    function appendToAddressCache(bytes32 name) internal {
        resolverAddressesRequired.push(name);
        require(resolverAddressesRequired.length < MAX_ADDRESSES_FROM_RESOLVER, "Max resolver cache size met");
        // Because this is designed to be called internally in constructors, we don't
        // check the address exists already in the resolver
        addressCache[name] = resolver.getAddress(name);
    }
}


// https://docs.synthetix.io/contracts/Synth
contract Synth is ExternStateToken, MixinResolver {
    /* ========== 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_SYNTHETIX = "Synthetix";
    bytes32 private constant CONTRACT_EXCHANGER = "Exchanger";
    bytes32 private constant CONTRACT_ISSUER = "Issuer";
    bytes32 private constant CONTRACT_FEEPOOL = "FeePool";

    bytes32[24] internal addressesToCache = [
        CONTRACT_SYSTEMSTATUS,
        CONTRACT_SYNTHETIX,
        CONTRACT_EXCHANGER,
        CONTRACT_ISSUER,
        CONTRACT_FEEPOOL
    ];

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

    constructor(
        address _proxy,
        TokenState _tokenState,
        string _tokenName,
        string _tokenSymbol,
        address _owner,
        bytes32 _currencyKey,
        uint _totalSupply,
        address _resolver
    )
        public
        ExternStateToken(_proxy, _tokenState, _tokenName, _tokenSymbol, _totalSupply, DECIMALS, _owner)
        MixinResolver(_owner, _resolver, addressesToCache)
    {
        require(_proxy != address(0), "_proxy cannot be 0");
        require(_owner != 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) {
        systemStatus().requireSynthActive(currencyKey);

        (, , 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) {
        systemStatus().requireSynthActive(currencyKey);

        (, , 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;
    }

    // Allow synthetix to issue a certain number of synths from an account.
    // forward call to _internalIssue
    function issue(address account, uint amount) external onlyInternalContracts {
        _internalIssue(account, amount);
    }

    // Allow synthetix or another synth contract to burn a certain number of synths from an account.
    // forward call to _internalBurn
    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 ========== */
    function systemStatus() internal view returns (ISystemStatus) {
        return ISystemStatus(requireAndGetAddress(CONTRACT_SYSTEMSTATUS, "Missing SystemStatus address"));
    }

    function synthetix() internal view returns (ISynthetix) {
        return ISynthetix(requireAndGetAddress(CONTRACT_SYNTHETIX, "Missing Synthetix address"));
    }

    function feePool() internal view returns (IFeePool) {
        return IFeePool(requireAndGetAddress(CONTRACT_FEEPOOL, "Missing FeePool address"));
    }

    function exchanger() internal view returns (IExchanger) {
        return IExchanger(requireAndGetAddress(CONTRACT_EXCHANGER, "Missing Exchanger address"));
    }

    function issuer() internal view returns (IIssuer) {
        return IIssuer(requireAndGetAddress(CONTRACT_ISSUER, "Missing Issuer address"));
    }

    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 isSynthetix = msg.sender == address(synthetix());
        bool isFeePool = msg.sender == address(feePool());
        bool isExchanger = msg.sender == address(exchanger());
        bool isIssuer = msg.sender == address(issuer());

        require(
            isSynthetix || isFeePool || isExchanger || isIssuer,
            "Only Synthetix, 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, bytes32(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, bytes32(account), 0, 0);
    }
}

Contract ABI

[{"constant":true,"inputs":[],"name":"resolver","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"spender","type":"address"},{"name":"value","type":"uint256"}],"name":"approve","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_integrationProxy","type":"address"}],"name":"setIntegrationProxy","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_owner","type":"address"}],"name":"nominateNewOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"initiationTime","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_beneficiary","type":"address"}],"name":"setSelfDestructBeneficiary","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"from","type":"address"},{"name":"to","type":"address"},{"name":"value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"DECIMALS","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"terminateSelfDestruct","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_resolver","type":"address"}],"name":"setResolverAndSyncCache","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"nominatedOwner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_resolver","type":"address"}],"name":"isResolverCached","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"account","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"acceptOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"account","type":"address"},{"name":"amount","type":"uint256"}],"name":"issue","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_proxy","type":"address"}],"name":"setProxy","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"selfDestruct","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"integrationProxy","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"account","type":"address"},{"name":"amount","type":"uint256"}],"name":"burn","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_tokenState","type":"address"}],"name":"setTokenState","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"SELFDESTRUCT_DELAY","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"to","type":"address"},{"name":"value","type":"uint256"}],"name":"transfer","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getResolverAddressesRequired","outputs":[{"name":"addressesRequired","type":"bytes32[24]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"to","type":"address"},{"name":"value","type":"uint256"}],"name":"transferAndSettle","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"selfDestructInitiated","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"sender","type":"address"}],"name":"setMessageSender","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"initiateSelfDestruct","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"selfDestructBeneficiary","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"resolverAddressesRequired","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"messageSender","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"currencyKey","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"owner","type":"address"},{"name":"spender","type":"address"}],"name":"allowance","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MAX_ADDRESSES_FROM_RESOLVER","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"from","type":"address"},{"name":"to","type":"address"},{"name":"value","type":"uint256"}],"name":"transferFromAndSettle","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"tokenState","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"FEE_ADDRESS","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"proxy","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"amount","type":"uint256"}],"name":"setTotalSupply","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"account","type":"address"}],"name":"transferableSynths","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_proxy","type":"address"},{"name":"_tokenState","type":"address"},{"name":"_tokenName","type":"string"},{"name":"_tokenSymbol","type":"string"},{"name":"_owner","type":"address"},{"name":"_currencyKey","type":"bytes32"},{"name":"_totalSupply","type":"uint256"},{"name":"_resolver","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"account","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Issued","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"account","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Burned","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"},{"indexed":true,"name":"spender","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"newTokenState","type":"address"}],"name":"TokenStateUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"proxyAddress","type":"address"}],"name":"ProxyUpdated","type":"event"},{"anonymous":false,"inputs":[],"name":"SelfDestructTerminated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"beneficiary","type":"address"}],"name":"SelfDestructed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"selfDestructDelay","type":"uint256"}],"name":"SelfDestructInitiated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"newBeneficiary","type":"address"}],"name":"SelfDestructBeneficiaryUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"newOwner","type":"address"}],"name":"OwnerNominated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"oldOwner","type":"address"},{"indexed":false,"name":"newOwner","type":"address"}],"name":"OwnerChanged","type":"event"}]

6101206040527f53797374656d537461747573000000000000000000000000000000000000000060809081527f53796e746865746978000000000000000000000000000000000000000000000060a0527f45786368616e676572000000000000000000000000000000000000000000000060c0527f497373756572000000000000000000000000000000000000000000000000000060e0527f466565506f6f6c0000000000000000000000000000000000000000000000000061010052620000cc90600f9060056200054e565b50348015620000da57600080fd5b5060405162003afa38038062003afa83398101604081815282516020840151828501516060860151608087015160a088015160c089015160e08a01516103008a01988990529699959894860197939095019591949093909285918391600f9060189082845b815481526001909101906020018083116200013f5750600093508e92508d91508c90508b8960128d8681808d600160a060020a0381161515620001e357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4f776e657220616464726573732063616e6e6f74206265203000000000000000604482015290519081900360640190fd5b60008054600160a060020a031916600160a060020a038316908117825560408051928352602083019190915280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a150600160a060020a0381161515620002b457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f776e6572206d757374206e6f74206265207a65726f00000000000000000000604482015290519081900360640190fd5b60038054600160a060020a038316610100810261010060a860020a03199092169190911790915560408051918252517fd5da63a0b864b315bc04128dedbc93888c8529ee6cf47ce664dc204339228c539181900360200190a15060048054600160a060020a038416600160a060020a0319909116811790915560408051918252517ffc80377ca9c49cc11ae6982f390a42db976d5530af7c43889264b13fbbd7c57e9181900360200190a1505060078054600160a060020a031916600160a060020a03881617905584516200039190600890602088019062000593565b508351620003a790600990602087019062000593565b5050600a91909155600b805460ff191660ff90921691909117905550600093505050505b601881101562000430576000828260188110620003e457fe5b6020020151146200042157600d828260188110620003fe57fe5b602090810291909101518254600181018455600093845291909220015562000427565b62000430565b600101620003cb565b5050600b805461010060a860020a031916610100600160a060020a0393841602179055891615159050620004c557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f5f70726f78792063616e6e6f7420626520300000000000000000000000000000604482015290519081900360640190fd5b600160a060020a03841615156200053d57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f5f6f776e65722063616e6e6f7420626520300000000000000000000000000000604482015290519081900360640190fd5b5050600e5550620006269350505050565b826018810192821562000581579160200282015b8281111562000581578251825560209092019160019091019062000562565b506200058f92915062000606565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10620005d657805160ff191683800117855562000581565b8280016001018555821562000581579182015b8281111562000581578251825591602001919060010190620005e9565b6200062391905b808211156200058f57600081556001016200060d565b90565b6134c480620006366000396000f3006080604052600436106102005763ffffffff60e060020a60003504166304f3bcec811461020557806306fdde0314610236578063095ea7b3146102c0578063131b0ae7146102f85780631627540c1461031b57806317c70de41461033c57806318160ddd1461036357806320714f881461037857806323b872dd146103995780632e0f2625146103c3578063313ce567146103ee5780633278c960146104035780633be99e6f1461041857806353a47bb714610439578063631e14441461044e57806370a082311461046f57806379ba509714610490578063867904b4146104a55780638da5cb5b146104c957806395d89b41146104de57806397107d6d146104f35780639cb8a26a146105145780639cbdaeb6146105295780639dc29fac1461053e5780639f76980714610562578063a461fc8214610583578063a9059cbb14610598578063ab49848c146105bc578063b014c3a31461060a578063b8225dec1461062e578063bc67f83214610643578063bd32aa4414610664578063c58aaae614610679578063c6c9d8281461068e578063d67bdd25146106a6578063dbd06c85146106bb578063dd62ed3e146106d0578063e3235c91146106f7578063e73cced31461070c578063e90dd9e214610736578063eb1edd611461074b578063ec55688914610760578063f7ea7a3d14610775578063ffff51d61461078d575b600080fd5b34801561021157600080fd5b5061021a6107ae565b60408051600160a060020a039092168252519081900360200190f35b34801561024257600080fd5b5061024b6107c2565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561028557818101518382015260200161026d565b50505050905090810190601f1680156102b25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102cc57600080fd5b506102e4600160a060020a0360043516602435610850565b604080519115158252519081900360200190f35b34801561030457600080fd5b50610319600160a060020a0360043516610954565b005b34801561032757600080fd5b50610319600160a060020a03600435166109da565b34801561034857600080fd5b50610351610a92565b60408051918252519081900360200190f35b34801561036f57600080fd5b50610351610a98565b34801561038457600080fd5b50610319600160a060020a0360043516610a9e565b3480156103a557600080fd5b506102e4600160a060020a0360043581169060243516604435610bcb565b3480156103cf57600080fd5b506103d8610c40565b6040805160ff9092168252519081900360200190f35b3480156103fa57600080fd5b506103d8610c45565b34801561040f57600080fd5b50610319610c4e565b34801561042457600080fd5b50610319600160a060020a0360043516610cec565b34801561044557600080fd5b5061021a610eb5565b34801561045a57600080fd5b506102e4600160a060020a0360043516610ec4565b34801561047b57600080fd5b50610351600160a060020a0360043516611012565b34801561049c57600080fd5b50610319611099565b3480156104b157600080fd5b50610319600160a060020a0360043516602435611194565b3480156104d557600080fd5b5061021a6112b9565b3480156104ea57600080fd5b5061024b6112c8565b3480156104ff57600080fd5b50610319600160a060020a0360043516611323565b34801561052057600080fd5b506103196113db565b34801561053557600080fd5b5061021a611554565b34801561054a57600080fd5b50610319600160a060020a0360043516602435611563565b34801561056e57600080fd5b50610319600160a060020a0360043516611689565b34801561058f57600080fd5b5061035161176d565b3480156105a457600080fd5b506102e4600160a060020a0360043516602435611774565b3480156105c857600080fd5b506105d161185e565b604051808261030080838360005b838110156105f75781810151838201526020016105df565b5050505090500191505060405180910390f35b34801561061657600080fd5b506102e4600160a060020a03600435166024356118ab565b34801561063a57600080fd5b506102e4611ae7565b34801561064f57600080fd5b50610319600160a060020a0360043516611af0565b34801561067057600080fd5b50610319611b8b565b34801561068557600080fd5b5061021a611c38565b34801561069a57600080fd5b50610351600435611c4c565b3480156106b257600080fd5b5061021a611c6b565b3480156106c757600080fd5b50610351611c7a565b3480156106dc57600080fd5b50610351600160a060020a0360043581169060243516611c80565b34801561070357600080fd5b50610351611d26565b34801561071857600080fd5b506102e4600160a060020a0360043581169060243516604435611d2b565b34801561074257600080fd5b5061021a611f57565b34801561075757600080fd5b5061021a611f66565b34801561076c57600080fd5b5061021a611f7e565b34801561078157600080fd5b50610319600435611f8d565b34801561079957600080fd5b50610351600160a060020a036004351661204f565b600b546101009004600160a060020a031681565b6008805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156108485780601f1061081d57610100808354040283529160200191610848565b820191906000526020600020905b81548152906001019060200180831161082b57829003601f168201915b505050505081565b6004546000908190600160a060020a0316331480159061087b5750600554600160a060020a03163314155b80156108925750600654600160a060020a03163314155b156108aa5760068054600160a060020a031916331790555b50600654600754604080517fda46098c000000000000000000000000000000000000000000000000000000008152600160a060020a0393841660048201819052878516602483015260448201879052915191939092169163da46098c91606480830192600092919082900301818387803b15801561092757600080fd5b505af115801561093b573d6000803e3d6000fd5b5050505061094a8185856121a3565b5060019392505050565b600054600160a060020a031633146109b8576040805160e560020a62461bcd02815260206004820152602f60248201526000805160206134598339815191526044820152600080516020613479833981519152606482015290519081900360840190fd5b60058054600160a060020a031916600160a060020a0392909216919091179055565b600054600160a060020a03163314610a3e576040805160e560020a62461bcd02815260206004820152602f60248201526000805160206134598339815191526044820152600080516020613479833981519152606482015290519081900360840190fd5b60018054600160a060020a038316600160a060020a0319909116811790915560408051918252517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce229181900360200190a150565b60025481565b600a5481565b600054600160a060020a03163314610b02576040805160e560020a62461bcd02815260206004820152602f60248201526000805160206134598339815191526044820152600080516020613479833981519152606482015290519081900360840190fd5b600160a060020a0381161515610b62576040805160e560020a62461bcd02815260206004820152601c60248201527f42656e6566696369617279206d757374206e6f74206265207a65726f00000000604482015290519081900360640190fd5b60038054600160a060020a038316610100810274ffffffffffffffffffffffffffffffffffffffff00199092169190911790915560408051918252517fd5da63a0b864b315bc04128dedbc93888c8529ee6cf47ce664dc204339228c539181900360200190a150565b600454600090600160a060020a03163314801590610bf45750600554600160a060020a03163314155b8015610c0b5750600654600160a060020a03163314155b15610c235760068054600160a060020a031916331790555b610c2d848361230b565b610c3884848461251f565b949350505050565b601281565b600b5460ff1681565b600054600160a060020a03163314610cb2576040805160e560020a62461bcd02815260206004820152602f60248201526000805160206134598339815191526044820152600080516020613479833981519152606482015290519081900360840190fd5b600060028190556003805460ff191690556040517f6adcc7125002935e0aa31697538ebbd65cfddf20431eb6ecdcfc3e238bfd082c9190a1565b600080548190600160a060020a03163314610d53576040805160e560020a62461bcd02815260206004820152602f60248201526000805160206134598339815191526044820152600080516020613479833981519152606482015290519081900360840190fd5b600b805474ffffffffffffffffffffffffffffffffffffffff001916610100600160a060020a03861602179055600091505b600d54821015610eb057600d805483908110610d9d57fe5b600091825260208083209190910154600b54604080517fdacb2d010000000000000000000000000000000000000000000000000000000081526004810184905260248101829052601760448201527f5265736f6c766572206d697373696e672074617267657400000000000000000060648201529051929550610100909104600160a060020a03169363dacb2d019360848084019491939192918390030190829087803b158015610e4d57600080fd5b505af1158015610e61573d6000803e3d6000fd5b505050506040513d6020811015610e7757600080fd5b50516000828152600c602052604090208054600160a060020a031916600160a060020a0390921691909117905560019190910190610d85565b505050565b600154600160a060020a031681565b600b5460009081908190600160a060020a038581166101009092041614610eee576000925061100b565b600091505b600d5482101561100657600d805483908110610f0b57fe5b6000918252602080832090910154808352600c8252604080842054600b5482517f21f8a721000000000000000000000000000000000000000000000000000000008152600481018590529251939650600160a060020a0391821695610100909104909116936321f8a72193602480850194929391928390030190829087803b158015610f9657600080fd5b505af1158015610faa573d6000803e3d6000fd5b505050506040513d6020811015610fc057600080fd5b5051600160a060020a0316141580610fed57506000818152600c6020526040902054600160a060020a0316155b15610ffb576000925061100b565b600190910190610ef3565b600192505b5050919050565b6007546040805160e060020a6370a08231028152600160a060020a038481166004830152915160009392909216916370a082319160248082019260209290919082900301818787803b15801561106757600080fd5b505af115801561107b573d6000803e3d6000fd5b505050506040513d602081101561109157600080fd5b505192915050565b600154600160a060020a03163314611121576040805160e560020a62461bcd02815260206004820152603560248201527f596f75206d757374206265206e6f6d696e61746564206265666f726520796f7560448201527f2063616e20616363657074206f776e6572736869700000000000000000000000606482015290519081900360840190fd5b60005460015460408051600160a060020a03938416815292909116602083015280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a16001805460008054600160a060020a0319908116600160a060020a03841617909155169055565b6000806000806111a26126fc565b600160a060020a031633600160a060020a03161493506111c0612762565b600160a060020a031633600160a060020a03161492506111de6127c3565b600160a060020a031633600160a060020a03161491506111fc612824565b600160a060020a031633600160a060020a0316149050838061121b5750825b806112235750815b8061122b5750805b15156112a7576040805160e560020a62461bcd02815260206004820152603e60248201527f4f6e6c792053796e7468657469782c20466565506f6f6c2c2045786368616e6760448201527f6572206f722049737375657220636f6e74726163747320616c6c6f7765640000606482015290519081900360840190fd5b6112b18686612885565b505050505050565b600054600160a060020a031681565b6009805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156108485780601f1061081d57610100808354040283529160200191610848565b600054600160a060020a03163314611387576040805160e560020a62461bcd02815260206004820152602f60248201526000805160206134598339815191526044820152600080516020613479833981519152606482015290519081900360840190fd5b60048054600160a060020a038316600160a060020a0319909116811790915560408051918252517ffc80377ca9c49cc11ae6982f390a42db976d5530af7c43889264b13fbbd7c57e9181900360200190a150565b60008054600160a060020a03163314611440576040805160e560020a62461bcd02815260206004820152602f60248201526000805160206134598339815191526044820152600080516020613479833981519152606482015290519081900360840190fd5b60035460ff16151561149c576040805160e560020a62461bcd02815260206004820152601f60248201527f53656c66204465737472756374206e6f742079657420696e6974696174656400604482015290519081900360640190fd5b426224ea00600254011015156114fc576040805160e560020a62461bcd02815260206004820152601b60248201527f53656c662064657374727563742064656c6179206e6f74206d65740000000000604482015290519081900360640190fd5b5060035460408051600160a060020a0361010090930492909216808352905190917f8a09e1677ced846cb537dc2b172043bd05a1a81ad7e0033a7ef8ba762df990b7919081900360200190a180600160a060020a0316ff5b600554600160a060020a031681565b6000806000806115716126fc565b600160a060020a031633600160a060020a031614935061158f612762565b600160a060020a031633600160a060020a03161492506115ad6127c3565b600160a060020a031633600160a060020a03161491506115cb612824565b600160a060020a031633600160a060020a031614905083806115ea5750825b806115f25750815b806115fa5750805b1515611676576040805160e560020a62461bcd02815260206004820152603e60248201527f4f6e6c792053796e7468657469782c20466565506f6f6c2c2045786368616e6760448201527f6572206f722049737375657220636f6e74726163747320616c6c6f7765640000606482015290519081900360840190fd5b61168086866129bb565b50505050505050565b600454600160a060020a031633148015906116af5750600554600160a060020a03163314155b80156116c65750600654600160a060020a03163314155b156116de5760068054600160a060020a031916331790555b600054600654600160a060020a03908116911614611746576040805160e560020a62461bcd02815260206004820152601360248201527f4f776e6572206f6e6c792066756e6374696f6e00000000000000000000000000604482015290519081900360640190fd5b60078054600160a060020a031916600160a060020a03831617905561176a81612abf565b50565b6224ea0081565b600454600090600160a060020a0316331480159061179d5750600554600160a060020a03163314155b80156117b45750600654600160a060020a03163314155b156117cc5760068054600160a060020a031916331790555b6006546117e290600160a060020a03168361230b565b600160a060020a03831673feefeefeefeefeefeefeefeefeefeefeefeefeef1415611818576118118383612c06565b9050611858565b600160a060020a038316151561183e5760065461181190600160a060020a0316836129bb565b60065461185590600160a060020a03168484612db8565b90505b92915050565b611866613438565b60005b600d548110156118a757600d80548290811061188157fe5b9060005260206000200154828260188110151561189a57fe5b6020020152600101611869565b5090565b60045460009081908190600160a060020a031633148015906118d85750600554600160a060020a03163314155b80156118ef5750600654600160a060020a03163314155b156119075760068054600160a060020a031916331790555b61190f612ff0565b600160a060020a03166342a28e21600e546040518263ffffffff1660e060020a028152600401808260001916600019168152602001915050600060405180830381600087803b15801561196157600080fd5b505af1158015611975573d6000803e3d6000fd5b505050506119816127c3565b600654600e54604080517f1b16802c000000000000000000000000000000000000000000000000000000008152600160a060020a0393841660048201526024810192909252519290911691631b16802c916044808201926060929091908290030181600087803b1580156119f457600080fd5b505af1158015611a08573d6000803e3d6000fd5b505050506040513d6060811015611a1e57600080fd5b506040015191508390506000821115611ab5576007546006546040805160e060020a6370a08231028152600160a060020a039283166004820152905191909216916370a082319160248083019260209291908290030181600087803b158015611a8657600080fd5b505af1158015611a9a573d6000803e3d6000fd5b505050506040513d6020811015611ab057600080fd5b505190505b808411611ac25783611ac4565b805b600654909450611ade90600160a060020a03168686612db8565b95945050505050565b60035460ff1681565b600454600160a060020a0316331480611b135750600554600160a060020a031633145b1515611b69576040805160e560020a62461bcd02815260206004820152601760248201527f4f6e6c79207468652070726f78792063616e2063616c6c000000000000000000604482015290519081900360640190fd5b60068054600160a060020a031916600160a060020a0392909216919091179055565b600054600160a060020a03163314611bef576040805160e560020a62461bcd02815260206004820152602f60248201526000805160206134598339815191526044820152600080516020613479833981519152606482015290519081900360840190fd5b426002556003805460ff19166001179055604080516224ea00815290517fcbd94ca75b8dc45c9d80c77e851670e78843c0d75180cb81db3e2158228fa9a69181900360200190a1565b6003546101009004600160a060020a031681565b600d805482908110611c5a57fe5b600091825260209091200154905081565b600654600160a060020a031681565b600e5481565b600754604080517fdd62ed3e000000000000000000000000000000000000000000000000000000008152600160a060020a03858116600483015284811660248301529151600093929092169163dd62ed3e9160448082019260209290919082900301818787803b158015611cf357600080fd5b505af1158015611d07573d6000803e3d6000fd5b505050506040513d6020811015611d1d57600080fd5b50519392505050565b601881565b60045460009081908190600160a060020a03163314801590611d585750600554600160a060020a03163314155b8015611d6f5750600654600160a060020a03163314155b15611d875760068054600160a060020a031916331790555b611d8f612ff0565b600160a060020a03166342a28e21600e546040518263ffffffff1660e060020a028152600401808260001916600019168152602001915050600060405180830381600087803b158015611de157600080fd5b505af1158015611df5573d6000803e3d6000fd5b50505050611e016127c3565b600e54604080517f1b16802c000000000000000000000000000000000000000000000000000000008152600160a060020a038a81166004830152602482019390935290519290911691631b16802c916044808201926060929091908290030181600087803b158015611e7257600080fd5b505af1158015611e86573d6000803e3d6000fd5b505050506040513d6060811015611e9c57600080fd5b506040015191508390506000821115611f30576007546040805160e060020a6370a08231028152600160a060020a038981166004830152915191909216916370a082319160248083019260209291908290030181600087803b158015611f0157600080fd5b505af1158015611f15573d6000803e3d6000fd5b505050506040513d6020811015611f2b57600080fd5b505190505b80841015611f3e5783611f40565b805b9350611f4d86868661251f565b9695505050505050565b600754600160a060020a031681565b73feefeefeefeefeefeefeefeefeefeefeefeefeef81565b600454600160a060020a031681565b600454600160a060020a03163314801590611fb35750600554600160a060020a03163314155b8015611fca5750600654600160a060020a03163314155b15611fe25760068054600160a060020a031916331790555b600054600654600160a060020a0390811691161461204a576040805160e560020a62461bcd02815260206004820152601360248201527f4f776e6572206f6e6c792066756e6374696f6e00000000000000000000000000604482015290519081900360640190fd5b600a55565b600080600061205c6127c3565b600e54604080517f19d5c665000000000000000000000000000000000000000000000000000000008152600160a060020a0388811660048301526024820193909352905192909116916319d5c665916044808201926060929091908290030181600087803b1580156120cd57600080fd5b505af11580156120e1573d6000803e3d6000fd5b505050506040513d60608110156120f757600080fd5b50516007546040805160e060020a6370a08231028152600160a060020a03888116600483015291519395509116916370a08231916024808201926020929091908290030181600087803b15801561214d57600080fd5b505af1158015612161573d6000803e3d6000fd5b505050506040513d602081101561217757600080fd5b505190508082111561218c576000925061100b565b61219c818363ffffffff61305116565b925061100b565b600480546040805160208082018690528251808303820181528284018085527f417070726f76616c28616464726573732c616464726573732c75696e7432353690527f29000000000000000000000000000000000000000000000000000000000000006060840152925191829003606101822060e060020a63907dff9702835260036024840181905260448401829052600160a060020a038a8116606486018190528a821660848701819052600060a4880181905260c09a88019a8b52885160c48901528851939099169963907dff97999497959692959194939092839260e40191908a0190808383885b838110156122a657818101518382015260200161228e565b50505050905090810190601f1680156122d35780820380516001836020036101000a031916815260200191505b50975050505050505050600060405180830381600087803b1580156122f757600080fd5b505af1158015611680573d6000803e3d6000fd5b6123136127c3565b600e54604080517f059c29ec000000000000000000000000000000000000000000000000000000008152600160a060020a03868116600483015260248201939093529051929091169163059c29ec916044808201926020929091908290030181600087803b15801561238457600080fd5b505af1158015612398573d6000803e3d6000fd5b505050506040513d60208110156123ae57600080fd5b50511561242b576040805160e560020a62461bcd02815260206004820152602560248201527f43616e6e6f74207472616e7366657220647572696e672077616974696e67207060448201527f6572696f64000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b806124358361204f565b10156124b1576040805160e560020a62461bcd02815260206004820152602f60248201527f496e73756666696369656e742062616c616e636520616674657220616e79207360448201527f6574746c656d656e74206f77696e670000000000000000000000000000000000606482015290519081900360840190fd5b6124b9612ff0565b600160a060020a03166342a28e21600e546040518263ffffffff1660e060020a028152600401808260001916600019168152602001915050600060405180830381600087803b15801561250b57600080fd5b505af11580156112b1573d6000803e3d6000fd5b600754600654604080517fdd62ed3e000000000000000000000000000000000000000000000000000000008152600160a060020a0387811660048301529283166024820152905160009360001993169163dd62ed3e91604480830192602092919082900301818887803b15801561259557600080fd5b505af11580156125a9573d6000803e3d6000fd5b505050506040513d60208110156125bf57600080fd5b5051146126f157600754600654604080517fdd62ed3e000000000000000000000000000000000000000000000000000000008152600160a060020a038881166004830152928316602482018190529151929093169263da46098c92889291612685918891879163dd62ed3e916044808201926020929091908290030181600087803b15801561264d57600080fd5b505af1158015612661573d6000803e3d6000fd5b505050506040513d602081101561267757600080fd5b50519063ffffffff61305116565b6040805160e060020a63ffffffff8716028152600160a060020a03948516600482015292909316602483015260448201529051606480830192600092919082900301818387803b1580156126d857600080fd5b505af11580156126ec573d6000803e3d6000fd5b505050505b610c38848484612db8565b600061275d7f53796e74686574697800000000000000000000000000000000000000000000006040805190810160405280601981526020017f4d697373696e672053796e746865746978206164647265737300000000000000815250613068565b905090565b600061275d7f466565506f6f6c000000000000000000000000000000000000000000000000006040805190810160405280601781526020017f4d697373696e6720466565506f6f6c2061646472657373000000000000000000815250613068565b600061275d7f45786368616e67657200000000000000000000000000000000000000000000006040805190810160405280601981526020017f4d697373696e672045786368616e676572206164647265737300000000000000815250613068565b600061275d7f49737375657200000000000000000000000000000000000000000000000000006040805190810160405280601681526020017f4d697373696e6720497373756572206164647265737300000000000000000000815250613068565b6007546040805160e060020a6370a08231028152600160a060020a0385811660048301529151919092169163b46310f691859161292091869186916370a08231916024808201926020929091908290030181600087803b1580156128e857600080fd5b505af11580156128fc573d6000803e3d6000fd5b505050506040513d602081101561291257600080fd5b50519063ffffffff61311716565b6040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050600060405180830381600087803b15801561297257600080fd5b505af1158015612986573d6000803e3d6000fd5b5050600a5461299e925090508263ffffffff61311716565b600a556129ad60008383613130565b6129b78282613232565b5050565b6007546040805160e060020a6370a08231028152600160a060020a0385811660048301529151600093929092169163b46310f6918691612a1f91879186916370a0823191602480830192602092919082900301818c87803b15801561264d57600080fd5b6040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050600060405180830381600087803b158015612a7157600080fd5b505af1158015612a85573d6000803e3d6000fd5b5050600a54612a9d925090508363ffffffff61305116565b600a55612aac83600084613130565b612ab6838361335e565b50600192915050565b6004805460408051600160a060020a038581166020808401919091528351808403820181528385018086527f546f6b656e5374617465557064617465642861646472657373290000000000009052935192839003605a01832060e060020a63907dff97028452600160248501819052604485018290526000606486018190526084860181905260a4860181905260c0988601988952865160c48701528651949097169763907dff979791959294919384938493839260e4909201918a0190808383885b83811015612b9a578181015183820152602001612b82565b50505050905090810190601f168015612bc75780820380516001836020036101000a031916815260200191505b50975050505050505050600060405180830381600087803b158015612beb57600080fd5b505af1158015612bff573d6000803e3d6000fd5b5050505050565b600e5460009081907f73555344000000000000000000000000000000000000000000000000000000001415612c5557506006548290612c4f90600160a060020a03168583612db8565b50612d46565b612c5d6127c3565b600654600e54604080517f0a1e187d000000000000000000000000000000000000000000000000000000008152600160a060020a0393841660048201526024810192909252604482018790527f7355534400000000000000000000000000000000000000000000000000000000606483015273feefeefeefeefeefeefeefeefeefeefeefeefeef6084830152519290911691630a1e187d9160a4808201926020929091908290030181600087803b158015612d1757600080fd5b505af1158015612d2b573d6000803e3d6000fd5b505050506040513d6020811015612d4157600080fd5b505190505b612d4e612762565b600160a060020a03166322bf55ef826040518263ffffffff1660e060020a02815260040180828152602001915050600060405180830381600087803b158015612d9657600080fd5b505af1158015612daa573d6000803e3d6000fd5b506001979650505050505050565b6000600160a060020a03831615801590612ddb5750600160a060020a0383163014155b8015612df55750600454600160a060020a03848116911614155b1515612e4b576040805160e560020a62461bcd02815260206004820152601f60248201527f43616e6e6f74207472616e7366657220746f2074686973206164647265737300604482015290519081900360640190fd5b6007546040805160e060020a6370a08231028152600160a060020a0387811660048301529151919092169163b46310f6918791612eae91879186916370a08231916024808201926020929091908290030181600087803b15801561264d57600080fd5b6040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050600060405180830381600087803b158015612f0057600080fd5b505af1158015612f14573d6000803e3d6000fd5b50506007546040805160e060020a6370a08231028152600160a060020a038881166004830152915191909216935063b46310f692508691612f7b91879186916370a08231916024808201926020929091908290030181600087803b1580156128e857600080fd5b6040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050600060405180830381600087803b158015612fcd57600080fd5b505af1158015612fe1573d6000803e3d6000fd5b5050505061094a848484613130565b600061275d7f53797374656d53746174757300000000000000000000000000000000000000006040805190810160405280601c81526020017f4d697373696e672053797374656d537461747573206164647265737300000000815250613068565b6000808383111561306157600080fd5b5050900390565b6000828152600c6020526040812054600160a060020a03168281151561310f5760405160e560020a62461bcd0281526004018080602001828103825283818151815260200191508051906020019080838360005b838110156130d45781810151838201526020016130bc565b50505050905090810190601f1680156131015780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b509392505050565b60008282018381101561312957600080fd5b9392505050565b600480546040805160208082018690528251808303820181528284018085527f5472616e7366657228616464726573732c616464726573732c75696e7432353690527f29000000000000000000000000000000000000000000000000000000000000006060840152925191829003606101822060e060020a63907dff9702835260036024840181905260448401829052600160a060020a038a8116606486018190528a821660848701819052600060a4880181905260c09a88019a8b52885160c48901528851939099169963907dff97999497959692959194939092839260e40191908a019080838388838110156122a657818101518382015260200161228e565b600480546040805160208082018690528251808303820181528284018085527f49737375656428616464726573732c75696e74323536290000000000000000009052925191829003605701822060e060020a63907dff9702835260026024840181905260448401829052600160a060020a038981166064860181905260006084870181905260a4870181905260c0998701998a52875160c48801528751929098169863907dff979893969495919484939192839260e490920191908a0190808383885b8381101561330d5781810151838201526020016132f5565b50505050905090810190601f16801561333a5780820380516001836020036101000a031916815260200191505b50975050505050505050600060405180830381600087803b15801561250b57600080fd5b600480546040805160208082018690528251808303820181528284018085527f4275726e656428616464726573732c75696e74323536290000000000000000009052925191829003605701822060e060020a63907dff9702835260026024840181905260448401829052600160a060020a038981166064860181905260006084870181905260a4870181905260c0998701998a52875160c48801528751929098169863907dff979893969495919484939192839260e490920191908a0190808383888381101561330d5781810151838201526020016132f5565b61030060405190810160405280601890602082028038833950919291505056004f6e6c792074686520636f6e7472616374206f776e6572206d617920706572666f726d207468697320616374696f6e0000000000000000000000000000000000a165627a7a723058205c4347e5c25a66a1a7efd5b69593e7e517cc131b0199f0d31c957c791e38e0a80029000000000000000000000000ddefe42790f2dec7b0c37d4399884efcea5361b1000000000000000000000000686cbd15bbc680f8261c7502c360aa44a2593de600000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000b64ff7a4a33acdf48d97dab0d764afd0f617688273555344000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000617d2af7b7f3f20aa30f8000000000000000000000000a1d03f7bd3e298dfa9eed24b9028777ec1965b3a000000000000000000000000000000000000000000000000000000000000000a53796e746820735553440000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000047355534400000000000000000000000000000000000000000000000000000000

Library Used

SafeDecimalMath : 0x34a5ef81d18f3a305ae9c2d7df42beef4c79031c

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