The swap function in the smart contract contains a logical issue in the _minOut
validation. The condition require(_minOut > _amountClaim, "minOut too low");
ensures _minOut
exceeds _amountClaim
but may be unnecessarily restrictive. This could disrupt transactions where exact equality is acceptable.
https://github.com/Cyfrin/2024-12-alchemix/blob/main/src/StrategyMainnet.sol#L99C9-L100C1
The current implementation enforces a strict inequality:
This logic does not allow for cases where _minOut == _amountClaim
, potentially preventing valid swaps where the output equals the claimed amount, especially in tightly constrained market conditions.
It prevents swaps where no profit is possible but breaking even is acceptable.
Legitimate swaps may fail, especially in low-slippage scenarios.
Reduces the usability of the contract for traders seeking to avoid losses rather than guarantee profit.
Manual review
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.