Create a Local Blockchain on the computer using Anvil
Deploy the Smart Contract using forge create
Then using cast send command , try calling the claimThrone( ) fuunction sending with it a claimFee , but you will see that it will always revert with the message "Game: You are already the king. No need to re-claim." , because it needs only the currentKing to be able to call the function and from the smart contract we can see that the currentKing is left at address 0 , so it will always revert and not work
The Vulnerability will always occur because for the game to work , then the claimThrone( ) needs to be called and claimFee to be paid to make one the king but since it will always revert if the currentKing does not call it and there is not any currentKing in the smart contract , then the smart contract will never work
The impact is that it will cause the smart contract to be stuck and never work at all rendering it useless as it needs only the currentKing to call the function that is the heart of the smart contract but there is no currentKing
The mitigation of the vulnerability is pretty straightforward , just in the require( ) revert statement , it should make the currentKing not be the one that should call the claimThrone( ) function
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.