Assessment reports>Stable Predeposit>Threat Model>previewRedeem

Function: previewRedeem(address user, uint256 shares)

This function is a view helper returning the amounts a user would receive for burning shares; non-KYC users receive USDC 1:1, while KYC users receive pro-rata USDT and undeployed USDC based on the KYC pool balances.

Inputs

  • user

    • Control: N/A.

    • Constraints: Reverts if shares exceed the user’s balance.

    • Impact: Determines whether the KYC or non-KYC branch is used.

  • shares

    • Control: N/A.

    • Constraints: Must not exceed the user’s balance.

    • Impact: Directly drives the computed USDC/USDT amounts.

Branches and code coverage

Intended branches

  • If the user is KYC-approved, returns (pro-rata USDT, pro-rata undeployed USDC, true).

  • Otherwise returns (0, shares, false) for the non-KYC refund path.

Negative behavior

  • Reverts when the user lacks enough shares.

Function call analysis

  • None.

Zellic © 2025Back to top ↑