TwentyOne

First Flight #29
Beginner FriendlyGameFiFoundrySolidity
100 EXP
View results
Submission Details
Severity: low
Invalid

Unfair cards value check for inexperienced players in `hit` function.

Summary

The current system for checking cards values in hit function presents an unfair advantage for casino at the expense of players who are new to the game mechanics.

Vulnerability Details

The hit function allows players to receive additional cards even if their current hand value is equal to 21.

uint256 handBefore = playersHand(msg.sender);
- require(handBefore <= 21, "User is bust");

Impact

By permitting hits after reaching 21, players face a guaranteed loss, as exceeding 21 results in an automatic win for the house .

Tools Used

Manual code review.

Recommendations

Apply this code:

uint256 handBefore = playersHand(msg.sender);
+ require(handBefore < 21, "User is bust");
Updates

Lead Judging Commences

inallhonesty Lead Judge 7 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.