Christmas Dinner

First Flight #31
Beginner FriendlyFoundrySolidity
100 EXP
View results
Submission Details
Severity: low
Invalid

zero day check must be applied

Vulnerability Details

The setDeadline function does not validate the _days parameter, allowing it to be set to 0. This behavior leads to unintended scenarios, such as:

Zero Deadline: The deadline could be set to the current block's timestamp, which is practically ineffective and could disrupt the system's flow.

Impact

Setting a zero deadline undermines the purpose of having a deadline in the first place.

Tools Used

Manual , vs code

Recommendations

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

Lead Judging Commences

0xtimefliez Lead Judge 8 months ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

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