FestivalPass::performanceCount before increment, leading to wrong emit eventIn the FestivalPass:createPerformance() function, the contract emits the PerformanceCreated event using performanceCount as the unique performance identifier. However, performanceCount is only incremented after the event is emitted. This results in an off-by-one mismatch between the event log and the actual mapping index used to store the new performance.
If multiple performances are created rapidly or concurrently, this could lead to confusion during indexing, debugging, or when parsing logs off-chain.
Likelihood:
Happens every time a new performance is created.
Impact:
Event logs emit the wrong performanceId (off-by-one).
Off-chain consumers relying on events may index incorrect performance metadata.
Add this Proof of concept to the festivalPass.t.sol to test this.
Increment performanceCount before emitting the PerformanceCreated event to ensure the event’s performanceId correctly reflects the unique identifier of the created performance.
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.