The root cause is a simple logical error in the claimThrone
function's validation logic. The code incorrectly uses the equality operator (==
) instead of the inequality operator (!=
) in the following line:
require(msg.sender == currentKing, ...)
This condition makes it impossible for any new player to enter the game.
This bug leads to a complete Denial of Service (DoS) for the entire protocol.
Since the claimThrone
function is the main entry point to the game and is non-functional, no player can participate. As a result, the protocol is entirely unusable and frozen from the moment of deployment, preventing it from generating any value.
The claimThrone
function contains a critical logic error in its validation check. It incorrectly requires a new player to already be the king. This fundamental flaw blocks all new players from entering, making the entire game unplayable.
Likelihood:
Reason 1: A new user, who is not the current king, calls the claimThrone
function to participate in the game.
Reason 2: The function's validation logic executes the flawed access control check, which will fail for any new user.
Impact:
Impact 1: The core gameplay function, claimThrone
, is permanently non-functional for all new players.
Impact 2: The entire game protocol is unusable (Denial of Service), as no one can participate after deployment.
Expected Output
The validation logic within the claimThrone
function must be corrected to ensure a new player is not the currentKing
. This is achieved by changing the equality operator (==
) to an inequality operator (!=
) as shown below.
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.