When game is initiated the initial currentKing
is set to address(0)
. When a user attempts to claimThrone
the function checks that the user is not the currentKing
to prevent them from making claims back to back.
The issue is that the claimThrone
function mistakenly requires currentKing == msg.sender
. This prevents any player claiming the throne, making the game impossible to participate.
Likelihood:
Highly likely as its the main entry point for participants in the game.
Impact:
High impact as it prevents the game from being played.
This test proves that when a new game is initiated the currentKing is not equal to the address of player1
. Despite this when calling the claimThrone
function as player1
, the function still reverts with the error claiming player1
is already the king.
The require always checks for a true boolean. So it is recommended that the require statement be inverted to always check that the sender is not the currentKing.
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.