In the contract constructor, the start and end times of the activity should be correctly initialized to ensure that the end time of the activity comes after the start time, so as to guarantee a normal activity process.
In the current implementation, the constructor does not verify the relationship between eventStartDate and eventEndDate, allowing the end time to be set before the start time. This can lead to logical errors and potential denial of service.
Likelihood:
Reason 1 This situation occurs when the contract deployer accidentally or intentionally sets incorrect time parameters.
Reason 2 Since the constructor is a one-time operation, once a deployment error occurs, it cannot be modified, and the risks have a long-lasting impact.
Impact:
Impact 1 Logical error - When eventEndDate is earlier than eventStartDate, the time check in the setWinner function will exhibit abnormal behavior.
Impact 2 Potential Denial of Service - Although technically, the setWinner function can execute normally after the actual activity starts (when block.timestamp > eventStartDate, it is also guaranteed that block.timestamp > eventEndDate will be true), this design still tends to cause confusion and potential logical issues.
This is owner action and the owner is assumed to be trusted and to provide correct input arguments.
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.