function Game::declareWinner()
emit event GameEnded with parameter pot
always equal 0. It should use correct state of pot
which before reset.
Likelihood:
Reason 1: Last each round, when function declareWinner be triggered, it will happend.
Impact:
Impact 1: It emit wrong parameter pot
of event `GameEnded`, external service or indexer will receive wrong data and cause other service in dapp work incorrect.
Step 1: Players join the game and claim the throne.
Step 2: Now pot > 0, eg, 5 ETH. A user creates a transaction declareWinner
.
Step 3: Indexer catches an event GameEnded
with pot = 0 (wrong, Correct is 5 ETH).
Step 4: Indexer (Backend) receives wrong data, so maybe UI will render wrong data for the user, which causes conflict
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.