TwentyOne

First Flight #29
Beginner FriendlyGameFiFoundrySolidity
100 EXP
View results
Submission Details
Severity: medium
Valid

No mechanism to ensure the contract holds enough funds

Summary

There is no mechanism to ensure the contract holds enough funds, leading to potential failed transfers.

Vulnerability Details

The contract transfers 2 ether as the prize in endGame function but there is no assurance that the contract has that much ether.

Impact

Transaction failure.

Recommendations

require(address(this).balance >= 2 ether, "Contract lacks funds to pay out");

Updates

Lead Judging Commences

inallhonesty Lead Judge 11 months ago
Submission Judgement Published
Validated
Assigned finding tags:

Insufficient balance for payouts / Lack of Contract Balance Check Before Starting Game

Support

FAQs

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