Improper control over min_expected_amount
allows extreme slippage attacks.
Normally, a swap user expects a reasonable amount of output tokens based on current reserves and pricing formula.
However, the contract allows any user to pass very low or zero min_expected_amount
, bypassing safety.
Likelihood:
Anyone can call swap_tokens
with low min_expected_amount
at any time
A bot or malicious LP can manipulate pool state, then front-run users with unsafe slippage
Impact:
Users may receive near-zero tokens for large inputs (arbitrary loss)
Entire pool can be drained via repeated bad swaps with 0 min
User passes min_expected_amount
= 1 (or 0), receives garbage output, exploits pricing:
Reserve is manipulated to generate poor rate
Swap succeeds, user receives almost nothing back
Enforce dynamic or fixed slippage thresholds, such as:
Also reject any 0 or 1 min_expected_amount
directly.
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.