Normal behavior:
When the game ends, the GameEnded
event should emit the actual prize amount (the pot value before it is reset), so off-chain systems and users can accurately track rewards.
Specific issue:
The contract emits the GameEnded
event after setting pot = 0
, so the event always logs a prize amount of zero, regardless of the actual winnings.
Likelihood:
This will occur every time a winner is declared.
Impact:
Off-chain analytics, UIs, and indexers will display a prize of zero.
Users may be misled about the actual rewards distributed by the contract.
The following test demonstrates the bug. It expects the GameEnded
event to emit the actual prize, but the event logs zero instead.
Emit the GameEnded
event with the prize value before zeroing the pot:
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.