The contract calculates protocol fees using a simple percentage-based system with 3% fee and 100 precision, designed to charge sellers a reasonable commission on successful trades.
The fee calculation is vulnerable to integer overflow when multiplying large price values, and the low precision creates rounding issues for small amounts, enabling both fee manipulation attacks and order book spam.
Likelihood:
Attackers discover the integer overflow vulnerability and create orders with prices near uint256 maximum to exploit fee calculation
Users create legitimate small-value orders that suffer from precision loss due to the low PRECISION constant
Malicious actors spam the order book with economically nonsensical orders (tiny amounts at maximum prices) to disrupt legitimate trading
Impact:
Protocol loses significant fee revenue when overflow causes fee calculations to wrap around to near-zero values
Order book becomes cluttered with spam orders that waste gas and storage, degrading user experience
Small legitimate orders may have their fees rounded down to zero, creating unfair trading conditions
Attack costs are minimal (only gas) while potential gains from avoiding fees on large trades are substantial
Increase precision and reasonable bounds.
Protocol Suffers Potential Revenue Leakage due to Precision Loss in Fee Calculation
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.