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

Withdraw fee Issue

Summary

Vulnerability Details

In withdrawFees function
require(address(this).balance == uint256(totalFees), "PuppyRaffle: There are currently players active!");

here the contract balance might not be same as totalFees, because totalFees is calculated as follows.

     uint256 prizePool = (totalAmountCollected * 80) / 100;
    uint256 fee = (totalAmountCollected * 20) / 100; 
    totalFees = totalFees + uint64(fee); /* 

Convertion of uint256 to uint64 might chop the data

Impact

Tools Used

Foundry
Git
Manual review

Recommendations

Updates

Lead Judging Commences

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

greifers-send-money-to-contract-to-block-withdrawfees

Support

FAQs

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