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

Loss of fee decimals on round fee calculation

Summary

THe contract calculates fee and prizePool seperately using their percentages. This causes small loss of wei as the contracts does not support decimals

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

Vulnerability Details

Smart Contracts does not have decimals. so when getting a percentage of values, there are decimal losses. Calculating the fee as 20% of the totalCollected will cause these lost decimals to be stuck in the contract.

Recommendations

calculate fee as totalAmountCollected - prizePool to keep all the wei

Updates

Lead Judging Commences

patrickalphac Lead Judge
over 1 year ago
hexbyte Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Other
Assigned finding tags:

loss of precision

like 1 wei

Support

FAQs

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