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

Precision loss

Summary

Incorrect divison will cause presession loss in the buyOutEstateNFT function

uint256 finalAmount = (value / divisor) * multiplier;

POC

uint256 finalAmount = (value / divisor) * multiplier;
value = 10 , divisor = 20 , multiplier = 19
final Amount = 0 // wrong final amount
final Amount = 9.5 // if we do multiplication with some bignmuber before dividing it

But here the assetToPay address need to get 9.5 dollars and instead we are sending 0 which is wrong

Impact - Medium

LikelyHood - Medium

Tools Used

Foundry

Recommendations

Multiply with a big number before dividing it

Updates

Lead Judging Commences

0xtimefliez Lead Judge 4 months ago
Submission Judgement Published
Validated
Assigned finding tags:

truncation of integers

Support

FAQs

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