Assessment reports>StaFi>Threat Models>unstakeClaimTokens

Function: unstakeClaimTokens(uint256 _validator, uint256 _claimedNonce)

Allows unstaking the claim tokens.

Inputs

  • _validator

    • Control: Fully controlled by the stake manager.

    • Constraints: Will call function, so it must be a valid validator ID.

    • Impact: The validator to unstake from.

  • _claimedNonce

    • Control: Fully controlled by the stake manager.

    • Constraints: None.

    • Impact: The claimed nonce.

Branches and code coverage (including function calls)

Intended branches

  • Assure that the _claimNonce is valid. Basically ensured through unbonds_new() function call.

  • Should call unstakeClaimTokens_new on the validator share contract with the given parameters.

Negative behavior

  • Should not allow anyone other than the stake manager to call it. Ensured through onlyStakeManager.

Function call analysis

  • govStakeManager.getValidatorContract(_validator)

    • What is controllable? _validator.

    • If return value controllable, how is it used and how can it go wrong? N/A; returns the validator contract address.

    • What happens if it reverts, reenters, or does other unusual control flow? Assumed it will revert if the validator is not valid.

  • IValidatorShare(valAddress).unbonds_new(address(this), willClaimedNonce)

    • What is controllable? willClaimedNonce.

    • If return value controllable, how is it used and how can it go wrong? N/A; returns the unbond struct.

    • What happens if it reverts, reenters, or does other unusual control flow? Assumed it will revert if the nonce is not valid.

  • IValidatorShare(valAddress).unstakeClaimTokens_new(willClaimedNonce)

    • What is controllable? willClaimedNonce.

    • If return value controllable, how is it used and how can it go wrong? N/A.

    • What happens if it reverts, reenters, or does other unusual control flow? Assumed it will revert if the nonce is not valid.

Zellic © 2024Back to top ↑