When a token-based game (game.bet == 0
) is cancelled in the _cancelGame
function, the contract mints new WinningToken
tokens to the players instead of transferring the tokens they originally staked. This causes an unnecessary increase in the total supply of the WinningToken
, which could lead to inflation over time.
Function Affected: _cancelGame(uint256 _gameId)
Issue: When cancelling a game with tokens, the contract mints new tokens to the players instead of transferring the tokens that were previously staked. This increases the total supply of WinningToken
unnecessarily.
Cause: The function uses winningToken.mint()
to mint new tokens, instead of transferring the tokens that were originally staked by the players.
Inflation of Token Supply: The total supply of the WinningToken
increases without any backing value, leading to inflation over time.
Manual code review
Replace winningToken.mint()
with a transfer mechanism to return the tokens that were originally staked by the players.
Ensure that the total supply of WinningToken
is kept in check and that no new tokens are minted unnecessarily during cancellation.
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.