In the declareWinner()
function, the GameEnded
event is emitted after the pot
has already been reset to zero:
As a result, the event always emits pot = 0
, which is incorrect and misleading. The actual amount the winner receives is not reflected in the event logs.
This breaks off-chain indexing and creates confusion for anyone relying on emitted data to determine the size of the pot or payouts.
LOW
Likelihood:
Occurs every time declareWinner()
is called.
Impact:
Off-chain services will display incorrect information about the winner's reward.
Makes auditing and verifying payouts from logs impossible.
wrong event emitted every time
Move the emit
line before the pot
is zeroed out:
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.