Function: withdraw(uint256 _lpTokenAmount, uint8 _index)
Withdraws token amount.
Inputs
_lpTokenAmount
Control: Full.
Constraints:
_lpTokenAmount > 0
.Impact: Amount of tokens to be withdrawn.
_index
Control: Full.
Constraints: Needs to be inside the bounds of
underlyingTokenAddresses
.Impact: The underlying token.
Branches and code coverage (including function calls)
Intended branches
Successfully withdraws token amount.
Negative behavior
Reverts when
_lpTokenAmount
is lower than0
.Reverts when
_index
is out of bounds.
Function call analysis
withdraw -> harvestRewards()
What is controllable? Discarded.
If return value controllable, how is it used and how can it go wrong? Discarded.
What happens if it reverts, reenters, or does other unusual control flow? Discarded.
withdraw -> rewardToken.burn(msg.sender, rewardTokenBalance);
What is controllable? Discarded.
If return value controllable, how is it used and how can it go wrong? Discarded.
What happens if it reverts, reenters, or does other unusual control flow? Denotes an issue with the rewardToken contract.
withdraw -> withdrawFromDefinitive(_index, _lpTokenAmount + rewardTokenBalance)
What is controllable? Discarded.
If return value controllable, how is it used and how can it go wrong? Discarded.
What happens if it reverts, reenters, or does other unusual control flow? Denotes an issue with the definitiveVault contract.