The RockPaperScissors contract lacks permission to mint reward tokens because the WinningToken contract's ownership is incorrectly assigned to the protocol admin instead of the game contract itself. This prevented the proper distribution of prizes to winners in token-based games.
Root Cause: The WinningToken was deployed with this ownership flow:
The WinningToken's mint
function is restricted to its owner, but the RockPaperScissors contract never received ownership. While the initial tests used privileged access to bypass this, production deployments would fail to award tokens.
Technical Insight: The game contract attempted to mint tokens without proper authorisation:
Critical Severity: This vulnerability completely breaks the core functionality of token-based games:
Winners receive no rewards despite winning
Staked tokens remain locked in the contract
Protocol reputation damage due to broken promises
Direct financial loss for players
This vulnerability was identified through manual code review. The PoC was written using Foundry.
The following PoC simulates a game, but before the game starts the ownership of the WinningToken contract is passed on to the RockPaperScissors contract to ensure that the game can conclude successfully.
Immediate Fix: Transfer token ownership during initialisation
Long-Term Prevention:
Implement ownership verification checks in tests without privileged access
Use explicit role-based access control (RBAC) instead of simple ownership
Add invariant testing for token balances after game completion
Implement automated security scanners for permission mismatches
This fix ensures the game contract has permanent, irrevocable authority to mint reward tokens while maintaining admin control over other protocol parameters.
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.