[M-2] Potential integer overflow in fee calculation for large swap amounts
The fee calculation in _beforeSwap() multiplies two uint values without overflow protection. While Solidity 0.8+ has built-in overflow checks that will cause reverts, the multiplication of swapAmount (uint256) by sellFee (uint24) can overflow for extremely large swap amounts.
When an overflow occurs, the transaction will revert instead of calculating the fee, preventing legitimate large swaps from executing.
Likelihood:
Large swaps approaching type(uint256).max / sellFee will trigger overflow
For sellFee = 3000, overflow occurs when swapAmount > type(uint256).max / 3000
This equals approximately 3.88 × 10^73 tokens, which is unlikely for normal tokens but possible for tokens with very high decimals or large total supplies
Impact:
Legitimate large swaps will revert due to overflow
Prevents whales or large traders from using the protocol
Could be exploited to grief large liquidity operations
Limits the protocol's ability to handle high-value transactions
Creates an artificial ceiling on swap sizes
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.