The RockPaperScissors contract initializes the admin address directly from msg.sender
in the constructor, which can lead to incorrect admin assignment when deployed through proxies, factories, or deployment scripts.
In the constructor, the admin address is set directly to msg.sender
:
This is problematic because:
If deployed through a proxy or factory contract, msg.sender
will be the address of the deploying contract, not the intended admin
If deployed through a deployment script, msg.sender
might be a temporary account
There's no verification that the assigned address is valid or intended
This vulnerability can lead to:
Admin rights assigned to an unintended contract address
Admin functions becoming inaccessible if the admin is set to a contract that cannot execute them
Complete loss of admin control over the protocol
Inability to withdraw fees or perform other critical admin functions
Manual code review
Pass the admin address as a parameter to the constructor:
This ensures:
The admin address is explicitly provided, not implicitly derived
The deployer must consciously specify the intended admin
The contract works correctly regardless of deployment method (direct, proxy, factory, etc.)
Zero-address validation prevents accidental initialization to an invalid address
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.