Function: withdraw(uint256 amount, bool claim, bool lock)
Allows the caller to withdraw staking funds and claim reward.
Inputs
amount
Control: Controlled.
Constraints: Cannot be more than
_balances[msg.sender]
.Impact: The amount of
stakingToken
will be withdrawn.
claim
Control: Controlled.
Constraints: N/A.
Impact: If claim is true and lock is false, the reward will be transferred to the
msg.sender
.
lock
Control: Controlled.
Constraints: N/A.
Impact: If claim is true and lock is true.
Branches and code coverage (including function calls)
Intended branches
Withdraw amount without claim reward.
Withdraw amount with claim reward.
Withdraw amount with lock reward.
Negative behavior
Amount is zero.
The amount is more than
_balances[msg.sender]
.
Function call analysis
stakingToken.safeTransfer(msg.sender, amount)
External/internal? External.
Argument control? Amount cannot be more than
_balances[msg.sender]
.Impact Transfer
stakingToken
tomsg.sender
.