Normal behavior:
Any player who is not the current king should be able to claim the throne by paying the required fee. The current king should be prevented from claiming again.
Specific issue:
The contract incorrectly checks that only the current king can claim the throne, which is the opposite of the intended logic. As a result, no one can ever claim the throne after deployment, and the game cannot proceed.
Likelihood:
This will occur every time the contract is deployed and a player attempts to claim the throne, as the initial currentKing
is address(0) and no EOA can match it.
The bug is present in the main claim function and blocks all gameplay.
Impact:
The game is permanently frozen and unusable.
All ETH sent to the contract is trapped and cannot be recovered through normal gameplay.
The following test script demonstrates the bug. It deploys the contract and attempts to claim the throne as a non-king. The transaction always reverts with the message "Game: You are already the king. No need to re-claim."
, proving that no one can ever claim the throne.
The bug is caused by an inverted logic check in the claimThrone()
function. The require statement should prevent the current king from claiming again, not block everyone else.
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.