pot
parameter in GameEnded
event will always be set to 0, not reflecting the real pot amount.In declareWinner()
function, GameEnded
event is called to store relevant data about the game that is being finished: emit GameEnded(currentKing, pot, block.timestamp, gameRound);
. The problem is that pot
value is being set to 0 before emitting GameEnded
event creating a discrepancy between the real pot value before ending the game and the one that is being recorded on the event.
Likelihood:
Everytime a game is being ended this error will be reproduced.
Impact:
Although this error does not directly affect contract funds or any user funds, it can create discrepancies when displaying data in a frontend or when collecting data from past games.
As we can see in the declareWinner
function, pot
is being set to 0 right before emiting the event.
One recommended mitigation could be assigning the value of pot
to a variable before setting pot
to 0
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.