Assessment reports>Gasp Node and Monorepo>High findings>Improper status tracking
Category: Coding Mistakes

Improper status tracking

High Severity
High Impact
N/A Likelihood

Description

The functions respondToOpTask, respondToRdTask, and forceRespondToOpTask contain multiple occurrences of a basic coding mistake. The code uses the comparison operator == instead of the assignment operator = when updating the idToTaskStatus mapping. The task statuses are therefore not being updated correctly, leading to inconsistencies in the contract's state management.

  1. In the respondToOpTask function (lines 257 and 279)

idToTaskStatus[TaskType.OP_TASK][taskResponse.referenceTaskIndex] == TaskStatus.RESPONDED;
...
idToTaskStatus[TaskType.OP_TASK][taskResponse.referenceTaskIndex] == TaskStatus.COMPLETED;
  1. In the respondToRdTask function (line 492 and line 511)

idToTaskStatus[TaskType.RD_TASK][taskResponse.referenceTaskIndex] == TaskStatus.RESPONDED;
...
idToTaskStatus[TaskType.RD_TASK][taskResponse.referenceTaskIndex] == TaskStatus.COMPLETED;
  1. In the forceRespondToOpTask function (line 383)

idToTaskStatus[TaskType.OP_TASK][taskResponse.referenceTaskIndex] == TaskStatus.COMPLETED;

Impact

Since the task statuses are not updated due to the incorrect operator, the contract will behave like the tasks are still in their initial state. This can lead to reprocessing of tasks, duplication, or failure to recognize completed tasks.

Recommendations

We recommend correcting these lines to use the assignment operator = as intended.

Remediation

This issue has been acknowledged by Gasp, and a fix was implemented in commit 10e4ba5c.

Zellic © 2025Back to top ↑