Game::claimThrone function
contains wrong condition in require statement, that makes complete game unplayableGame::claimThrone function
allows a player to claim the throne. Function has an require statement that contains wrong condition about the function caller and makes complete game unplayable.
The expected check should be, function caller should not be the currentKing
Current code implements, caller should be the currentKing to call the claimThrone function
This wrong condition in require statement makes the complete game unplayable
for other player
Likelihood: High
Other player trying to claimThrone will not able to participate in the game due to wrong require condition. Game will become unplayable for all other players. According to current code, only currentKing will able to claimThrone and participate in the game
Impact: High
Game will become unplayable for all other players except the currentKing according to current code implementation
Add test\_claimThrone\_Exploit function
in Game.t.sol
file. To run the test run the command forge test --mt test\_claimThrone\_Exploit -vvvv
The test will depect, players other than currentKing will not be able to claimThrone
To make the game playable make the changes as given below
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.