Contract 0xdd1f277080f5150701d583d496df49caf5d66312

Contract Overview

Balance:
0 BNB
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x44bf2a3f9a7cab8db13f40592bac1697c975ed5ec7fa8d817ea6feef13e3fc9cSet Associated C...161182652022-01-23 15:04:573 days 12 hrs ago0x64ac4907b29aa25f4df91356fac4772f16a4803e IN  0xdd1f277080f5150701d583d496df49caf5d663120 BNB0.00029492
0x253569b51c2c0c58b78445778fbe3b01164a61b89b48ec25f40ade1b9af23982Set Associated C...95412772021-06-08 2:58:38233 days 28 mins ago0x64ac4907b29aa25f4df91356fac4772f16a4803e IN  0xdd1f277080f5150701d583d496df49caf5d663120 BNB0.00029492
0xf58c4c458c05192172efa488a60c83c06b519580a7f7e7f64581ed73f01732e10x6080604095412112021-06-08 2:55:20233 days 31 mins ago0x64ac4907b29aa25f4df91356fac4772f16a4803e IN  Create: SynthetixState0 BNB0.00624293
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0xcf0615f874541afe3ed2191e88784eb328af10649cb992ca6b325fe4917c33d1162023472022-01-26 13:15:3514 hrs 11 mins ago 0xbb7432025f1ad57e127b0d8cec0ebe97a53894a0 0xdd1f277080f5150701d583d496df49caf5d663120 BNB
0xe16359fdc5576fd1297dcaca85b8e8921baea96ff20143429d0d2aa73114afc6161644762022-01-25 5:38:451 day 21 hrs ago 0x95149b46eb95f0369f61702f51cddab8e6434714 0xdd1f277080f5150701d583d496df49caf5d663120 BNB
0xe16359fdc5576fd1297dcaca85b8e8921baea96ff20143429d0d2aa73114afc6161644762022-01-25 5:38:451 day 21 hrs ago 0x95149b46eb95f0369f61702f51cddab8e6434714 0xdd1f277080f5150701d583d496df49caf5d663120 BNB
0xe16359fdc5576fd1297dcaca85b8e8921baea96ff20143429d0d2aa73114afc6161644762022-01-25 5:38:451 day 21 hrs ago 0x95149b46eb95f0369f61702f51cddab8e6434714 0xdd1f277080f5150701d583d496df49caf5d663120 BNB
0xe16359fdc5576fd1297dcaca85b8e8921baea96ff20143429d0d2aa73114afc6161644762022-01-25 5:38:451 day 21 hrs ago 0xe710ed4dc3e99db7801a9efda12fab9da1c5609a 0xdd1f277080f5150701d583d496df49caf5d663120 BNB
0x3ba480d1c5f834294f5fc83cc90abd2410e48bfdde2743ad6872338150562910161622492022-01-25 3:46:551 day 23 hrs ago 0x95149b46eb95f0369f61702f51cddab8e6434714 0xdd1f277080f5150701d583d496df49caf5d663120 BNB
0x3ba480d1c5f834294f5fc83cc90abd2410e48bfdde2743ad6872338150562910161622492022-01-25 3:46:551 day 23 hrs ago 0x95149b46eb95f0369f61702f51cddab8e6434714 0xdd1f277080f5150701d583d496df49caf5d663120 BNB
0x3ba480d1c5f834294f5fc83cc90abd2410e48bfdde2743ad6872338150562910161622492022-01-25 3:46:551 day 23 hrs ago 0x95149b46eb95f0369f61702f51cddab8e6434714 0xdd1f277080f5150701d583d496df49caf5d663120 BNB
0x3ba480d1c5f834294f5fc83cc90abd2410e48bfdde2743ad6872338150562910161622492022-01-25 3:46:551 day 23 hrs ago 0xe710ed4dc3e99db7801a9efda12fab9da1c5609a 0xdd1f277080f5150701d583d496df49caf5d663120 BNB
0xc8079460ea3422aca0872420ef8ef72eab604aaf1b2bca4602ada9e2cb9221d9161610412022-01-25 2:46:222 days 40 mins ago 0x95149b46eb95f0369f61702f51cddab8e6434714 0xdd1f277080f5150701d583d496df49caf5d663120 BNB
0xc8079460ea3422aca0872420ef8ef72eab604aaf1b2bca4602ada9e2cb9221d9161610412022-01-25 2:46:222 days 40 mins ago 0x95149b46eb95f0369f61702f51cddab8e6434714 0xdd1f277080f5150701d583d496df49caf5d663120 BNB
0xc8079460ea3422aca0872420ef8ef72eab604aaf1b2bca4602ada9e2cb9221d9161610412022-01-25 2:46:222 days 40 mins ago 0x95149b46eb95f0369f61702f51cddab8e6434714 0xdd1f277080f5150701d583d496df49caf5d663120 BNB
0xc8079460ea3422aca0872420ef8ef72eab604aaf1b2bca4602ada9e2cb9221d9161610412022-01-25 2:46:222 days 40 mins ago 0x95149b46eb95f0369f61702f51cddab8e6434714 0xdd1f277080f5150701d583d496df49caf5d663120 BNB
0xc8079460ea3422aca0872420ef8ef72eab604aaf1b2bca4602ada9e2cb9221d9161610412022-01-25 2:46:222 days 40 mins ago 0x95149b46eb95f0369f61702f51cddab8e6434714 0xdd1f277080f5150701d583d496df49caf5d663120 BNB
0xc8079460ea3422aca0872420ef8ef72eab604aaf1b2bca4602ada9e2cb9221d9161610412022-01-25 2:46:222 days 40 mins ago 0x95149b46eb95f0369f61702f51cddab8e6434714 0xdd1f277080f5150701d583d496df49caf5d663120 BNB
0xc8079460ea3422aca0872420ef8ef72eab604aaf1b2bca4602ada9e2cb9221d9161610412022-01-25 2:46:222 days 40 mins ago 0x95149b46eb95f0369f61702f51cddab8e6434714 0xdd1f277080f5150701d583d496df49caf5d663120 BNB
0xc8079460ea3422aca0872420ef8ef72eab604aaf1b2bca4602ada9e2cb9221d9161610412022-01-25 2:46:222 days 40 mins ago 0x95149b46eb95f0369f61702f51cddab8e6434714 0xdd1f277080f5150701d583d496df49caf5d663120 BNB
0x3b034483e8723df5d00f39cae4431ebcfa1e34ca26179095be3b54f6873b0a3f161468822022-01-24 14:58:252 days 12 hrs ago 0x95149b46eb95f0369f61702f51cddab8e6434714 0xdd1f277080f5150701d583d496df49caf5d663120 BNB
0x3b034483e8723df5d00f39cae4431ebcfa1e34ca26179095be3b54f6873b0a3f161468822022-01-24 14:58:252 days 12 hrs ago 0x95149b46eb95f0369f61702f51cddab8e6434714 0xdd1f277080f5150701d583d496df49caf5d663120 BNB
0x3b034483e8723df5d00f39cae4431ebcfa1e34ca26179095be3b54f6873b0a3f161468822022-01-24 14:58:252 days 12 hrs ago 0x95149b46eb95f0369f61702f51cddab8e6434714 0xdd1f277080f5150701d583d496df49caf5d663120 BNB
0x3b034483e8723df5d00f39cae4431ebcfa1e34ca26179095be3b54f6873b0a3f161468822022-01-24 14:58:252 days 12 hrs ago 0x95149b46eb95f0369f61702f51cddab8e6434714 0xdd1f277080f5150701d583d496df49caf5d663120 BNB
0x3b034483e8723df5d00f39cae4431ebcfa1e34ca26179095be3b54f6873b0a3f161468822022-01-24 14:58:252 days 12 hrs ago 0x95149b46eb95f0369f61702f51cddab8e6434714 0xdd1f277080f5150701d583d496df49caf5d663120 BNB
0x3b034483e8723df5d00f39cae4431ebcfa1e34ca26179095be3b54f6873b0a3f161468822022-01-24 14:58:252 days 12 hrs ago 0x95149b46eb95f0369f61702f51cddab8e6434714 0xdd1f277080f5150701d583d496df49caf5d663120 BNB
0x3b034483e8723df5d00f39cae4431ebcfa1e34ca26179095be3b54f6873b0a3f161468822022-01-24 14:58:252 days 12 hrs ago 0x95149b46eb95f0369f61702f51cddab8e6434714 0xdd1f277080f5150701d583d496df49caf5d663120 BNB
0x3b034483e8723df5d00f39cae4431ebcfa1e34ca26179095be3b54f6873b0a3f161468822022-01-24 14:58:252 days 12 hrs ago 0x95149b46eb95f0369f61702f51cddab8e6434714 0xdd1f277080f5150701d583d496df49caf5d663120 BNB
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
SynthetixState

Compiler Version
v0.5.16+commit.9c3226ce

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, None license

Contract Source Code (Solidity)

/**
 *Submitted for verification at BscScan.com on 2021-07-09
*/

/*

██╗  ██╗  ██████╗  ██████╗  ██╗ ███████╗  ██████╗  ███╗   ██╗
██║  ██║ ██╔═══██╗ ██╔══██╗ ██║ ╚══███╔╝ ██╔═══██╗ ████╗  ██║
███████║ ██║   ██║ ██████╔╝ ██║   ███╔╝  ██║   ██║ ██╔██╗ ██║
██╔══██║ ██║   ██║ ██╔══██╗ ██║  ███╔╝   ██║   ██║ ██║╚██╗██║
██║  ██║ ╚██████╔╝ ██║  ██║ ██║ ███████╗ ╚██████╔╝ ██║ ╚████║
╚═╝  ╚═╝  ╚═════╝  ╚═╝  ╚═╝ ╚═╝ ╚══════╝  ╚═════╝  ╚═╝  ╚═══╝

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



pragma solidity ^0.5.16;


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

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

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

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

    modifier onlyOwner {
        _onlyOwner();
        _;
    }

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

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


// Inheritance


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

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

        associatedContract = _associatedContract;
        emit AssociatedContractUpdated(_associatedContract);
    }

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

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

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

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

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

    event AssociatedContractUpdated(address associatedContract);
}


// https://docs.synthetix.io/contracts/source/contracts/limitedsetup
contract LimitedSetup {
    uint public setupExpiryTime;

    /**
     * @dev LimitedSetup Constructor.
     * @param setupDuration The time the setup period will last for.
     */
    constructor(uint setupDuration) internal {
        setupExpiryTime = now + setupDuration;
    }

    modifier onlyDuringSetup {
        require(now < setupExpiryTime, "Can only perform this action during setup");
        _;
    }
}


// https://docs.synthetix.io/contracts/source/interfaces/isynthetixstate
interface ISynthetixState {
    // Views
    function debtLedger(uint index) external view returns (uint);

    function issuanceData(address account) external view returns (uint initialDebtOwnership, uint debtEntryIndex);

    function debtLedgerLength() external view returns (uint);

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

    function lastDebtLedgerEntry() external view returns (uint);

    // Mutative functions
    function incrementTotalIssuerCount() external;

    function decrementTotalIssuerCount() external;

    function setCurrentIssuanceData(address account, uint initialDebtOwnership) external;

    function appendDebtLedgerValue(uint value) external;

    function clearIssuanceData(address account) external;
}


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

        return c;
    }

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

        return c;
    }

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

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

        return c;
    }

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

        return c;
    }

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


// Libraries


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

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

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

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

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

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

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

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

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

        return quotientTimesTen / 10;
    }

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

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

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

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

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

        return resultTimesTen / 10;
    }

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

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

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

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

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

        return quotientTimesTen / 10;
    }
}


// Inheritance


// Libraries


// https://docs.synthetix.io/contracts/source/contracts/synthetixstate
contract SynthetixState is Owned, State, LimitedSetup, ISynthetixState {
    using SafeMath for uint;
    using SafeDecimalMath for uint;

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

    // Issued synth balances for individual fee entitlements and exit price calculations
    mapping(address => IssuanceData) public issuanceData;

    // The total count of people that have outstanding issued synths in any flavour
    uint public totalIssuerCount;

    // Global debt pool tracking
    uint[] public debtLedger;

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

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

    /**
     * @notice Set issuance data for an address
     * @dev Only the associated contract may call this.
     * @param account The address to set the data for.
     * @param initialDebtOwnership The initial debt ownership for this address.
     */
    function setCurrentIssuanceData(address account, uint initialDebtOwnership) external onlyAssociatedContract {
        issuanceData[account].initialDebtOwnership = initialDebtOwnership;
        issuanceData[account].debtEntryIndex = debtLedger.length;
    }

    /**
     * @notice Clear issuance data for an address
     * @dev Only the associated contract may call this.
     * @param account The address to clear the data for.
     */
    function clearIssuanceData(address account) external onlyAssociatedContract {
        delete issuanceData[account];
    }

    /**
     * @notice Increment the total issuer count
     * @dev Only the associated contract may call this.
     */
    function incrementTotalIssuerCount() external onlyAssociatedContract {
        totalIssuerCount = totalIssuerCount.add(1);
    }

    /**
     * @notice Decrement the total issuer count
     * @dev Only the associated contract may call this.
     */
    function decrementTotalIssuerCount() external onlyAssociatedContract {
        totalIssuerCount = totalIssuerCount.sub(1);
    }

    /**
     * @notice Append a value to the debt ledger
     * @dev Only the associated contract may call this.
     * @param value The new value to be added to the debt ledger.
     */
    function appendDebtLedgerValue(uint value) external onlyAssociatedContract {
        debtLedger.push(value);
    }

    // /**
    //  * @notice Import issuer data from the old Synthetix contract before multicurrency
    //  * @dev Only callable by the contract owner, and only for 1 week after deployment.
    //  */
    // function importIssuerData(address[] accounts, uint[] zUSDAmounts) external onlyOwner onlyDuringSetup {
    //     require(accounts.length == zUSDAmounts.length, "Length mismatch");

    //     for (uint8 i = 0; i < accounts.length; i++) {
    //         _addToDebtRegister(accounts[i], zUSDAmounts[i]);
    //     }
    // }

    // /**
    //  * @notice Import issuer data from the old Synthetix contract before multicurrency
    //  * @dev Only used from importIssuerData above, meant to be disposable
    //  */
    // function _addToDebtRegister(address account, uint amount) internal {
    //     // Note: this function's implementation has been removed from the current Synthetix codebase
    //     // as it could only habe been invoked during setup (see importIssuerData) which has since expired.
    //     // There have been changes to the functions it requires, so to ensure compiles, the below has been removed.
    //     // For the previous implementation, see Synthetix._addToDebtRegister()
    // }

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

    /**
     * @notice Retrieve the length of the debt ledger array
     */
    function debtLedgerLength() external view returns (uint) {
        return debtLedger.length;
    }

    /**
     * @notice Retrieve the most recent entry from the debt ledger
     */
    function lastDebtLedgerEntry() external view returns (uint) {
        return debtLedger[debtLedger.length - 1];
    }

    /**
     * @notice Query whether an account has issued and has an outstanding debt balance
     * @param account The address to query for
     */
    function hasIssued(address account) external view returns (bool) {
        return issuanceData[account].initialDebtOwnership > 0;
    }
}

Contract ABI

[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_associatedContract","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"associatedContract","type":"address"}],"name":"AssociatedContractUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldOwner","type":"address"},{"indexed":false,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerNominated","type":"event"},{"constant":false,"inputs":[],"name":"acceptOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"value","type":"uint256"}],"name":"appendDebtLedgerValue","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"associatedContract","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"clearIssuanceData","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"debtLedger","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"debtLedgerLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"decrementTotalIssuerCount","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"hasIssued","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"incrementTotalIssuerCount","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"issuanceData","outputs":[{"internalType":"uint256","name":"initialDebtOwnership","type":"uint256"},{"internalType":"uint256","name":"debtEntryIndex","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"lastDebtLedgerEntry","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"nominateNewOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"nominatedOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_associatedContract","type":"address"}],"name":"setAssociatedContract","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"initialDebtOwnership","type":"uint256"}],"name":"setCurrentIssuanceData","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"setupExpiryTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalIssuerCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b50604051610ab4380380610ab48339818101604052604081101561003357600080fd5b50805160209091015162093a8081836001600160a01b03811661009d576040805162461bcd60e51b815260206004820152601960248201527f4f776e657220616464726573732063616e6e6f74206265203000000000000000604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b038316908117825560408051928352602083019190915280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a1506000546001600160a01b0316610147576040805162461bcd60e51b815260206004820152601160248201527013dddb995c881b5d5cdd081899481cd95d607a1b604482015290519081900360640190fd5b600280546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f73f20cff579e8a4086fa607db83867595f1b6a798e718c0bfa0b94a404128e039181900360200190a15042016003555050610905806101af6000396000f3fe608060405234801561001057600080fd5b50600436106101165760003560e01c80638b3f8088116100a2578063aefc4ccb11610071578063aefc4ccb14610274578063b16c09f01461027c578063b992812e146102a2578063ba08f299146102dc578063cd92eba9146102e457610116565b80638b3f8088146101f95780638da5cb5b146102385780639371bede14610240578063a764eb451461024857610116565b806346317712116100e9578063463177121461019757806346ba2d901461019f57806352f445ca146101a757806353a47bb7146101cd57806379ba5097146101f157610116565b806308d95cd51461011b5780631627540c1461014a5780631bfba595146101725780633d31e97b1461017a575b600080fd5b6101386004803603602081101561013157600080fd5b50356102ec565b60408051918252519081900360200190f35b6101706004803603602081101561016057600080fd5b50356001600160a01b031661030a565b005b610170610366565b6101706004803603602081101561019057600080fd5b50356103c8565b610138610446565b61013861046c565b610170600480360360208110156101bd57600080fd5b50356001600160a01b0316610472565b6101d56104ce565b604080516001600160a01b039092168252519081900360200190f35b6101706104dd565b61021f6004803603602081101561020f57600080fd5b50356001600160a01b0316610599565b6040805192835260208301919091528051918290030190f35b6101d56105b2565b6101386105c1565b6101706004803603604081101561025e57600080fd5b506001600160a01b0381351690602001356105c7565b6101d5610637565b6101706004803603602081101561029257600080fd5b50356001600160a01b0316610646565b6102c8600480360360208110156102b857600080fd5b50356001600160a01b03166106af565b604080519115158252519081900360200190f35b6101706106cc565b610138610729565b600681815481106102f957fe5b600091825260209091200154905081565b61031261072f565b600180546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce229181900360200190a150565b6002546001600160a01b031633146103af5760405162461bcd60e51b815260040180806020018281038252603481526020018061089d6034913960400191505060405180910390fd5b6005546103c390600163ffffffff61077a16565b600555565b6002546001600160a01b031633146104115760405162461bcd60e51b815260040180806020018281038252603481526020018061089d6034913960400191505060405180910390fd5b600680546001810182556000919091527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f0155565b6006805460009190600019810190811061045c57fe5b9060005260206000200154905090565b60035481565b61047a61072f565b600280546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f73f20cff579e8a4086fa607db83867595f1b6a798e718c0bfa0b94a404128e039181900360200190a150565b6001546001600160a01b031681565b6001546001600160a01b031633146105265760405162461bcd60e51b81526004018080602001828103825260358152602001806108396035913960400191505060405180910390fd5b600054600154604080516001600160a01b03938416815292909116602083015280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b6004602052600090815260409020805460019091015482565b6000546001600160a01b031681565b60055481565b6002546001600160a01b031633146106105760405162461bcd60e51b815260040180806020018281038252603481526020018061089d6034913960400191505060405180910390fd5b6001600160a01b039091166000908152600460205260409020908155600654600190910155565b6002546001600160a01b031681565b6002546001600160a01b0316331461068f5760405162461bcd60e51b815260040180806020018281038252603481526020018061089d6034913960400191505060405180910390fd5b6001600160a01b0316600090815260046020526040812081815560010155565b6001600160a01b0316600090815260046020526040902054151590565b6002546001600160a01b031633146107155760405162461bcd60e51b815260040180806020018281038252603481526020018061089d6034913960400191505060405180910390fd5b6005546103c390600163ffffffff6107db16565b60065490565b6000546001600160a01b031633146107785760405162461bcd60e51b815260040180806020018281038252602f81526020018061086e602f913960400191505060405180910390fd5b565b6000828201838110156107d4576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b600082821115610832576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b5090039056fe596f75206d757374206265206e6f6d696e61746564206265666f726520796f752063616e20616363657074206f776e6572736869704f6e6c792074686520636f6e7472616374206f776e6572206d617920706572666f726d207468697320616374696f6e4f6e6c7920746865206173736f63696174656420636f6e74726163742063616e20706572666f726d207468697320616374696f6ea265627a7a72315820b6ae5ccf0fb492be55a2caa28f1b4969aeb50e8e93ce9d7ea83fbd739e37ab3264736f6c6343000510003200000000000000000000000064ac4907b29aa25f4df91356fac4772f16a4803e00000000000000000000000064ac4907b29aa25f4df91356fac4772f16a4803e

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

00000000000000000000000064ac4907b29aa25f4df91356fac4772f16a4803e00000000000000000000000064ac4907b29aa25f4df91356fac4772f16a4803e

-----Decoded View---------------
Arg [0] : _owner (address): 0x64ac4907b29aa25f4df91356fac4772f16a4803e
Arg [1] : _associatedContract (address): 0x64ac4907b29aa25f4df91356fac4772f16a4803e

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 00000000000000000000000064ac4907b29aa25f4df91356fac4772f16a4803e
Arg [1] : 00000000000000000000000064ac4907b29aa25f4df91356fac4772f16a4803e


Deployed ByteCode Sourcemap

17067:5080:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;17067:5080:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;18227:24;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;18227:24:0;;:::i;:::-;;;;;;;;;;;;;;;;2787:141;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2787:141:0;-1:-1:-1;;;;;2787:141:0;;:::i;:::-;;19448:130;;;:::i;20040:116::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;20040:116:0;;:::i;21726:119::-;;;:::i;4867:27::-;;;:::i;4236:200::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;4236:200:0;-1:-1:-1;;;;;4236:200:0;;:::i;2556:29::-;;;:::i;:::-;;;;-1:-1:-1;;;;;2556:29:0;;;;;;;;;;;;;;2936:271;;;:::i;18010:52::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;18010:52:0;-1:-1:-1;;;;;18010:52:0;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;2529:20;;;:::i;18156:28::-;;;:::i;18742:259::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;18742:259:0;;;;;;;;:::i;3774:33::-;;;:::i;19193:123::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;19193:123:0;-1:-1:-1;;;;;19193:123:0;;:::i;22007:137::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;22007:137:0;-1:-1:-1;;;;;22007:137:0;;:::i;:::-;;;;;;;;;;;;;;;;;;19710:130;;;:::i;21532:100::-;;;:::i;18227:24::-;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;18227:24:0;:::o;2787:141::-;3245:12;:10;:12::i;:::-;2859:14;:23;;-1:-1:-1;;;;;2859:23:0;;-1:-1:-1;;;;;;2859:23:0;;;;;;;;2898:22;;;;;;;;;;;;;;;;2787:141;:::o;19448:130::-;4554:18;;-1:-1:-1;;;;;4554:18:0;4540:10;:32;4532:97;;;;-1:-1:-1;;;4532:97:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;19547:16;;:23;;19568:1;19547:23;:20;:23;:::i;:::-;19528:16;:42;19448:130::o;20040:116::-;4554:18;;-1:-1:-1;;;;;4554:18:0;4540:10;:32;4532:97;;;;-1:-1:-1;;;4532:97:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;20126:10;27::-1;;39:1;23:18;;45:23;;-1:-1;20126:22:0;;;;;;;20040:116::o;21726:119::-;21804:10;21815:17;;21780:4;;21804:10;-1:-1:-1;;21815:21:0;;;21804:33;;;;;;;;;;;;;;21797:40;;21726:119;:::o;4867:27::-;;;;:::o;4236:200::-;3245:12;:10;:12::i;:::-;4326:18;:40;;-1:-1:-1;;;;;4326:40:0;;-1:-1:-1;;;;;;4326:40:0;;;;;;;;4382:46;;;;;;;;;;;;;;;;4236:200;:::o;2556:29::-;;;-1:-1:-1;;;;;2556:29:0;;:::o;2936:271::-;3005:14;;-1:-1:-1;;;;;3005:14:0;2991:10;:28;2983:94;;;;-1:-1:-1;;;2983:94:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3106:5;;;3113:14;3093:35;;;-1:-1:-1;;;;;3106:5:0;;;3093:35;;3113:14;;;;3093:35;;;;;;;;;;;;;;;;3147:14;;;;3139:22;;-1:-1:-1;;;;;;3139:22:0;;;-1:-1:-1;;;;;3147:14:0;;3139:22;;;;3172:27;;;2936:271::o;18010:52::-;;;;;;;;;;;;;;;;;;;:::o;2529:20::-;;;-1:-1:-1;;;;;2529:20:0;;:::o;18156:28::-;;;;:::o;18742:259::-;4554:18;;-1:-1:-1;;;;;4554:18:0;4540:10;:32;4532:97;;;;-1:-1:-1;;;4532:97:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;18861:21:0;;;;;;;:12;:21;;;;;:65;;;18976:10;:17;18937:36;;;;:56;18742:259::o;3774:33::-;;;-1:-1:-1;;;;;3774:33:0;;:::o;19193:123::-;4554:18;;-1:-1:-1;;;;;4554:18:0;4540:10;:32;4532:97;;;;-1:-1:-1;;;4532:97:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;19287:21:0;;;;;:12;:21;;;;;19280:28;;;;;;19193:123::o;22007:137::-;-1:-1:-1;;;;;22090:21:0;22066:4;22090:21;;;:12;:21;;;;;:42;:46;;;22007:137::o;19710:130::-;4554:18;;-1:-1:-1;;;;;4554:18:0;4540:10;:32;4532:97;;;;-1:-1:-1;;;4532:97:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;19809:16;;:23;;19830:1;19809:23;:20;:23;:::i;21532:100::-;21607:10;:17;21532:100;:::o;3285:133::-;3353:5;;-1:-1:-1;;;;;3353:5:0;3339:10;:19;3331:79;;;;-1:-1:-1;;;3331:79:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3285:133::o;6971:181::-;7029:7;7061:5;;;7085:6;;;;7077:46;;;;;-1:-1:-1;;;7077:46:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;7143:1;6971:181;-1:-1:-1;;;6971:181:0:o;7427:184::-;7485:7;7518:1;7513;:6;;7505:49;;;;;-1:-1:-1;;;7505:49:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;7577:5:0;;;7427:184::o

Swarm Source

bzzr://b6ae5ccf0fb492be55a2caa28f1b4969aeb50e8e93ce9d7ea83fbd739e37ab32
Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading