Assessment reports>StaFi>Threat Models>delegate

Function: delegate(uint256 _validator, uint256 _amount)

Allows delegating.

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 delegate to.

  • _amount

    • Control: Fully controlled by the stake manager.

    • Constraints: None.

    • Impact: The amount to delegate.

Branches and code coverage (including function calls)

Intended branches

  • Should call buyVoucher 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.

  • Should not allow calling it with illegitimate parameters. Not specifically checked --- it also depends on the ValidatorShare's implementation.

Function call analysis

  • valAddress.buyVoucher(_amount, 0)

    • What is controllable? _amount.

    • 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.

Zellic © 2024Back to top ↑