Normal behavior:
When a player sends the required claim fee to claimThrone()
, they should be able to claim the throne, dethroning the previous king, who receives a reward.
Problem:
Due to a faulty require
condition, only the current king can call claimThrone()
. Since the initial currentKing
is the zero address, no one can ever match it, making the game impossible to start.
Likelihood:
The issue occurs immediately upon deployment.
No player can ever claim the throne because currentKing
is the zero address, and no real player can match that.
Impact:
The game is completely unplayable from the beginning.
Core functionality (claiming the throne) is blocked for all players.
This test shows that no one can enter the game at all. When the contract is first deployed, currentKing
is set to the zero address (address(0)
), so any real player calling claimThrone()
fails the require(msg.sender == currentKing)
check. Since no one can ever be the zero address, the game is completely unplayable from the start.
Replace the incorrect require
condition to prevent the current king from reclaiming, not 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.