Christmas Dinner

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

Lack of setter for deadlineSet parameter

Summary

The deadlineSetis flag which informed that the deadline in the protocol is set. But there is not setter for this flag.

Vulnerability Details

In the protocol there is no setter function available for the deadlineSet flag.

Impact

In the setDeadline function, this flag is used to check the status of the deadline. Without the proper value of the setDeadline flag, the function will not emit the correct event or reflect the correct status of the deadline. This could lead to protocol errors, as it may allow the deadline to be set again.

Tools Used

manual review

Recommendations

Please consider add setter to the setDeadlinefunction.

function setDeadline(uint256 _days) external onlyHost {
if(deadlineSet) {
revert DeadlineAlreadySet();
} else {
deadline = block.timestamp + _days * 1 days;
// @audit add this line
deadlineSet = true;
if(deadlineSet) {
//@audit should be = true;
emit DeadlineSet(deadline);
}
}
Updates

Lead Judging Commences

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

deadline is never set to true

0xtimefliez Lead Judge 8 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.