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¶
Related Contracts¶
- Issuer as this contract's
State.associatedContract
Structs¶
IssuanceData
¶
Field | Type | Description |
---|---|---|
initialDebtOwnership |
uint256 |
TBA |
debtEntryIndex |
uint256 |
TBA |
Variables¶
debtLedger
¶
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
¶
The most recent issuance data for each address.
Type: mapping(address => struct SynthetixState.IssuanceData)
totalIssuerCount
¶
The number of people with outstanding synths.
Type: uint256
Constructor¶
constructor
¶
Initialises the inherited State
and LimitedSetup
instances.
Details
Signature
constructor(address _owner, address _associatedContract)
Visibility
public
State Mutability
``
Views¶
debtLedgerLength
¶
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
¶
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
¶
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
¶
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
¶
Deletes the issuance data associated with a given account.
Details
Signature
clearIssuanceData(address account)
Visibility
external
State Mutability
``
Modifiers
decrementTotalIssuerCount
¶
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
¶
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
¶
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