Any contender who is not a current King and pays an amount that is above or equal to the claimFee should be able to claim the Throne.
The claimThrone() function contains a critical logic error where the condition is inverted. The current implementation requires the msg.sender to be the current King which prevents anyone except the current King from claiming the throne. However, since the default value of current King is address(0), this condition completely disables the claiming throne functionality, making the game unplayable.
Likelihood:
The bug is triggered every time any player attempts to claim the throne
This occurs immediately upon the first claim attempt by any player
The game becomes completely non-functional from the first interaction
Impact:
It completely breaks the core game functionality
No players can claim the throne, making the game unplayable
This test:
verifies that current King is address(0)
verifies that claimThrone reverts on any user with address not equal to address(0)
verifies that claimThrone allows only address(0) to claim the throne.
This mitigation allows any user to claim the throne and prevents the current King from reclaiming the throne.
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.