The WinningToken
contract's ownership remains with the initial deployer rather than the RockPaperScissors
main contract. This occurs because the token's constructor sets ownership to msg.sender
during deployment (the RockPaperScissors
deployer), but never transfers it to the game contract itself. As a result, calls to mint()
from _finishGame()
will revert since the game contract lacks ownership privileges.
Critical: Token-based games cannot reward winners, breaking core protocol functionality
All winner token distributions fail, rendering token-based game modes unusable
Players would permanently lose access to token-based features without manual admin intervention
Transfer Ownership During Initialization
Modify the RockPaperScissors
constructor to claim token ownership:
Verify Ownership in Game Logic
Add an ownership check during contract initialization:
The current flawed flow:
Deployer creates RockPaperScissors
contract
RockPaperScissors
constructor deploys WinningToken
(owner = deployer)
Game contract attempts to mint tokens → Reverts
Fixed flow after changes:
Deployer creates RockPaperScissors
Game contract deploys token and becomes owner
mint()
calls succeed from game logic
This fix ensures the game contract has proper authority to distribute winner tokens as intended in the protocol design.
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.