Assessment reports>StaFi>Threat Models>redelegate

Function: redelegate(address _poolAddress, uint256 _srcValidatorId, uint256 _dstValidatorId, uint256 _amount)

Redelegate a certain token amount to a certain validator.

Inputs

  • _poolAddress

    • Control: Full.

    • Constraints: Must contain srcValidatorId.

    • Impact: The pool being staked into.

  • _srcValidatorId

    • Control: Full.

    • Constraints: Cannot be _dstValidatorId.

    • Impact: The validator whose stake will be removed.

  • _dstValidatorId

    • Control: Full.

    • Constraints: Cannot be _srcValidatorId.

    • Impact: The validator who will receive that stake.

  • _amount

    • Control: Full.

    • Constraints: None.

    • Impact: The amount of stake to delegate to the validator.

Branches and code coverage (including function calls)

Intended branches

  • DST validator stake amount increases.

  • SRC validator stake amount decreases.

  • Add DST validator if not currently in the list.

  • Remove validator if stake == 0.

Negative behavior

  • Cannot redelegate 0 amount.

Function call analysis

  • IStakePool(_poolAddress).getTotalStakeOnValidator(_srcValidatorId)

    • What is controllable? _srcValidatorId.

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

    • What happens if it reverts, reenters, or does other unusual control flow? N/A.

Zellic © 2024Back to top ↑