As the game owner has the ability to change the eggFindThreshold
at anytime, a dishonest game owner could manipulate the eggFindThreshold
shortly before calling EggHuntGame::searchForEgg
to mint an egg with 100%.
For the game owner, there are no restrictions on setting the eggFindThreshold
. This would allow a dishonest game owner to call the EggHuntGame::setEggFindThreshold
shortly before calling EggHuntGame::searchForEgg
, set the eggFindThreshold
to 100, mint an egg with 100% certainty, and then set the eggFindThreshold
back to the previous value for other players. This would give the game owner a significant advantage over other players in finding eggs.
The following scenario may lead to an unfair advantage for the game owner in finding eggs:
Game owner starts game
Game owner sets eggFindThreshold
to 100
Game owner calls EggHuntGame::searchForEgg
function and mints egg with different address
Game owner sets eggFindThreshold
back to 20
Code:
Place following code into EggHuntGameTest.t.sol
:
A dishonest game owner that manipulates the game to their own benefit may significantly impact the protocol in terms of trust and possibly lead to financial loss (it's unclear if there is any monetary value attached to the eggs). The impact may be high if for example eggs can be redeemd for prize money or prize money is rewarded to players with the most eggs, etc.
Manual review, custom test
To prevent dishonest game onwer from manipulating the game via the EggHuntGame::setEggFindThreshold
function, the call to the function could be restricted such that:
the eggFindThreshold
can only be set before the game is active
the eggFindThreshold
can only be increased/decreased by a limited amount
the eggFindThreshold
can only be changed once per day
Owner is trusted and is not expected to interact in ways that would compromise security
Owner is trusted and is not expected to interact in ways that would compromise security
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.