[L-1] Misleading GameEnded Event Emitted After pot is Zeroed
The declareWinner() function emits the GameEnded event after setting pot = 0, resulting in prizeAmount always being emitted as 0, even though the winner's actual reward was non-zero.
This behavior misleads off-chain systems, dashboards, users, or auditors who rely on event data for historical game outcomes.
Impact:
1.Users/frontends will see a prize amount of 0 in the GameEnded event, even if the actual winnings were much higher.
2.Analytics tools or dashboards built on event logs (e.g., The Graph, Dune, Nansen) will display incorrect prize history.
3.Trust in contract transparency may be undermined due to inaccurate emitted data.
In the declareWinner() function:
Cache the pot value in a local variable before zeroing it, and use the cached value in the event:
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.