WildcatMarketWithdrawals.sol
The WildcatMarketWithdrawals
is the withdrawal-related logic contract containing function to handle withdrawal queueing, processing, executing, and viewing.
getUnpaidBatchExpiries
Gets the unpaid, expired withdrawals.
Reverts if:
the reentrancy lock is engaged.
getWithdrawalBatch
Gets a withdrawal for a given expiry based on the current state.
Reverts if:
the reentrancy lock is engaged.
getAccountWithdrawalStatus
Gets an account's withdrawal status for a given expiry.
Reverts if:
the reentrancy lock is engaged.
getAvailableWithdrawalAmount
Gets the amount available for an account to withdrawal for a given expiry based on the current state.
Reverts if:
the reentrancy lock is engaged.
the expiry is greater than the current timestamp.
queueWithdrawal
Queues a withdrawal.
Procedures:
Scale the amount by the scale factor
Transfer the caller's vault tokens to the vault
If there is a pending withdrawal batch:
Queue the withdrawal
Otherwise:
Create a new withdrawal batch
Queue the withdrawal
If the pool contains enough liquidity to cover the withdrawal:
Process withdrawal payment
Otherwise:
Process as much of the withdrawal as possible and leave the rest to the queue
Reverts if:
the reentrancy lock is engaged.
the caller is blacklisted.
the caller is not authorized to withdraw.
the caller's balance is less than the amount.
the scaled amount is zero.
Logs:
executeWithdrawal
Executes a withdrawal for an account with a given expiry.
Procedures:
Update the withdrawal queue
Update the account status
Transfers the underlying asset to the account
Return the amount scaled by the scale factor
Reverts if:
the reentrancy lock is engaged.
the expiry is greater than the current timestamp.
Logs:
processUnpaidWithdrawalBatch
Processes the first unpaid withdrawal batch in the queue.
Procedures:
Apply withdrawal batch payment
Remove the batch if fully paid
Reverts if:
the reentrancy lock is engaged.
the withdrawal batch queue is empty.
Logs:
Last updated