Function: redeem(address receiver, address _owner, RedeemParams redeemParams, byte[] redeemParamsSignature)

This redeems strategy shares and exit position.

Inputs

  • receiver

    • Control: Full.

    • Constraints: None.

    • Impact: The receiver of the underlying assets.

  • _owner

    • Control: Full.

    • Constraints: None.

    • Impact: The owner of the shares (the person whose shares will be burned).

  • redeemParams

    • Control: Full.

    • Constraints: None.

    • Impact: The params used in the redeem (the swap payload, how much to repay back in the borrow pool, amount to flash loan to pay that back).

  • redeemParamsSignature

    • Control: Full.

    • Constraints: Must be signed by _signatureVerificationSigner.

    • Impact: The signature approved by Definitive, allowing the redeem.

Branches and code coverage (including function calls)

Intended branches

  • The flash loan is used to close a looped/leveraged position in a borrowed pool (the borrowed asset is paid back).

  • Shares are burned.

Negative behavior

  • Cannot transfer more than transfer limit.

  • Cannot execute tx past deadline.

  • Cannot execute with a non-Definitve signature.

  • Cannot execute in Safe Harbor Mode.

Function call analysis

  • ILLSDStrategy(VAULT).STAKED_TOKEN():

    • What is controllable? Nothing.

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

    • If return value is controllable, how is it used and how can it go wrong: Staked token.

  • ILLSDStrategy(VAULT).STAKING_TOKEN():

    • What is controllable? Nothing.

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

    • If return value is controllable, how is it used and how can it go wrong: Staking token.

  • tokensRemoved.addresses[i].balanceOf((VAULT)):

    • What is controllable? tokensRemoved.

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

    • If return value is controllable, how is it used and how can it go wrong: Calculating balances to calculate total return.

  • totalAssets()

    • What is controllable? Nothing.

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

    • If return value is controllable, how is it used and how can it go wrong: Used for calculating asset diff.

  • ILLSDStrategy(VAULT).exit(redeemParams.exitCtx...)

    • What is controllable? Everything.

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

    • If return value is controllable, how is it used and how can it go wrong: Discarded.

  • tokensRemoved.addresses[i].balanceOf((VAULT)):

    • What is controllable? tokensRemoved.

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

    • If return value is controllable, how is it used and how can it go wrong: Calculating balances to calculate total return.

  • _spendAllowance(owner, _msgSender(), redeemParams.shares)

    • What is controllable? owner and redeemParams.shares.

    • What happens if it reverts, reenters, or does other unusual control flow? Reverts mean that the spender does not have enough allowance.

    • If return value is controllable, how is it used and how can it go wrong: Discarded.

  • _burn(_owner, redeemParams.shares)

    • What is controllable? owner and redeemParams.shares.

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

    • If return value is controllable, how is it used and how can it go wrong: Discarded.

  • _burn(_owner, redeemParams.shares)

    • What is controllable? owner and redeemParams.shares.

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

    • If return value is controllable, how is it used and how can it go wrong: Discarded.

  • _withdrawAndTransfer(receiver, tokensRemoved)

    • What is controllable? receiver.

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

    • If return value is controllable, how is it used and how can it go wrong: Discarded.

  • totalAssets()

    • What is controllable? Nothing.

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

    • If return value is controllable, how is it used and how can it go wrong: Used for calculating asset diff.

Zellic © 2024Back to top ↑