Function: redeem(uint256 shares, address receiver, address _owner)
This burns exactly shares from the owner and sends assets of underlying tokens to the receiver.
Inputs
shares
Control: Full.
Constraints: Cannot exceed the owner's vault-share balance.
Impact: The number of the owner's vault shares that will be burned.
receiver
Control: Full.
Constraints: Needs to be a valid, nonzero address.
Impact: Address to receive underlying tokens.
_owner
Control: Full.
Constraints: Must have an existing vault-share balance >= the shares being redeemed.
Impact: Account whose vault shares will be redeemed and burned.
Branches and code coverage (including function calls)
Intended branches
Should burn shares when redeeming with LP tokens.
Should return correct result for
previewRedeem()
.Should return total LP tokens when calling
maxRedeem()
.
Negative behavior
redeem()
should revert when in safe harbor mode.previewRedeem()
should not revert when in safe harbor mode.maxRedeem()
should not revert when in safe harbor mode.
Function call analysis
rootFunction -> maxRedeem(address)
What is controllable? N/A.
If return value 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.
rootFunction -> previewRedeem(uint256)
What is controllable? N/A.
If return value 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.