Christmas Dinner

First Flight #31
Beginner FriendlyFoundrySolidity
100 EXP
View results
Submission Details
Severity: medium
Valid

State Variable `deadlineSet` Showing Wrong Result

Summary

The state variable deadlineSet is not updated correctly, still showing false even after the deadline is set.

Vulnerability Details

The deadlineSet state variable introduces a vulnerability due to its logic error, While its purpose is to show whether the deadline has been set or not, but as it remains false even after the setDeadline func. is successfully executed. It happens because the variable is not updated to true after the deadline is set.

Impact

This will lead to these potential issues:

  • host and participants to wrong information.

  • loss of trust

Tools Used

Manual Review

Recommendations

In function setDeadline this (+line) must be added:

function setDeadline(uint256 _days) external onlyHost {
if(deadlineSet) {
revert DeadlineAlreadySet();
} else {
deadline = block.timestamp + _days * 1 days;
emit DeadlineSet(deadline);
+ deadlineSet = true;
}
}
Updates

Lead Judging Commences

0xtimefliez Lead Judge 7 months ago
Submission Judgement Published
Validated
Assigned finding tags:

deadline is never set to true

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.