The createPerformance() function enforces a strict check that the performance startTime must be in the future:
solidity
This prevents the organizer from scheduling a performance that starts immediately (i.e., in the same block as the transaction that creates it).
While the intention is likely to avoid accidental "past" performances, this restriction is overly strict and reduces flexibility. In real-world festival scenarios, organizers may want to create and activate a performance right now — for example:
Starting an impromptu set or surprise performance
Fixing a missed performance by creating one that begins immediately
Testing or demo purposes during deployment
Allowing startTime >= block.timestamp would enable immediate starts without compromising security or logic.
Low severity: No security vulnerability, no funds at risk, no incorrect reward calculation.
Reduced flexibility for the organizer (onlyOrganizer-gated function).
Poor user experience in legitimate edge cases where immediate activation is desired.
Forces organizer to wait at least one block (typically 2–12 seconds) before a performance can begin, which can be operationally inconvenient.
Falls under Low / QA per CodeHawks severity classification.
The following Foundry test demonstrates the current restrictive behavior:
solidity
This test passes — showing that even setting startTime to the current block timestamp causes reversion.
If the check were changed to >=, the above call would succeed and the performance would be active immediately.
Change the strict inequality to allow starting in the current block:
solidity
Updated function snippet:
solidity
This change:
Prevents past performances (still safe)
Allows immediate activation when needed
Improves operational flexibility
Has negligible gas impact
Aligns with common patterns in event/ticketing contracts
The contest is live. Earn rewards by submitting a finding.
Submissions are being reviewed by our AI judge. Results will be available in a few minutes.
View all submissionsThe contest is complete and the rewards are being distributed.