Description: When initially deployed, the RockPaperScissors
sets the admin to be the contract deployer and doesn't keep track of the contract owner address anywhere. The owner
function returns the adminAddress
which is incorrect. There is also confusion in the setTimeout
function which should be only callable by the admin but currently.
Impact: By not keeping the owner address anywhere in the contract, this leads to a contract that's solely owned by the admin. If thr admin is changed to be a different address, the initial contract owner will not have any ownership of the contract and therefore won't have any power over the contract. The contract deployer as a role will be nonexistent. This will lead to the admin having full ownership of the contract, the funds and setting new admins and timeouts.
Recommended Mitigation:
There are a different ways to mitigate this:
Use the Ownable
abstract class by openzeppelin
by extending the RockPaperScissors
contract which will make the initial deployer of the contract the owner and remove the owner
function which incorrectly returns the admin instead. Also, change the require check in the setTimeout
function to check that the msg.sender
is the adminAddress
instead of owner()
.
Introduce a contractOwner
address property and change the owner
function to return this instead of the adminAddress
.
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.