Christmas Dinner

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

`deadlineSet` allways false. It is not set value when the host sets the deadline.

Description: deadlineSet allways false. It is not set value when the host sets the deadline.

Impact: The fact that the deadlineSet variable is not updated allows the host to change the deadline multiple times. Additionally, the _days parameter is not checked for a value of 0, which could allow the host to set the deadline to the current time, preventing users from being able to refund anymore.

Recommended Mitigation: You can follow these changes:

  1. Check the _days variable is greater than 0.

  2. Set deadlineSet to true after change the deadline

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

Lead Judging Commences

0xtimefliez Lead Judge about 1 year 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.

Give us feedback!