Skip to content

Issuer

Description

This contract does all the heavy lifting of issuing and burning sUSD. It's used primarily to reduce the size of the Synthetix contract

Source: contracts/Issuer.sol

Architecture

Synthetix architture graph

Details
  • FeePool: The Synthetix contract remits exchange fees as sUSD to the fee pool, and also uses it to keep track of historical issuance records for each issuer.
  • SynthetixState: This state contract stores the debt ledger and the current issuance information for synth issuers.

Variables

CONTRACT_NAME

Source

Type: bytes32

availableSynths

Source

Type: contract ISynth[]

synths

Source

Type: mapping(bytes32 => contract ISynth)

synthsByAddress

Source

Type: mapping(address => bytes32)

Constructor

constructor

Source

Details

Signature

constructor(address _owner, address _resolver)

Visibility

public

State Mutability

``

Views

allNetworksDebtInfo

Source

Details

Signature

allNetworksDebtInfo() view returns (uint256 debt, uint256 sharesSupply, bool isStale)

Visibility

public

State Mutability

view

anySynthOrSNXRateIsInvalid

Source

Details

Signature

anySynthOrSNXRateIsInvalid() view returns (bool anyRateInvalid)

Visibility

external

State Mutability

view

availableCurrencyKeys

Source

Details

Signature

availableCurrencyKeys() view returns (bytes32[])

Visibility

external

State Mutability

view

availableSynthCount

Source

Details

Signature

availableSynthCount() view returns (uint256)

Visibility

external

State Mutability

view

canBurnSynths

Source

Details

Signature

canBurnSynths(address account) view returns (bool)

Visibility

external

State Mutability

view

collateral

Source

Details

Signature

collateral(address account) view returns (uint256)

Visibility

external

State Mutability

view

collateralisationRatio

Source

Details

Signature

collateralisationRatio(address _issuer) view returns (uint256 cratio)

Visibility

external

State Mutability

view

collateralisationRatioAndAnyRatesInvalid

Source

Details

Signature

collateralisationRatioAndAnyRatesInvalid(address _issuer) view returns (uint256 cratio, bool anyRateIsInvalid)

Visibility

external

State Mutability

view

debtBalanceOf

Source

Details

Signature

debtBalanceOf(address _issuer, bytes32 currencyKey) view returns (uint256 debtBalance)

Visibility

external

State Mutability

view

getSynths

Source

Details

Signature

getSynths(bytes32[] currencyKeys) view returns (contract ISynth[])

Visibility

external

State Mutability

view

issuanceRatio

Source

Details

Signature

issuanceRatio() view returns (uint256)

Visibility

external

State Mutability

view

lastIssueEvent

Source

Details

Signature

lastIssueEvent(address account) view returns (uint256)

Visibility

external

State Mutability

view

liquidationAmounts

Source

Details

Signature

liquidationAmounts(address account, bool isSelfLiquidation) view returns (uint256 totalRedeemed, uint256 debtToRemove, uint256 escrowToLiquidate, uint256 initialDebtBalance)

Visibility

external

State Mutability

view

maxIssuableSynths

Source

Details

Signature

maxIssuableSynths(address _issuer) view returns (uint256)

Visibility

external

State Mutability

view

minimumStakeTime

Source

Type: uint256

Details

Signature

minimumStakeTime() view returns (uint256)

Visibility

external

State Mutability

view

remainingIssuableSynths

Source

Details

Signature

remainingIssuableSynths(address _issuer) view returns (uint256 maxIssuable, uint256 alreadyIssued, uint256 totalSystemDebt)

Visibility

external

State Mutability

view

resolverAddressesRequired

Source

Details

Signature

resolverAddressesRequired() view returns (bytes32[] addresses)

Visibility

public

State Mutability

view

totalIssuedSynths

Source

Details

Signature

totalIssuedSynths(bytes32 currencyKey, bool excludeOtherCollateral) view returns (uint256 totalIssued)

Visibility

external

State Mutability

view

transferableSynthetixAndAnyRateIsInvalid

Source

Details

Signature

transferableSynthetixAndAnyRateIsInvalid(address account, uint256 balance) view returns (uint256 transferable, bool anyRateIsInvalid)

Visibility

external

State Mutability

view

Restricted Functions

addSynth

Source

Details

Signature

addSynth(contract ISynth synth)

Visibility

external

State Mutability

``

Modifiers

addSynths

Source

Details

Signature

addSynths(contract ISynth[] synthsToAdd)

Visibility

external

State Mutability

``

Modifiers

burnForRedemption

Source

Details

Signature

burnForRedemption(address deprecatedSynthProxy, address account, uint256 balance)

Visibility

external

State Mutability

``

Modifiers

burnSynths

Source

Details

Signature

burnSynths(address from, uint256 amount)

Visibility

external

State Mutability

``

Modifiers

burnSynthsOnBehalf

Source

Details

Signature

burnSynthsOnBehalf(address burnForAddress, address from, uint256 amount)

Visibility

external

State Mutability

``

Requires

Modifiers

burnSynthsToTarget

Source

Details

Signature

burnSynthsToTarget(address from)

Visibility

external

State Mutability

``

Modifiers

burnSynthsToTargetOnBehalf

Source

Details

Signature

burnSynthsToTargetOnBehalf(address burnForAddress, address from)

Visibility

external

State Mutability

``

Requires

Modifiers

burnSynthsWithoutDebt

Source

Details

Signature

burnSynthsWithoutDebt(bytes32 currencyKey, address from, uint256 amount) returns (bool rateInvalid)

Visibility

external

State Mutability

``

Requires

Modifiers

issueMaxSynths

Source

Details

Signature

issueMaxSynths(address from)

Visibility

external

State Mutability

``

Modifiers

issueMaxSynthsOnBehalf

Source

Details

Signature

issueMaxSynthsOnBehalf(address issueForAddress, address from)

Visibility

external

State Mutability

``

Requires

Modifiers

issueSynths

Source

Details

Signature

issueSynths(address from, uint256 amount)

Visibility

external

State Mutability

``

Requires

Modifiers

issueSynthsOnBehalf

Source

Details

Signature

issueSynthsOnBehalf(address issueForAddress, address from, uint256 amount)

Visibility

external

State Mutability

``

Requires

Modifiers

issueSynthsWithoutDebt

Source

Details

Signature

issueSynthsWithoutDebt(bytes32 currencyKey, address to, uint256 amount) returns (bool rateInvalid)

Visibility

external

State Mutability

``

Requires

Modifiers

liquidateAccount

Source

Details

Signature

liquidateAccount(address account, bool isSelfLiquidation) returns (uint256 totalRedeemed, uint256 debtRemoved, uint256 escrowToLiquidate)

Visibility

external

State Mutability

``

Requires

Modifiers

removeSynth

Source

Details

Signature

removeSynth(bytes32 currencyKey)

Visibility

external

State Mutability

``

Modifiers

removeSynths

Source

Details

Signature

removeSynths(bytes32[] currencyKeys)

Visibility

external

State Mutability

``

Modifiers

upgradeCollateralShort

Source

Details

Signature

upgradeCollateralShort(address short, uint256 amount)

Visibility

external

State Mutability

``

Requires

Modifiers

Internal Functions

_addSynth

Source

Details

Signature

_addSynth(contract ISynth synth)

Visibility

internal

State Mutability

``

Requires

Emits

_addToDebtRegister

Source

Details

Signature

_addToDebtRegister(address from, uint256 amount)

Visibility

internal

State Mutability

``

_availableCurrencyKeysWithOptionalSNX

Source

Details

Signature

_availableCurrencyKeysWithOptionalSNX(bool withSNX) view returns (bytes32[])

Visibility

internal

State Mutability

view

_burnSynths

Source

Details

Signature

_burnSynths(address debtAccount, address burnAccount, uint256 amount, uint256 existingDebt) returns (uint256 amountBurnt)

Visibility

internal

State Mutability

``

_canBurnSynths

Source

Details

Signature

_canBurnSynths(address account) view returns (bool)

Visibility

internal

State Mutability

view

_collateral

Source

Details

Signature

_collateral(address account) view returns (uint256)

Visibility

internal

State Mutability

view

_collateralisationRatio

Source

Details

Signature

_collateralisationRatio(address _issuer) view returns (uint256, bool)

Visibility

internal

State Mutability

view

_debtBalanceOfAndTotalDebt

Source

Details

Signature

_debtBalanceOfAndTotalDebt(uint256 debtShareBalance, bytes32 currencyKey) view returns (uint256 debtBalance, uint256 totalSystemValue, bool anyRateIsInvalid)

Visibility

internal

State Mutability

view

_debtForShares

Source

Details

Signature

_debtForShares(uint256 sharesAmount) view returns (uint256)

Visibility

internal

State Mutability

view

_issueSynths

Source

Details

Signature

_issueSynths(address from, uint256 amount, bool issueMax)

Visibility

internal

State Mutability

``

Requires

_lastIssueEvent

Source

Details

Signature

_lastIssueEvent(address account) view returns (uint256)

Visibility

internal

State Mutability

view

_liquidationAmounts

Source

Details

Signature

_liquidationAmounts(address account, bool isSelfLiquidation) view returns (uint256 totalRedeemed, uint256 debtToRemove, uint256 escrowToLiquidate, uint256 debtBalance)

Visibility

internal

State Mutability

view

Requires

_maxIssuableSynths

Source

Details

Signature

_maxIssuableSynths(address _issuer) view returns (uint256, bool)

Visibility

internal

State Mutability

view

_onlySynthRedeemer

Source

Details

Signature

_onlySynthRedeemer() view

Visibility

internal

State Mutability

view

Requires

_rawDebtRatioAndUpdatedAt

Source

Details

Signature

_rawDebtRatioAndUpdatedAt() view returns (uint256, uint256)

Visibility

internal

State Mutability

view

_redeemableCollateralForTarget

Source

Details

Signature

_redeemableCollateralForTarget(address account, uint256 redeemTarget, bool isSelfLiquidation) view returns (uint256 totalRedeemed, uint256 escrowToLiquidate)

Visibility

internal

State Mutability

view

_remainingIssuableSynths

Source

Details

Signature

_remainingIssuableSynths(address _issuer) view returns (uint256 maxIssuable, uint256 alreadyIssued, uint256 totalSystemDebt, bool anyRateIsInvalid)

Visibility

internal

State Mutability

view

_removeFromDebtRegister

Source

Details

Signature

_removeFromDebtRegister(address from, uint256 debtToRemove, uint256 existingDebt)

Visibility

internal

State Mutability

``

_removeSynth

Source

Details

Signature

_removeSynth(bytes32 currencyKey)

Visibility

internal

State Mutability

``

Requires

Emits

_requireCanBurnOnBehalf

Source

Details

Signature

_requireCanBurnOnBehalf(address burnForAddress, address from) view

Visibility

internal

State Mutability

view

Requires

_requireCanIssueOnBehalf

Source

Details

Signature

_requireCanIssueOnBehalf(address issueForAddress, address from) view

Visibility

internal

State Mutability

view

Requires

_requireRatesNotInvalid

Source

Details

Signature

_requireRatesNotInvalid(bool anyRateIsInvalid) pure

Visibility

internal

State Mutability

pure

Requires

_setLastIssueEvent

Source

Details

Signature

_setLastIssueEvent(address account)

Visibility

internal

State Mutability

``

_sharesForDebt

Source

Details

Signature

_sharesForDebt(uint256 debtAmount) view returns (uint256)

Visibility

internal

State Mutability

view

_snxToUSD

Source

Details

Signature

_snxToUSD(uint256 amount, uint256 snxRate) pure returns (uint256)

Visibility

internal

State Mutability

pure

_totalIssuedSynths

Source

Details

Signature

_totalIssuedSynths(bytes32 currencyKey, bool excludeCollateral) view returns (uint256 totalIssued, bool anyRateIsInvalid)

Visibility

internal

State Mutability

view

_usdToSnx

Source

Details

Signature

_usdToSnx(uint256 amount, uint256 snxRate) pure returns (uint256)

Visibility

internal

State Mutability

pure

_verifyCircuitBreakers

Source

Details

Signature

_verifyCircuitBreakers() returns (bool)

Visibility

internal

State Mutability

``

_voluntaryBurnSynths

Source

Details

Signature

_voluntaryBurnSynths(address from, uint256 amount, bool burnToTarget)

Visibility

internal

State Mutability

``

Requires

circuitBreaker

Source

Details

Signature

circuitBreaker() view returns (contract ICircuitBreaker)

Visibility

internal

State Mutability

view

debtCache

Source

Details

Signature

debtCache() view returns (contract IIssuerInternalDebtCache)

Visibility

internal

State Mutability

view

delegateApprovals

Source

Details

Signature

delegateApprovals() view returns (contract IDelegateApprovals)

Visibility

internal

State Mutability

view

exchangeRates

Source

Details

Signature

exchangeRates() view returns (contract IExchangeRates)

Visibility

internal

State Mutability

view

exchanger

Source

Details

Signature

exchanger() view returns (contract IExchanger)

Visibility

internal

State Mutability

view

liquidator

Source

Details

Signature

liquidator() view returns (contract ILiquidator)

Visibility

internal

State Mutability

view

liquidatorRewards

Source

Details

Signature

liquidatorRewards() view returns (contract ILiquidatorRewards)

Visibility

internal

State Mutability

view

rewardEscrowV2

Source

Details

Signature

rewardEscrowV2() view returns (contract IHasBalance)

Visibility

internal

State Mutability

view

synthRedeemer

Source

Details

Signature

synthRedeemer() view returns (contract ISynthRedeemer)

Visibility

internal

State Mutability

view

synthetixDebtShare

Source

Details

Signature

synthetixDebtShare() view returns (contract ISynthetixDebtShare)

Visibility

internal

State Mutability

view

synthetixERC20

Source

Details

Signature

synthetixERC20() view returns (contract IERC20)

Visibility

internal

State Mutability

view

synthetixEscrow

Source

Details

Signature

synthetixEscrow() view returns (contract IHasBalance)

Visibility

internal

State Mutability

view

External Functions

setCurrentPeriodId

Source

Details

Signature

setCurrentPeriodId(uint128 periodId)

Visibility

external

State Mutability

``

Requires

Modifiers

onlySynthRedeemer

Source

onlySynthetix

Source

onlyTrustedMinters

Source

Events

SynthAdded

Source

Signature: SynthAdded(bytes32 currencyKey, address synth)

SynthRemoved

Source

Signature: SynthRemoved(bytes32 currencyKey, address synth)