If player A created a game with Winning Token, player B can join that game using 0 ether in short without staking any asset.
The RockPaperScissors::joinGameWithEth
function is not checking if the game.bet
is zero or not. so, If player A has started the game with Winning token then player B can join this game by calling RockPaperScissors::joinGameWithEth
function without sending any ETh or Token. ideally it should check if the game requires Winning token or ETH for participation using bet variable.
Player B can join without staking his asset (ETH or Winning Token)
foundry test
Add this following test case in RockPaperScissorsTest.t.sol
test suit:
Add the following check to RockPaperScissors::joinGameWithEth
function:
Or we should calculate ETH equivalent of winning token
joinGameWithEth function lacks a check to verify the game was created with ETH
joinGameWithEth function lacks a check to verify the game was created with ETH
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.