The declareWinner() function is designed to emit the correct prize amount when a winner is declared for monitoring and transparency purposes
The function emits pot value after it has been reset to 0, causing the event to always show 0 as the prize amount instead of the actual winnings
Likelihood: High
This bug is triggered every time declareWinner() is called
The event emission happens on every game round completion
Impact: Medium
Off-chain monitoring systems receive incorrect prize information (always 0)
Frontend applications cannot display accurate prize amounts to users
Game analytics and reporting will show false data
Users cannot verify the correct prize amounts from blockchain events
The test demonstrates that the GameEnded event should emit the actual prize amount, not zero:
Explanation: The test verifies that when a winner is declared, the GameEnded event emits the actual prize amount from the pot, not zero after the pot is reset.
Explanation: Store the pot value before resetting it to 0, then emit the actual prize amount 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.