WildcatMarketWithdrawals.sol
Last updated
Last updated
The WildcatMarketWithdrawals
is the withdrawal-related logic contract containing function to handle withdrawal queueing, processing, executing, and viewing.
Gets the unpaid, expired withdrawals.
Reverts if:
the reentrancy lock is engaged.
Gets a withdrawal for a given expiry based on the .
Reverts if:
the reentrancy lock is engaged.
Gets an account's withdrawal status for a given expiry.
Reverts if:
the reentrancy lock is engaged.
Reverts if:
the reentrancy lock is engaged.
the expiry is greater than the current timestamp.
Queues a withdrawal.
Procedures:
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 scaled amount is zero.
Logs:
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
Reverts if:
the reentrancy lock is engaged.
the expiry is greater than the current timestamp.
Logs:
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:
Gets the amount available for an account to withdrawal for a given expiry based on the .
Scale the amount by the
the caller's vault tokens to the vault
the caller's is less than the amount.
Return the amount scaled by the