Puppy Raffle

AI First Flight #1
Beginner FriendlyFoundrySolidityNFT
EXP
View results
Submission Details
Impact: medium
Likelihood: low
Invalid

The value may overflow

Root + Impact

Description

  • As a solidity below 0.8 version,it coudn't check automately.And the contract alse don't have a overflow checking.Once oveflow happening,require(address(this).balance == uint256(totalFees), "PuppyRaffle: There are currently players active!"); in withdrawFees fuction will make the totalFee never withdraw.

Risk

Likelihood:

  • Reason 1 // Describe WHEN this will occur (avoid using "if" statements)

  • Reason 2

Impact:

  • Impact 1

  • Impact 2

Proof of Concept

Recommended Mitigation

Replacing totalFees = totalFees + uint64(fee);on 134
with
uint64 newTotalFees = totalFees + uint64(fee); require(newTotalFees >= totalFees, "PuppyRaffle: Overflow occurred"); totalFees = newTotalFees;

Updates

Lead Judging Commences

ai-first-flight-judge Lead Judge about 4 hours 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!