Skip to content

ExchangeSettlementLib

Description

Source: contracts/ExchangeSettlementLib.sol

Structs

ResolvedAddresses

Source

Field Type Description
exchangeState contract IExchangeState TBA
exchangeRates contract IExchangeRates TBA
circuitBreaker contract ICircuitBreaker TBA
debtCache contract IExchangerInternalDebtCache TBA
issuer contract IIssuer TBA
synthetix contract ISynthetix TBA

Views

hasWaitingPeriodOrSettlementOwing

Source

Details

Signature

hasWaitingPeriodOrSettlementOwing(struct ExchangeSettlementLib.ResolvedAddresses resolvedAddresses, address account, bytes32 currencyKey, uint256 waitingPeriod) view returns (bool)

Visibility

external

State Mutability

view

maxSecsLeftInWaitingPeriod

Source

Details

Signature

maxSecsLeftInWaitingPeriod(contract IExchangeState exchangeState, address account, bytes32 currencyKey, uint256 waitingPeriod) view returns (uint256)

Visibility

public

State Mutability

view

settlementOwing

Source

Details

Signature

settlementOwing(struct ExchangeSettlementLib.ResolvedAddresses resolvedAddresses, address account, bytes32 currencyKey, uint256 waitingPeriod) view returns (uint256 reclaimAmount, uint256 rebateAmount, uint256 numEntries, struct IExchanger.ExchangeEntrySettlement[])

Visibility

external

State Mutability

view

Internal Functions

_deductFeesFromAmount

Source

Details

Signature

_deductFeesFromAmount(uint256 destinationAmount, uint256 exchangeFeeRate) pure returns (uint256 amountReceived)

Visibility

internal

State Mutability

pure

_getExchangeEntry

Source

Details

Signature

_getExchangeEntry(contract IExchangeState exchangeState, address account, bytes32 currencyKey, uint256 index) view returns (struct IExchangeState.ExchangeEntry)

Visibility

internal

State Mutability

view

_getRoundIdsAtPeriodEnd

Source

Details

Signature

_getRoundIdsAtPeriodEnd(contract IExchangeRates exRates, struct IExchangeState.ExchangeEntry exchangeEntry, uint256 waitingPeriod) view returns (uint256 srcRoundIdAtPeriodEnd, uint256 destRoundIdAtPeriodEnd)

Visibility

internal

State Mutability

view

_reclaim

Source

Details

Signature

_reclaim(struct ExchangeSettlementLib.ResolvedAddresses resolvedAddresses, address from, bytes32 currencyKey, uint256 amount)

Visibility

internal

State Mutability

``

_refund

Source

Details

Signature

_refund(struct ExchangeSettlementLib.ResolvedAddresses resolvedAddresses, address from, bytes32 currencyKey, uint256 amount)

Visibility

internal

State Mutability

``

_secsLeftInWaitingPeriodForExchange

Source

Details

Signature

_secsLeftInWaitingPeriodForExchange(uint256 timestamp, uint256 waitingPeriod) view returns (uint256)

Visibility

internal

State Mutability

view

_settlementOwing

Source

Details

Signature

_settlementOwing(struct ExchangeSettlementLib.ResolvedAddresses resolvedAddresses, address account, bytes32 currencyKey, uint256 waitingPeriod) view returns (uint256 reclaimAmount, uint256 rebateAmount, uint256 numEntries, struct IExchanger.ExchangeEntrySettlement[])

Visibility

internal

State Mutability

view

External Functions

appendExchange

Source

Details

Signature

appendExchange(struct ExchangeSettlementLib.ResolvedAddresses resolvedAddresses, address account, bytes32 src, uint256 amount, bytes32 dest, uint256 amountReceived, uint256 exchangeFeeRate)

Visibility

external

State Mutability

``

Emits

internalSettle

Source

Details

Signature

internalSettle(struct ExchangeSettlementLib.ResolvedAddresses resolvedAddresses, address from, bytes32 currencyKey, bool updateCache, uint256 waitingPeriod) returns (uint256 reclaimed, uint256 refunded, uint256 numEntriesSettled)

Visibility

external

State Mutability

``

Requires

Events

ExchangeEntryAppended

Source

Signature: ExchangeEntryAppended(address account, bytes32 src, uint256 amount, bytes32 dest, uint256 amountReceived, uint256 exchangeFeeRate, uint256 roundIdForSrc, uint256 roundIdForDest)

ExchangeEntrySettled

Source

Signature: ExchangeEntrySettled(address from, bytes32 src, uint256 amount, bytes32 dest, uint256 reclaim, uint256 rebate, uint256 srcRoundIdAtPeriodEnd, uint256 destRoundIdAtPeriodEnd, uint256 exchangeTimestamp)