The setDeadline function does not validate the _days parameter. Setting an extremely high value could cause issues.
In setDeadline function, if _days is set to an extremely high value, it could lead to:
Overflow of the deadline variable.
Unreasonably long deadlines, prevent the proper organization of the event.
Users might not realize the consequence of passing very high values for _days.
Lack of input validation _days in the setDeadline function could lead to unintended behaviors, such as setting an unreasonably high deadline that could overflow or prevent proper event scheduling. This oversight can disrupt contract operations and create planning issues.
Manual Testing
Foundry (for test cases)
Update the setDeadline function by setting validation for _days to limit the maximum allowed value.
Below are the test cases to validate this issue and simulate scenarios for extremely high _days values along with their respective outputs:
1. Arithmetic underflow or overflow test case:
Demonstrating if _days value gets underflow or overflow.
Output:
2. Passing a High _days value that is valid but nonreasonable:
This test function will consider a very high value for _days which is valid but not a reasonable one that can be regarded as organizing an event (due to business logic, a deadline to get registered for an event can be to some extent, but not too long.)
This test function will PASS, which means that the event's deadline can be set to be very high nonreasonable value, which isn't set according to the business logic of any event.
Output:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.