Description:
The createGameWithEth
and createGameWithToken
functions allow for an unbounded _totalTurns
parameter. While there is a check that totalTurns must be odd and greater than zero, there's no upper limit.
Impact:\
An attacker could set an extremely large value for _totalTurns
, making it practically impossible to complete the game due to gas limitations or time constraints.
This could effectively lock funds in the contract indefinitely.
The impact is amplified when users stake significant amounts of ETH or valuable tokens.
Waste significant gas for victims who attempt to play
Recommendation:
Implement a reasonable maximum limit for _totalTurns
:
Where MAX_TURNS
is a constant defined at the contract level (e.g., 21).
Manual code review
Code suggestions or observations that do not pose a direct security risk.
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.