The claimAndSwap function relies on swapUnderlyingToAsset to swap tokens. However, the condition in _swapUnderlyingToAsset:
is flawed and may prevent valid swaps. This issue can cause the claimAndSwap function to fail unnecessarily, especially when the output token is of lower value or a different denomination compared to the input token.
The problematic condition in _swapUnderlyingToAsset enforces that minOut must always be greater than _amount. This logic assumes that the output token will always have a higher or equal value to the input token, which is not universally true.
Pegged tokens like WETH and ALETH, which are designed to have a 1:1 value relationship, should allow equal-value swaps without requiring a premium. However, the current logic in the code enforces that minOut > _amount, which unnecessarily blocks valid 1:1 swaps (e.g., swapping 10 WETH for 10 ALETH). This restriction can result in failed transactions even when the swap is fair and aligns with the pegged value. Furthermore, if the protocol's intention is to enforce a premium for swaps, this behavior should be explicitly documented to avoid confusion, as it contradicts the expected 1:1 pegged behavior
The unnecessary restriction on 1:1 swaps can lead to failed transactions, disrupting protocol usability and potentially causing inefficiencies or user dissatisfaction.
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.