The buyOrder
function calculates fees using integer division (fee = order.price / 100
), which can result in fees being rounded down to zero for small order amounts. This creates an economic vulnerability where small orders can bypass the fee mechanism entirely.
Loss of Protocol Revenue: Orders with prices less than 100 wei will generate no fees
Economic Imbalance: Incentivizes splitting large orders into multiple small orders to avoid fees
Protocol Sustainability: Reduced fee collection affects protocol maintenance and development
Manual code review
Foundry for testing
Mathematical analysis
Implement a minimum fee amount for all orders
Use basis points (10000) instead of percentage (100) for more precise fee calculations
Consider using fixed-point arithmetic for fee calculations
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.