Assessment reports>GTE -- Perp>Threat Model>processWithdraws

Function: processWithdraws(uint256 num)

This function is designed to process a specified number (num) of withdrawal requests from a queue. For each withdrawal request, it converts the user's shares to assets, transfers the assets to the user, burns the user's shares, and updates the queue and related storage.

Inputs

  • num

    • Control: Controlled by the admin/owner.

    • Constraints: Must not exceed the length of the withdraw queue.

    • Impact: Determines how many withdrawal requests to process.

Branches and code coverage

Intended branches

  • Removes the withdrawals from the queuedWithdraw mapping.

  • Dequeues num withdrawal requests from _withdrawQueue.

Negative behavior

  • Reverts if called by non-admin users.

  • Reverts if num exceeds the total number of withdrawals currently in the queue.

  • Reverts if the contract lacks sufficient USDC for withdrawals.

  • Burns the user's shares for each withdrawal.

  • Transfers assets to the user for each withdrawal.

  • Emits a WithdrawProcessed event for each withdrawal.

Zellic © 2025Back to top ↑