Assessment reports>Beefy Wrapper>Threat Model>unwrap

Function: unwrap(uint256 amount)

This function can be used to unwrap a given amount of wrapped tokens in exchange for the original Beefy tokens.

Inputs

  • amount

    • Control: Arbitrary.

    • Constraints: None directly (user balance must be sufficient).

    • Impact: Amount of tokens to be unwrapped.

Branches and code coverage (including function calls)

Intended branches

  • Burns the specified amount of wrapped tokens and transfers the corresponding amount of vault tokens to the caller.

Negative behavior

  • Reverts if the user balance is insufficient.

  • Reverts if the transfer of unwrapped tokens fails.

Function call analysis

  • rootFunction -> _burn(msg.sender, amount)

    • What is controllable? amount.

    • If return value controllable, how is it used and how can it go wrong? Not used.

    • What happens if it reverts, reenters, or does other unusual control flow? Reverts bubble up; reentrancy is not possible.

  • rootFunction -> IERC20Upgradeable(vault).safeTransfer(msg.sender, amount)

    • What is controllable? amount.

    • If return value controllable, how is it used and how can it go wrong? Not controllable.

    • What happens if it reverts, reenters, or does other unusual control flow? Reverts bubble up (even though they should not be possible); reentrancy is not possible (vault is considered trusted).

Zellic © 2024Back to top ↑