Function: undelegate(uint256 _validator, uint256 _claimAmount)
Allows undelegating.
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 undelegate from.
_claimAmount
Control: Fully controlled by the stake manager.
Constraints: None.
Impact: The amount to undelegate.
Branches and code coverage (including function calls)
Intended branches
Should call
sellVoucher_new
on the validator share contract with the given parameters.The amount should be considered undelegated after the call.
Negative behavior
Should not allow anyone other than the stake manager to call it. Ensured through
onlyStakeManager
.Should not allow calling it with illegitimate parameters. Not specifically checked --- it also depends on the
ValidatorShare
's implementation.
Function call analysis
valAddress.sellVoucher_new(_claimAmount, _claimAmount)
What is controllable?
_claimAmount
.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 amount is not valid.