GameEnded Event Emits Incorrect pot amount in the declareWinnerIn the declareWinner() function, the GameEnded event emits a prizeAmount value after the pot has already been reset to zero:
This means the emitted prizeAmount will always be 0, regardless of how much ETH was actually won.
As a result, any off-chain services (frontends, analytics dashboards, indexers) relying on the GameEnded event to track prize amounts will display incorrect data.
Likelihood:
Always triggers whenever a game ends, since pot is reset before the event emission
Impact:
Event logs will misrepresent actual winnings, leading to:
Incorrect historical game records.
Misleading frontend displays.
Potential disputes if the event log is used for audits or marketing
A simple test to demonstrate the 0 error; try to test using `game.pot()`
Store the pot in a temporary variable before zeroing it, and emit that value in the even
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.