The contract doesn't validate that eventStartDate is less than eventEndDate in the constructor, creating a critical vulnerability that can be exploited in multiple ways. This flaw fundamentally breaks the contract's temporal logic and creates exploitable states.
Likelihood: HIGH
Impact: HIGH
If eventStartDate > eventEndDate, multiple catastrophic states are created:
Deposit Trap: Users can deposit even after the event has technically ended (if current time > endDate but < startDate), as the contract only checks block.timestamp >= eventStartDate to prevent deposits
Winner Selection Manipulation: A malicious owner can exploit this to set an arbitrary winner if they deploy with an end date in the past
Permanent Fund Lock: If owner never calls setWinner(), all funds remain permanently locked
The PoC demonstrates how a malicious deployer can create a broken contract by setting the end date before the start date:
This creates multiple exploitable states:
Users can deposit funds (as block.timestamp < startDate)
Owner can immediately set any winner (as block.timestamp > endDate)
Only users who selected the owner's chosen winner can withdraw
The fix adds proper validation in the constructor:
These checks prevent deployment with invalid time parameters, ensuring the contract's temporal logic functions correctly and can't be manipulated to trap user funds.
To futher improve consider adding following constants MIN_TIME_BEFORE_EVENT_START, MAX_TIME_BEFORE_EVENT_START and MIN_EVENT_TIME, MAX_EVENT_TIME to avoid unreasonable time.
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.