The claimThrone()
function contains a critical logic error that makes the entire game unplayable. The require statement uses inverted logic:
This condition requires that the message sender MUST be equal to the current king to proceed. However:
currentKing
is initialized as address(0)
in the constructor
No user can have address address(0)
as their wallet address
This creates an impossible condition where no legitimate user can ever claim the throne, as msg.sender
can never equal address(0)
.
No player can ever call claimThrone()
successfully
The game becomes entirely non-functional from deployment
Put this into Game.t.sol
file and run forge test --mt testCantJoinTheGame -vvv
Fix the logic condition changing the equality operator to inequality:
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.