Assessment reports>Staking>Threat Model>unstakeEsGs

Function: unstakeEsGs(uint256 _amount)

Allows msg.sender to unstake esGs.

Inputs

  • _amount

    • Control: Fully controlled by handler.

    • Constraints: None.

    • Impact: Amount to be unstaked.

Branches and code coverage (including function calls)

Intended branches

  • Allows msg.sender to unstake esGs.

  • All underlying unstake functions are called (feeTracker, bonusTracker, and rewardTracker).

  • If shouldReduceBnGs is true, should increase the amount of bnGs staked by msg.sender.

  • Assumes all other relevant checks are performed in IRewardTracker.unstakeForAccount, IRewardTracker.claimForAccount, and IRestrictedToken.burn.

Negative behavior

  • Should not allow unstaking more than the staked amount.

  • Should not allow unstaking zero amount.

Zellic © 2024Back to top ↑