Skip to content

SynthetixState

Description

This is a state contract associated with the main Synthetix contract, which is the only address permitted to invoke most of its functionality.

This contract is responsible for recording issuance and debt information for the system and users within it, as well as the global issuance ratio.

Upon system updates, this contract will continue to exist, while the Synthetix logic itself is swapped out.

Disabled: Preferred Currency Transfer Conversion

This contract also contains functionality enabling automatic preferred currency conversion on Synth transfers, but it is currently disabled.

Source: contracts/legacy/SynthetixState.sol

Architecture

  • Issuer as this contract's State.associatedContract

Structs

IssuanceData

Source

Field Type Description
initialDebtOwnership uint256 TBA
debtEntryIndex uint256 TBA

Variables

debtLedger

Source

A list of factors indicating, for each debt-modifying event, what effect it had on the percentage of debt of all other holders. Later debt ledger entries correspond to more recent issuance events.

Type: uint256[]

issuanceData

Source

The most recent issuance data for each address.

Type: mapping(address => struct SynthetixState.IssuanceData)

totalIssuerCount

Source

The number of people with outstanding synths.

Type: uint256

Constructor

constructor

Source

Initialises the inherited State and LimitedSetup instances.

Details

Signature

constructor(address _owner, address _associatedContract)

Visibility

public

State Mutability

``

Views

debtLedgerLength

Source

Returns the number of entries currently in debtLedger.

Primarily used in FeePool for fee period computations.

Details

Signature

debtLedgerLength() view returns (uint256)

Visibility

external

State Mutability

view

hasIssued

Source

Returns true if a given account has any outstanding issuance debt resulting from Synth minting.

Used in Synthetix._addToDebtRegister to determine whether an minting event requires incrementing the total issuer count.

Details

Signature

hasIssued(address account) view returns (bool)

Visibility

external

State Mutability

view

lastDebtLedgerEntry

Source

Returns the most recent debtLedger entry.

Primarily used in the Synthetix for debt computations.

Details

Signature

lastDebtLedgerEntry() view returns (uint256)

Visibility

external

State Mutability

view

Restricted Functions

appendDebtLedgerValue

Source

Pushes a new value to the end of the debtLedger.

This is used by Synthetix._addToDebtRegister contract whenever Synths are issued or burnt, which modifies the total outstanding system debt.

Details

Signature

appendDebtLedgerValue(uint256 value)

Visibility

external

State Mutability

``

Modifiers

clearIssuanceData

Source

Deletes the issuance data associated with a given account.

Details

Signature

clearIssuanceData(address account)

Visibility

external

State Mutability

``

Modifiers

decrementTotalIssuerCount

Source

Reduces totalIssuerCount by one. This is called within Synthetix._removeFromDebtRegister whenever an issuer burns enough Synths to pay down their entire outstanding debt.

Details

Signature

decrementTotalIssuerCount()

Visibility

external

State Mutability

``

Modifiers

incrementTotalIssuerCount

Source

Increases totalIssuerCount by one. This is called within Synthetix._addToDebtRegister whenever an account with no outstanding issuance debt mints new Synths.

Details

Signature

incrementTotalIssuerCount()

Visibility

external

State Mutability

``

Modifiers

setCurrentIssuanceData

Source

Allows the Synthetix contract to update the debt ownership entry for this account and sets their debt entry index to the current length of the debtLedger. The debt ledger itself is not modified.

Details

Signature

setCurrentIssuanceData(address account, uint256 initialDebtOwnership)

Visibility

external

State Mutability

``

Modifiers