The GameEnded
event is intended to log the final prize awarded to the winner. However, in declareWinner()
, the pot
is set to zero before emitting the event. As a result, the prizeAmount
in the event is always zero, even though the winner receives the correct amount via pendingWinnings
.
Likelihood:
This occurs every time declareWinner()
is called after the grace period.
Impact:
All GameEnded
logs will show a prize amount of zero.
Off-chain systems (e.g. UIs, indexers, analytics) relying on events will display incorrect data.
Reduces trust and transparency for users.
In a typical game flow, a user claims the throne with ETH, waits for the grace period to expire, and declareWinner()
is called. Even though the user receives the correct amount internally, the emitted event always reports the prize as zero due to resetting the pot
before emitting. This behavior can be easily reproduced in any test or real scenario.
Store pot
in a local variable before resetting it, and emit that 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.