joinEvent Function Timestamp Check Lacks PrecisionUsers call the joinEvent function to participate in the guess when confirming the event has not yet started.
However, there is a minor deviation in the judgment of "the event has not yet started".
In common programming paradigms, block.timestamp == eventStartDate is generally considered to mean "the event has started".
But the code here uses block.timestamp > eventStartDate to indicate "the event has started", which is obviously inaccurate.
Likelihood:
Guaranteed to occur in blocks where the timestamp is exactly equal to eventStartDate.
Impact:
Inconsistency with the event's publicly announced start time.
Users can participate immediately when the event starts on time, potentially enabling cheating (e.g., for a World Cup guess event where the winning team info comes from off-chain news, users could select the known result to participate).
Unfair to honest users who participate genuinely before the event starts.
The project team's credibility will face obvious doubts from users.
Add the following function to test/BriVaultTest.t.sol and run forge test --mt test__joinEvent_inEventStartDateBlock -vv:
Console 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.