Function: redeem(uint256 amount, bytes)

This function allows the InfiniCard Vault to redeem a specified amount of underlying tokens from the strategy.

Inputs

  • amount

    • Control: Controlled by the caller with INFINI_CARD_VAULT.

    • Constraints: None.

    • Impact: The amount of tokens will be redeemed from the strategy.

  • bytes

    • Control: Controlled by the caller with INFINI_CARD_VAULT.

    • Constraints: None.

    • Impact: Not used.

Branches and code coverage

Intended branches

  • Redeems when amount is within vaultPosition and sufficient shares are available.

Negative behavior

  • Reverts if the caller does not have the INFINI_CARD_VAULT role.

  • Reverts when amount exceeds vaultPosition.

  • Reverts when the contract lacks enough share tokens.

Function call analysis

  • IERC4626(shareToken).convertToShares(amount)

    • What is controllable? amount.

    • If the return value is controllable, how is it used and how can it go wrong? N/A.

    • What happens if it reverts, reenters or does other unusual control flow? N/A.

  • IERC4626(market).redeem(shouldRedeemSharesAmount, address(this), address(this))

    • What is controllable? shouldRedeemSharesAmount.

    • If the return value is controllable, how is it used and how can it go wrong? N/A.

    • What happens if it reverts, reenters or does other unusual control flow? N/A.

Zellic © 2025Back to top ↑