Beginner FriendlyFoundryNFT
100 EXP
View results
Submission Details
Severity: low
Valid

mul without overflow check

Summary

There is a potential issue where exceeding the enterRaffle function's requirements can result from the combination of msg.value and entranceFee * newPlayers.length, possibly leading to an overflow. This issue needs attention to ensure accurate raffle entry and financial integrity.

POC

function testEnterRaffleOverflow() public { uint256 _entraceFee = (type(uint256).max / 2) + 1; PuppyRaffle tempPuppyRaffle = new PuppyRaffle(_entraceFee, feeAddress, duration); address[] memory players = new address[](2); players[0] = playerOne; players[1] = playerTwo; tempPuppyRaffle.enterRaffle(players); }

Recommendations

change sol version to at least 0.8.0

Updates

Lead Judging Commences

Hamiltonite Lead Judge almost 2 years ago
Submission Judgement Published
Validated
Assigned finding tags:

entrance fee can overflow (* # of players)

You'd have to have a TON of money for this to happen. IMPACT: HIGH LIKELIHOOD: VERY LOW

Support

FAQs

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