ExchangeSettlementLib¶
Description¶
Source: contracts/ExchangeSettlementLib.sol
Structs¶
ResolvedAddresses
¶
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
¶
Details
Signature
hasWaitingPeriodOrSettlementOwing(struct ExchangeSettlementLib.ResolvedAddresses resolvedAddresses, address account, bytes32 currencyKey, uint256 waitingPeriod) view returns (bool)
Visibility
external
State Mutability
view
maxSecsLeftInWaitingPeriod
¶
Details
Signature
maxSecsLeftInWaitingPeriod(contract IExchangeState exchangeState, address account, bytes32 currencyKey, uint256 waitingPeriod) view returns (uint256)
Visibility
public
State Mutability
view
settlementOwing
¶
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
¶
Details
Signature
_deductFeesFromAmount(uint256 destinationAmount, uint256 exchangeFeeRate) pure returns (uint256 amountReceived)
Visibility
internal
State Mutability
pure
_getExchangeEntry
¶
Details
Signature
_getExchangeEntry(contract IExchangeState exchangeState, address account, bytes32 currencyKey, uint256 index) view returns (struct IExchangeState.ExchangeEntry)
Visibility
internal
State Mutability
view
_getRoundIdsAtPeriodEnd
¶
Details
Signature
_getRoundIdsAtPeriodEnd(contract IExchangeRates exRates, struct IExchangeState.ExchangeEntry exchangeEntry, uint256 waitingPeriod) view returns (uint256 srcRoundIdAtPeriodEnd, uint256 destRoundIdAtPeriodEnd)
Visibility
internal
State Mutability
view
_reclaim
¶
Details
Signature
_reclaim(struct ExchangeSettlementLib.ResolvedAddresses resolvedAddresses, address from, bytes32 currencyKey, uint256 amount)
Visibility
internal
State Mutability
``
_refund
¶
Details
Signature
_refund(struct ExchangeSettlementLib.ResolvedAddresses resolvedAddresses, address from, bytes32 currencyKey, uint256 amount)
Visibility
internal
State Mutability
``
_secsLeftInWaitingPeriodForExchange
¶
Details
Signature
_secsLeftInWaitingPeriodForExchange(uint256 timestamp, uint256 waitingPeriod) view returns (uint256)
Visibility
internal
State Mutability
view
_settlementOwing
¶
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
¶
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
¶
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
¶
Signature: ExchangeEntryAppended(address account, bytes32 src, uint256 amount, bytes32 dest, uint256 amountReceived, uint256 exchangeFeeRate, uint256 roundIdForSrc, uint256 roundIdForDest)
ExchangeEntrySettled
¶
Signature: ExchangeEntrySettled(address from, bytes32 src, uint256 amount, bytes32 dest, uint256 reclaim, uint256 rebate, uint256 srcRoundIdAtPeriodEnd, uint256 destRoundIdAtPeriodEnd, uint256 exchangeTimestamp)