Players are supposed to be able to call claimThrone
function upon creation of the contract to claim the title of currentKing
.
Due to an error in the require statement, the function requires the caller to be the currentKing
's address, rather than ensuring that the caller and the currentKing
are different addresses. Since the currentKing
is initialised to 0 address, the require statement will never pass.
Likelihood: High
This function will definitely be called by players and is integral to the operation of the contract.
Impact: High
There are adverse impacts as it would cause all functionality to not work and the entire contract would not be able to be used.
By creating a simple test code to try and call claimThrone
, the function reverts.
Amending the erroneous require check would solve the issue.
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.