When a game ends in a tie, gets cancelled or finished with a winner, the contract mints new RPSW
tokens to players instead of refunding the tokens that were previously transferred into the contract. This creates unnecessary inflation of the token supply and breaks proper accounting.
During token-based game creation and joining, both players transfer one RPSW
token each to the game contract:
However, when the game is cancelled, ends in a tie finished with a winner, instead of refunding the deposited tokens via transferFrom()
, the contract uses:
This causes inflation in the total supply of winner tokens, especially problematic in systems where tokens are supposed to be scarce or bounded by gameplay.
Inaccurate token accounting
Increased total token supply unnecessarily
Potential devaluation of reward tokens
Manual code review
Replace token minting with direct transfers from the contract to the players:
Mints new tokens upon game completion or cancellation for token-based games
Mints new tokens upon game completion or cancellation for token-based games
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.