The cancelGame()
function allows PlayerA to cancel a game even after PlayerB has joined, which is unfair because:
PlayerB have already committed funds (or winning tokens) expecting the game to proceed.
PlayerB might be winning the game, but if PlayerA cancels, PlayerB will lose the reward, and their bet will remain stuck in the contract.
No check prevents cancellation after PlayerB joins, violating game fairness.
POC:
Add this to the test file
PlayerA can exploit this to cancel games strategically esp. if they see PlayerB is likely to win.
foundry tests
Add a validation to check that playerB is not in the game, to avoid stuck of funds
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.