The claimThrone()
function should allow any player (except the current king) to claim the throne by sending the required ETH fee, enabling the core game mechanic where players compete to become and remain king.
The function contains inverted logic that only allows the current king to claim their own throne while preventing all other players from participating, completely breaking the fundamental game mechanism.
Likelihood:
Any player attempting to claim the throne (except the current king) will immediately trigger this require statement and have their transaction reverted.
Impact:
No one can dethrone the current king, effectively locking the game.
This example simulates a real interaction sequence to demonstrate the bug:
Alice claims the throne first and becomes currentKing. This part works as expected.
Bob then attempts to claim the throne by sending the required ETH. Under normal game rules, this should be allowed — he's not the current king and is trying to dethrone Alice.
However, the transaction reverts with an error stating that Bob is already the king, which makes no logical sense. This happens because of the incorrect condition which allows only the current king to proceed.
As a result, no other player can ever reclaim the throne after the first claim — proving that the contract’s behavior is broken after the initial move.
This fix corrects the logical condition used to validate throne claims.
The original line incorrectly allowed only the current king to claim the throne again, while rejecting all other players — which defeats the entire game purpose.
The corrected line now prevents the current king from re-claiming, while allowing new participants to challenge for the throne by paying the required fee.
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.