Bid Beasts

First Flight #49
Beginner FriendlyFoundrySolidityNFT
100 EXP
View results
Submission Details
Severity: medium
Valid

Incorrect bid increment calculation due to precision loss

Root + Impact

Description

In the placeBid() function, the required next bid amount is calculated as:

requiredAmount = (previousBidAmount / 100) * (100 + S_MIN_BID_INCREMENT_PERCENTAGE);

This performs division before multiplication, causing precision loss because Solidity uses integer division (truncation).
As a result, the computed requiredAmount can be lower than intended, allowing bidders to place bids that don’t meet the actual minimum increment requirement.

Risk

Bidders may bypass the intended increment rule and underbid.

Auction integrity is broken since bids smaller than the true X% increment can be accepted.

Sellers lose potential revenue due to invalid lower bids being allowed.

Impact:

Bidders may bypass the intended increment rule and underbid.

Auction integrity is broken since bids smaller than the true X% increment can be accepted.

Sellers lose potential revenue due to invalid lower bids being allowed.

Proof of Concept

previousBidAmount = 101

S_MIN_BID_INCREMENT_PERCENTAGE = 5 (require 105% of last bid).

Vulnerable formula: (101 / 100) * 105 = 105.

Correct formula: (101 * 105) / 100 = 106.

A malicious bidder can submit 105 (instead of 106), bypassing the increment rule.

Recommended Mitigation

Always multiply before dividing to avoid precision truncation.

requiredAmount = (previousBidAmount * (100 + S_MIN_BID_INCREMENT_PERCENTAGE)) / 100;

This ensures proper calculation of the minimum next bid without rounding errors.

Updates

Lead Judging Commences

cryptoghost Lead Judge about 1 month ago
Submission Judgement Published
Validated
Assigned finding tags:

BidBeasts Marketplace: Integer Division Precision Loss

Integer division in requiredAmount truncates fractions, allowing bids slightly lower than intended.

Support

FAQs

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