When a winner is declared, the GameEnded
event should emit the actual prize amount that the winner received.
The code incorrectly sets the pot to zero before emitting the event, causing the event to log a prize amount of 0 instead of the actual winnings amount.
Likelihood:
This bug will occur every time a winner is declared.
Impact:
Off-chain applications monitoring events will receive incorrect prize amounts of 0, breaking any game tracking functionality.
User interfaces would be broken and show misleading information to users.
Store the prize amount in a local variable before modifying the pot state variable.
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.