Normal behavior: declareWinner() should transfer the entire pot to the current king and emit the GameEnded event with the correct prize amount.
Issue: The function sets pot to 0 before emitting GameEnded, so the prizeAmount logged in the event is always zero:
Likelihood:
The bug triggers every time declareWinner() is called; the event always reports a zero prize, so the likelihood is high whenever a winner is declared.
Impact:
Off‑chain Misrepresentation: Analytics platforms and dApps rely on events. Incorrect prizeAmount misleads users and could break integrations that depend on the event data.
Audit Complexity: Off‑chain services might assume no prize was paid, leading to erroneous financial reporting.
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.