Normally, when a player calls Game::claimThrone
, they become the new King as long as they pay the current claim fee and are not already the King. The function should prevent the current King from reclaiming the throne again.
However, the check in the claimThrone
function incorrectly restricts everyone except the current King from participating. It uses the condition:
This allows only the current King (zero address) to claim the throne again, a logic inversion of the intended rule. As a result, no new players can participate after the first King, halting the game entirely.
Likelihood:
This will occur immediately when the first player becomes King.
All subsequent attempts to call claimThrone()
by any new player will fail due to the incorrect require
condition.
Impact:
Completely breaks the game mechanics, no one can participate after deployment.
This test demonstrates how players can not claim the throne since the function requires the current king only to claim, which happens to be the zero address. It treverts on any attempt.
Change the faulty line in claimThrone
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.