TwentyOne

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

Deck Initialization Vulnerability Allows Game Exploitation

Summary

In line 62, the initializeDeck function.

for (uint256 i = 1; i <= 52; i++) {

It must start by 0 and end to 51.

Vulnerability Details

When the player starts the game, first, the initializeDeck function implements. Then the draw function performs twice to get 2 cards.
But the Indexes between initializeDeck and drawcard function are different.
So it will revert.

Impact

Contract will revert.

Tools Used

Recommendations

for (uint256 i = 0; i <= 51; i++) {
Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Appeal created

davidjohn241018 Submitter
about 1 year ago
davidjohn241018 Submitter
about 1 year ago
inallhonesty Lead Judge
about 1 year ago
inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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

Give us feedback!