GameEnded
emits incorrect amount sent to Winner '0' instead of actual amount sent to the Winner. GameEnded
event emits the amount after it has been sent to '0'.The GameEnded
Event Emits the amount of winnings sent to the Winner after it has been set to 0
While its not a threat to the Contract's Functionality but it can cause issues with Analytics cause its not emiting the exact amount sent to the Winner.
We want to emit the amount sent to Winner in the event to actually see how much he got, helps with Analytics instead of just 0.
Likelihood: Low
Low/Informational as it can have reading issues when tryinng to see how much amount went to the Winner
Impact:
The GameEnded
event emits the pot
value after it has been reset to 0
.
As a result, the event always reports prizeAmount = 0
, even though the actual prize was successfully transferred to the winner via pendingWinnings
Deploy the contract and have a player claim the throne with 3 ETH.
Advance time beyond the grace period.
Call declareWinner()
.
Then the Contract will do:
What we are doing here in the code is saving the pot in prizeAmount Variable so that in the Event we emit it to see how much amount got sent to the Winner this helps in Analytics and to see how much money the Winner actually got.
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.