Assessment reports>Yeet>Threat Model>startUnstake

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 reached STAKING_LIMIT.

  • Check if unStakeAmount is less than the caller's balance.

  • Subtract balanceOf and totalSupply as much as unStakeAmount.

  • Push vesting request that contains start time, end time, and unStakeAmount.

Negative behavior

  • The unStakeAmount is less than zero.

  • stakedTimes has reached STAKING_LIMIT.

  • The unStakeAmount is greater than the caller's balance.

Zellic © 2025Back to top ↑