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
unStakeAmountControl: Fully controlled by the caller.
Constraints: Must be greater than zero.
Impact: Amount of unstake.
Branches and code coverage
Intended branches
Check if
unStakeAmountis greater than zero.Check if
stakedTimeshas not reachedSTAKING_LIMIT.Check if
unStakeAmountis less than the caller's balance.Subtract
balanceOfandtotalSupplyas much asunStakeAmount.Push vesting request that contains start time, end time, and
unStakeAmount.
Negative behavior
The
unStakeAmountis less than zero.stakedTimeshas reachedSTAKING_LIMIT.The
unStakeAmountis greater than the caller's balance.