Pieces Protocol

First Flight #32
Beginner FriendlyFoundrySolidityNFT
100 EXP
View results
Submission Details
Severity: low
Valid

Incorrect Fee Calculation

Summary:The buyOrder function calculates fees using integer division, which can result in a fee of 0 for small order prices

Vulnerability Details

uint256 fee = order.price / 100;
uint256 sellerFee = fee / 2;

Impact:errors could result in incorrect fees being deducted.

Tools Used:Manual code review

Recommendations:Implement percentage-based calculations with proper rounding

uint256 fee = (order.price * 100) / 10000; // 1% fee
uint256 sellerFee = fee / 2;
Updates

Lead Judging Commences

fishy Lead Judge 5 months ago
Submission Judgement Published
Validated
Assigned finding tags:

Precision loss

Support

FAQs

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