The WinnerDeclared event is meant to log the winner along with the pot amount they won. However, the pot variable was being reset to 0 before the event was emitted:
This causes the event logs to show an incorrect value (0), misleading off-chain indexers, UIs, and auditors that depend on the event data.
This happens every time the winner is declared.
It occurs deterministically due to the order of operations in the declareWinner() function.
Misleading Event Data: Off-chain systems depending on events will assume the winner got 0.
Harder Auditing/Analytics: Pot transfer can't be confirmed by events alone, requiring more effort.
Reduced Transparency: Users and dApps may distrust the event logs due to inconsistency.
Before Fix:
After Fix:
The emitted WinnerDeclared event contains an incorrect pot amount (0) in the original version.
Ensure that event emission occurs before any state changes that would modify values important to that event (like pot). This ensures accurate logs and traceability.
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.