The GameEnded
event should emit the actual prize amount that the winner receives to provide accurate data for off-chain applications and monitoring systems.
The declareWinner
function emits the event with prizeAmount
set to pot
after the pot has already been reset to 0, showing incorrect prize data.
Likelihood:
Every call to declareWinner()
will emit incorrect prize data
External systems monitoring events will receive wrong information
Impact:
Off-chain applications and indexers receive incorrect prize data
Frontend applications display wrong winning amounts to users
Analytics and monitoring systems have inaccurate game statistics
User confusion when checking transaction logs
Looking at the declareWinner
function:
Scenario:
Current pot is 5 ETH from multiple claims
Grace period expires, someone calls declareWinner()
Winner receives 5 ETH in pendingWinnings
pot
is reset to 0
Event emits GameEnded(winner, 0, ...)
instead of GameEnded(winner, 5, ...)
Store the prize amount before resetting 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.