Summary
The ownership of the WinningToken contract is permanently assigned to the specific instance of the RockPaperScissors contract that deploys it. There is no mechanism within RockPaperScissors to transfer this ownership, potentially hindering future upgrades or administrative changes related to the token.
Vulnerability Details
The RockPaperScissors constructor deploys a new WinningToken instance:
The WinningToken constructor inherits Ownable(msg.sender), assigning ownership to the deployer:
The WinningToken contract has standard Ownable functions (owner()
, transferOwnership()
), but these can only be called by its current owner.
Crucially, the RockPaperScissors contract, despite being the owner of the WinningToken, lacks any function that would allow its adminAddress (or anyone else) to call winningToken.transferOwnership()
to transfer the token's ownership to a different address (e.g., a new game contract, a DAO, or a multisig).
Therefore, the deployed WinningToken instance is permanently owned by the specific RockPaperScissors contract address that created it.
Impact
This isn't a direct exploit but a design limitation with potential future consequences:
Upgrade Difficulty: If a new version of the RockPaperScissors game contract needs to be deployed (e.g., to fix bugs or add features), the new contract cannot become the owner of the original WinningToken. This means the new game contract couldn't mint the existing token, potentially requiring a new, separate token or complex migration logic.
Administrative Inflexibility: If the project governance decides to transfer the administration of the token contract itself (e.g., to a multisig wallet for safer management), this is impossible without deploying a completely new token. The original token remains tied to the potentially obsolete game contract.
Loss of Control if Game Contract Compromised: While unlikely, if the RockPaperScissors contract itself had a severe vulnerability allowing arbitrary calls, an attacker could potentially misuse the token ownership (e.g., minting tokens). Separating token ownership could mitigate this risk.
Tools Used
Manual code review.
Recommendations
To add flexibility for future upgrades and administration, introduce a function within the RockPaperScissors contract that allows the current adminAddress to transfer the ownership of the WinningToken contract.
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.