MoCSettlement
View Source: contracts/MoCSettlement.sol
↗ Extends: MoCSettlementEvents, MoCBase, PartialExecution, Governed, IMoCSettlement ↘ Derived Contracts: MoCSettlementMock
MoCSettlement - version: 0.1.12
Structs
RedeemRequest
UserRedeemRequest
SettlementInfo
Contract Members
Constants & Variables
RedeemRequestAlter
Parameters
redeemer
address
isAddition
bool
delta
uint256
RedeemRequestProcessed
Parameters
redeemer
address
commission
uint256
amount
uint256
SettlementRedeemStableToken
Parameters
queueSize
uint256
accumCommissions
uint256
reservePrice
uint256
SettlementDeleveraging
Parameters
leverage
uint256
riskProxPrice
uint256
reservePrice
uint256
startBlockNumber
uint256
SettlementStarted
Parameters
stableTokenRedeemCount
uint256
deleveragingCount
uint256
riskProxPrice
uint256
reservePrice
uint256
SettlementCompleted
Parameters
commissionsPayed
uint256
Modifiers
withinBoundaries
Verify that the index is smaller than the length of the redeem request queue
Arguments
_index
uint256
queue position to get
isTime
Arguments
Functions
initialize
Initializes the contract
Arguments
connectorAddress
address
MoCConnector contract address
_governor
address
Governor contract address
_blockSpan
uint256
Blockspan configuration blockspan of settlement
setBlockSpan
⤿ Overridden Implementation(s): MoCSettlementMock.setBlockSpan
Set the blockspan configuration blockspan of settlement
Arguments
bSpan
uint256
setSettlementToStall
Set Settlement to be kept in finnished state after all execution is completed.
Arguments
restartSettlementState
Set Settlement state to Ready
Arguments
getRedeemRequestAt
⤾ overrides IMoCSettlement.getRedeemRequestAt
Gets the RedeemRequest at the queue index position
Returns
redeemer's address and amount he submitted
Arguments
_index
uint256
queue position to get
getBlockSpan
Gets the number of blocks the settlemnet will be allowed to run
Arguments
redeemQueueSize
⤾ overrides IMoCSettlement.redeemQueueSize
Returns the current redeem request queue's length
Arguments
isSettlementEnabled
⤾ overrides IMoCSettlement.isSettlementEnabled
Returns true if blockSpan number of blocks has pass since last execution
Arguments
isSettlementRunning
Returns true if the settlment is running
Arguments
isSettlementReady
⤾ overrides IMoCSettlement.isSettlementReady
Returns true if the settlment is ready
Arguments
nextSettlementBlock
⤾ overrides IMoCSettlement.nextSettlementBlock
Returns the next block from which settlement is possible
Arguments
docAmountToRedeem
⤾ overrides IMoCSettlement.docAmountToRedeem
returns the total amount of Docs in the redeem queue for _who
Returns
total amount of Docs in the redeem queue for _who [using mocPrecision]
Arguments
_who
address
address for which ^ is computed
addRedeemRequest
⤾ overrides IMoCSettlement.addRedeemRequest
push a new redeem request to the queue for the sender or updates the amount if the user has a redeem request
Arguments
amount
uint256
amount he is willing to redeem [using mocPrecision]
redeemer
address payable
redeemer address
clear
empty the queue
Arguments
alterRedeemRequestAmount
⤾ overrides IMoCSettlement.alterRedeemRequestAmount
Alters the redeem amount position for the redeemer
Returns
the filled amount [using mocPrecision]
Arguments
isAddition
bool
true if adding amount to redeem, false to substract.
delta
uint256
the amount to add/substract to current position [using mocPrecision]
redeemer
address
address to alter amount for
runSettlement
⤾ overrides IMoCSettlement.runSettlement
Runs settlement process in steps
Returns
The commissions collected in the executed steps
Arguments
steps
uint256
Amount of steps to run
fixTasksPointer
Create Task structures for Settlement execution
Arguments
initializeContracts
Arguments
initializeValues
Arguments
_governor
address
_blockSpan
uint256
deleveragingStepCount
Returns the amount of steps for the Deleveraging task which is the amount of active BProx addresses
Arguments
docRedemptionStepCount
Returns the amount of steps for the Doc Redemption task which is the amount of redeem requests in the queue
Arguments
initializeSettlement
Freezes state for Settlement execution
Arguments
finishSettlement
Execute final step of Settlement task group
Arguments
finishDeleveraging
Execute final step of Deleveraging task
Arguments
finishDocRedemption
Execute final step of DocRedemption task
Arguments
deleveragingStep
Individual Deleveraging step to be executed in partial execution uint256 parameter needed for PartialExecution
Arguments
uint256
docRedemptionStep
Individual DocRedemption step to be executed in partial execution
Arguments
index
uint256
Step number currently in execution
initializeTasks
Create Task structures for Settlement execution
Arguments
Last updated