Function: startUnstake(uint256 unStakeAmount)
A request to add unstaking to vesting reduces only the balanceOf
and totalSupply
. The tokens are yet to be sent to the caller.
Inputs
unStakeAmount
Control: Fully controlled by the caller.
Constraints: Must be greater than zero.
Impact: Amount of unstake.
Branches and code coverage
Intended branches
Check if
unStakeAmount
is greater than zero.Check if
stakedTimes
has not reachedSTAKING_LIMIT
.Check if
unStakeAmount
is less than the caller's balance.Subtract
balanceOf
andtotalSupply
as much asunStakeAmount
.Push vesting request that contains start time, end time, and
unStakeAmount
.
Negative behavior
The
unStakeAmount
is less than zero.stakedTimes
has reachedSTAKING_LIMIT
.The
unStakeAmount
is greater than the caller's balance.