Assessment reports>Metavest>Threat Model>confirmMilestone

Function: confirmMilestone(uint256 _milestoneIndex)

This function is used to confirm a milestone of the allocation contract.

Inputs

  • _milestoneIndex

    • Control: Arbitrary.

    • Constraints: Should be less than the length of the milestones array.

    • Impact: Index of the milestone to confirm.

Branches and code coverage

Intended branches

  • Check the condition for the milestone.

  • Update the milestone status to confirmed.

  • Update milestoneAwardTotal.

  • Update milestoneUnlockedTotal if unlockOnComple is true.

Negative behavior

  • Revert if this function is reentered.

  • Revert if the allocation is already terminated.

  • Revert if the milestone index is greater than the length of the milestones array.

  • Revert if the milestone is already confirmed.

  • Revert if the condition check fails.

Function call analysis

  • IConditionM(milestone.conditionContracts[i]).checkCondition(address(this), msg.sig, _data)

    • What is controllable? _data.

    • If the return value is controllable, how is it used and how can it go wrong? Returns true or false — if false, the function reverts.

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

Zellic © 2024Back to top ↑