Assessment reports>Stable Predeposit>Threat Model>withdrawFromSpark

Function: withdrawFromSpark(uint256 amount)

This function is an admin-only exit path used in Unwind mode to redeem USDT from SparkLend. The caller can withdraw a specific amount or all the available balance if amount == 0.

Inputs

  • amount

    • Control: N/A.

    • Constraints: Accepts 0 for a full sweep or any value up to the on-contract aToken balance.

    • Impact: Updates usdtRedeemed and instructs the Spark pool to return liquidity to the vault contract.

Branches and code coverage

Intended branches

  • Reverts if the contract holds no spUSDT.

  • Reverts if the amount is greater than the contract's aToken balance (if not 0).

  • Increments usdtRedeemed before withdrawing from SparkLend.

Negative behavior

  • Non-admin callers or calls outside Unwind mode revert.

  • Reentrancy is blocked by nonReentrant.

Function call analysis

  • None.

Zellic © 2025Back to top ↑