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

undefined

Restricted Functions

addSynth

Source

Details

Signature

addSynth(contract ISynth synth)

Visibility

external

State Mutability

undefined

Modifiers

addSynths

Source

Details

Signature

addSynths(contract ISynth[] synthsToAdd)

Visibility

external

State Mutability

undefined

Modifiers

burnSynths

Source

Details

Signature

burnSynths(address from, uint256 amount)

Visibility

external

State Mutability

undefined

Modifiers

burnSynthsOnBehalf

Source

Details

Signature

burnSynthsOnBehalf(address burnForAddress, address from, uint256 amount)

Visibility

external

State Mutability

undefined

Requires

Modifiers

burnSynthsToTarget

Source

Details

Signature

burnSynthsToTarget(address from)

Visibility

external

State Mutability

undefined

Modifiers

burnSynthsToTargetOnBehalf

Source

Details

Signature

burnSynthsToTargetOnBehalf(address burnForAddress, address from)

Visibility

external

State Mutability

undefined

Requires

Modifiers

issueMaxSynths

Source

Details

Signature

issueMaxSynths(address from)

Visibility

external

State Mutability

undefined

Modifiers

issueMaxSynthsOnBehalf

Source

Details

Signature

issueMaxSynthsOnBehalf(address issueForAddress, address from)

Visibility

external

State Mutability

undefined

Requires

Modifiers

issueSynths

Source

Details

Signature

issueSynths(address from, uint256 amount)

Visibility

external

State Mutability

undefined

Modifiers

issueSynthsOnBehalf

Source

Details

Signature

issueSynthsOnBehalf(address issueForAddress, address from, uint256 amount)

Visibility

external

State Mutability

undefined

Requires

Modifiers

liquidateDelinquentAccount

Source

Details

Signature

liquidateDelinquentAccount(address account, uint256 susdAmount, address liquidator) returns (uint256 totalRedeemed, uint256 amountToLiquidate)

Visibility

external

State Mutability

undefined

Requires

Modifiers

removeSynth

Source

Details

Signature

removeSynth(bytes32 currencyKey)

Visibility

external

State Mutability

undefined

Modifiers

removeSynths

Source

Details

Signature

removeSynths(bytes32[] currencyKeys)

Visibility

external

State Mutability

undefined

Modifiers

Internal Functions

_addSynth

Source

Details

Signature

_addSynth(contract ISynth synth)

Visibility

internal

State Mutability

undefined

Requires

Emits

_addToDebtRegister

Source

Details

Signature

_addToDebtRegister(address from, uint256 amount, uint256 existingDebt, uint256 totalDebtIssued)

Visibility

internal

State Mutability

undefined

_appendAccountIssuanceRecord

Source

Details

Signature

_appendAccountIssuanceRecord(address from)

Visibility

internal

State Mutability

undefined

_availableCurrencyKeysWithOptionalSNX

Source

Details

Signature

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

Visibility

internal

State Mutability

undefined

_burnSynths

Source

Details

Signature

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

Visibility

internal

State Mutability

undefined

_canBurnSynths

Source

Details

Signature

_canBurnSynths(address account) view returns (bool)

Visibility

internal

State Mutability

undefined

_collateral

Source

Details

Signature

_collateral(address account) view returns (uint256)

Visibility

internal

State Mutability

undefined

_collateralisationRatio

Source

Details

Signature

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

Visibility

internal

State Mutability

undefined

_debtBalanceOfAndTotalDebt

Source

Details

Signature

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

Visibility

internal

State Mutability

undefined

_issueSynths

Source

Details

Signature

_issueSynths(address from, uint256 amount, bool issueMax)

Visibility

internal

State Mutability

undefined

Requires

_lastIssueEvent

Source

Details

Signature

_lastIssueEvent(address account) view returns (uint256)

Visibility

internal

State Mutability

undefined

_maxIssuableSynths

Source

Details

Signature

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

Visibility

internal

State Mutability

undefined

_onlySynthetix

Source

Details

Signature

_onlySynthetix() view

Visibility

internal

State Mutability

undefined

Requires

_remainingIssuableSynths

Source

Details

Signature

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

Visibility

internal

State Mutability

undefined

_removeFromDebtRegister

Source

Details

Signature

_removeFromDebtRegister(address from, uint256 debtToRemove, uint256 existingDebt, uint256 totalDebtIssued)

Visibility

internal

State Mutability

undefined

_removeSynth

Source

Details

Signature

_removeSynth(bytes32 currencyKey)

Visibility

internal

State Mutability

undefined

Requires

Emits

_requireCanBurnOnBehalf

Source

Details

Signature

_requireCanBurnOnBehalf(address burnForAddress, address from) view

Visibility

internal

State Mutability

undefined

Requires

_requireCanIssueOnBehalf

Source

Details

Signature

_requireCanIssueOnBehalf(address issueForAddress, address from) view

Visibility

internal

State Mutability

undefined

Requires

_requireRatesNotInvalid

Source

Details

Signature

_requireRatesNotInvalid(bool anyRateIsInvalid) pure

Visibility

internal

State Mutability

undefined

Requires

_setLastIssueEvent

Source

Details

Signature

_setLastIssueEvent(address account)

Visibility

internal

State Mutability

undefined

_snxToUSD

Source

Details

Signature

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

Visibility

internal

State Mutability

undefined

_totalIssuedSynths

Source

Details

Signature

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

Visibility

internal

State Mutability

undefined

_usdToSnx

Source

Details

Signature

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

Visibility

internal

State Mutability

undefined

_voluntaryBurnSynths

Source

Details

Signature

_voluntaryBurnSynths(address from, uint256 amount, bool burnToTarget)

Visibility

internal

State Mutability

undefined

Requires

collateralManager

Source

Details

Signature

collateralManager() view returns (contract ICollateralManager)

Visibility

internal

State Mutability

undefined

debtCache

Source

Details

Signature

debtCache() view returns (contract IIssuerInternalDebtCache)

Visibility

internal

State Mutability

undefined

delegateApprovals

Source

Details

Signature

delegateApprovals() view returns (contract IDelegateApprovals)

Visibility

internal

State Mutability

undefined

etherCollateral

Source

Details

Signature

etherCollateral() view returns (contract IEtherCollateral)

Visibility

internal

State Mutability

undefined

etherCollateralsUSD

Source

Details

Signature

etherCollateralsUSD() view returns (contract IEtherCollateralsUSD)

Visibility

internal

State Mutability

undefined

exchangeRates

Source

Details

Signature

exchangeRates() view returns (contract IExchangeRates)

Visibility

internal

State Mutability

undefined

exchanger

Source

Details

Signature

exchanger() view returns (contract IExchanger)

Visibility

internal

State Mutability

undefined

feePool

Source

Details

Signature

feePool() view returns (contract IFeePool)

Visibility

internal

State Mutability

undefined

liquidations

Source

Details

Signature

liquidations() view returns (contract ILiquidations)

Visibility

internal

State Mutability

undefined

rewardEscrowV2

Source

Details

Signature

rewardEscrowV2() view returns (contract IRewardEscrowV2)

Visibility

internal

State Mutability

undefined

synthetix

Source

Details

Signature

synthetix() view returns (contract ISynthetix)

Visibility

internal

State Mutability

undefined

synthetixEscrow

Source

Details

Signature

synthetixEscrow() view returns (contract IHasBalance)

Visibility

internal

State Mutability

undefined

synthetixState

Source

Details

Signature

synthetixState() view returns (contract ISynthetixState)

Visibility

internal

State Mutability

undefined

External Functions

anySynthOrSNXRateIsInvalid

Source

Details

Signature

anySynthOrSNXRateIsInvalid() view returns (bool anyRateInvalid)

Visibility

external

State Mutability

undefined

availableCurrencyKeys

Source

Details

Signature

availableCurrencyKeys() view returns (bytes32[])

Visibility

external

State Mutability

undefined

availableSynthCount

Source

Details

Signature

availableSynthCount() view returns (uint256)

Visibility

external

State Mutability

undefined

canBurnSynths

Source

Details

Signature

canBurnSynths(address account) view returns (bool)

Visibility

external

State Mutability

undefined

collateral

Source

Details

Signature

collateral(address account) view returns (uint256)

Visibility

external

State Mutability

undefined

collateralisationRatio

Source

Details

Signature

collateralisationRatio(address _issuer) view returns (uint256 cratio)

Visibility

external

State Mutability

undefined

collateralisationRatioAndAnyRatesInvalid

Source

Details

Signature

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

Visibility

external

State Mutability

undefined

debtBalanceOf

Source

Details

Signature

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

Visibility

external

State Mutability

undefined

getSynths

Source

Details

Signature

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

Visibility

external

State Mutability

undefined

issuanceRatio

Source

Details

Signature

issuanceRatio() view returns (uint256)

Visibility

external

State Mutability

undefined

lastIssueEvent

Source

Details

Signature

lastIssueEvent(address account) view returns (uint256)

Visibility

external

State Mutability

undefined

maxIssuableSynths

Source

Details

Signature

maxIssuableSynths(address _issuer) view returns (uint256)

Visibility

external

State Mutability

undefined

minimumStakeTime

Source

Type: uint256

Details

Signature

minimumStakeTime() view returns (uint256)

Visibility

external

State Mutability

undefined

remainingIssuableSynths

Source

Details

Signature

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

Visibility

external

State Mutability

undefined

resolverAddressesRequired

Source

Details

Signature

resolverAddressesRequired() view returns (bytes32[] addresses)

Visibility

public

State Mutability

undefined

totalIssuedSynths

Source

Details

Signature

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

Visibility

external

State Mutability

undefined

transferableSynthetixAndAnyRateIsInvalid

Source

Details

Signature

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

Visibility

external

State Mutability

undefined

Modifiers

onlySynthetix

Source

Events

SynthAdded

Source

Signature: SynthAdded(bytes32 currencyKey, address synth)

SynthRemoved

Source

Signature: SynthRemoved(bytes32 currencyKey, address synth)