I see that there's some functions that mint new tokens to the winner instead of sending it from the the RockPaperScissors contract which is the wallet, and already player pays the token for creating game or joining the game.
At _finishGame()
in https://github.com/CodeHawks-Contests/2025-04-rock-paper-scissors/blob/25cf9f29c3accd96a532e416eee6198808ba5271/src/RockPaperScissors.sol#L472
the game winner are payed by minting new tokens instead of sending from the stored token that they payed.
At _handleTie()
in https://github.com/CodeHawks-Contests/2025-04-rock-paper-scissors/blob/25cf9f29c3accd96a532e416eee6198808ba5271/src/RockPaperScissors.sol#L511 players are refunded by minting new tokens instead of sendback from the tokens they send and stored from the admin wallet/contract
In _cancelGame()
at https://github.com/CodeHawks-Contests/2025-04-rock-paper-scissors/blob/25cf9f29c3accd96a532e416eee6198808ba5271/src/RockPaperScissors.sol#L547 the players are payed back by minting new tokens instead of sending from what they have send to play the game
Add the following test code in RockPaperScissorsTest.t.sol
and Run the test with foundry using
I used console.log()
to print balances of admin and players before the game and after the game,
You will see that admin balance before the game is 0
and 2
after the game while the winner has been paid from nowhere ( mint)
The game can mint unlimited tokens, devaluing them.
Manual review
Pay players by sending from what they have payed before playing the game ( from admin wallet )
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.