The Game.sol:: claimThrone
function**** uses**** require(msg.sender == currentKing)
. This check ensures that the caller is the current king instead of checking that the caller is not the current king. As written, no new player can ever claim the throne (and in fact the very first claim fails because currentKing
is initially 0). This breaks basic game functionality and renders the whole game unplayable.
Likelihood:
The likelihood is very high as it affects the protocol from the very first instance a player tries to interact with the game.
Impact:
Impact 1 : This logic bug makes the game unplayable by users and therefore renders the whole protocol obsolete.
Impact 2: Due to this issue, there would be no protocol fee to be claimed and the platform generates no revenue.
From the above test case, it is evident how the test passes and proves how the game is rendered unplayable due to the fact that the require check is not correctly implemented.
Below is a recommended code with the correct desired implementation. Alternatively, the check may also be removed.
The above check shows how to correctly implement the require check and ensure that the game logic plays out as originally intended,
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.