The minimum bid increment calculation ensures each new bid is at least 5% higher than the previous bid to maintain competitive bidding.
The calculation performs division before multiplication, causing precision loss for bid amounts not perfectly divisible by 100.
Likelihood:
Occurs for any bid amount not perfectly divisible by 100 wei
Happens frequently since most ETH amounts in wei are large odd numbers
Impact:
Bidders can place lower bids than intended due to rounding down
For small bids (< 100 wei), the required increment becomes 0
Undermines the minimum increment mechanism
This test demonstrates how the division-before-multiplication pattern causes severe precision loss, especially for smaller bid amounts. The issue allows bidders to place much lower bids than the intended 5% increment.
Perform multiplication before division to maintain precision. This ensures the full value is preserved during calculation and only rounds at the final step.
Alternatively, for even better precision with large numbers:
Integer division in requiredAmount truncates fractions, allowing bids slightly lower than intended.
Integer division in requiredAmount truncates fractions, allowing bids slightly lower than intended.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.