The RockPaperScissors.sol
contract has a design flaw in its token-based game logic. When players participate in token games, they transfer tokens to the contract, but these tokens remain permanently locked in the contract as the game mints new tokens for winners instead of returning the original ones. This creates unbounded token supply inflation and resource inefficiency.
In token-based games, the contract collects tokens from both players but never returns these original tokens to circulation:
When games end (win, tie, or cancel), instead of returning the collected tokens, the contract mints new ones:
This pattern causes tokens to accumulate indefinitely in the contract while simultaneously increasing total token supply, as verified by test results. The following test proves that. You can paste it in the RockPaperScissorsTest.t.sol
contract.
The current implementation has several negative consequences:
Token supply inflation: As more games are played, the total supply continuously increases without bounds, diluting the token value.
Resource Inefficiency: Original tokens remain locked in the contract.
-Manual analysis
Update the token management logic to transfer existing tokens rather than minting new ones.
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.