[M-01] The game can be terminated before the configured duration is expired
The following function EggHuntGame.sol::endGame()
implements the conditions when exactly the game owner can terminate the game. There is only a check of the state variable gameActive
. Ther is no check if endTime
has expired. That leads to potential incorrect earlier game termination and no more player could take part of the underlying game, until a new game starts. In addition the function EggHuntGame.sol::getRemainigTime()
returns the remaining time until endTime
, misleading the players there is still active game, no matter the game has been actually stopped.
Мissing required check leads to:
incorrect earlier termination of the game
getTimeRemaining()
missleads the players, returning incorrect result
players not able to participate anymore in the underlying game
Manual review
Foundry
Add the following test to EggHuntGameTest.t.sol
.
Add the following check to EggHuntGame.sol::endGame()
in order to allow ending games only after the configured duration is expired. In addition endTime
should be updated as well.
Incorrect values reported when a game is ended early
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.