The createGameWithToken
function in the RockPaperScissors contract emits the GameCreated
event with misleading data. While the function transfers 1 WinningToken from the creator to the contract, the event incorrectly reports a bet value of 0, failing to represent the token-based value being wagered.
In the createGameWithToken
function, a WinningToken is transferred from the user to the contract:
However, the GameCreated
event emitted at the end of the function reports a bet amount of 0, which is technically correct for the ETH value but fails to capture the token transfer that represents the actual wager in this transaction.
Data Integrity: Off-chain monitoring systems relying on event data will have incomplete or misleading information about the game's value.
Auditing Difficulties: The event logs don't provide a complete picture of what happened in the transaction, making it harder to audit or track game activity.
User Interface Issues: Frontends displaying event data will show these games as having "zero value" when they actually involve token stakes.
Manual code review
Modify the event to include token information
Create a more comprehensive event that can represent both ETH and token bets:
Code suggestions or observations that do not pose a direct security risk.
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.