DeFiFoundrySolidity
16,653 OP
View results
Submission Details
Severity: low
Invalid

Issue with `_minOut` condition in `claimAndSwap` function

Summary

The claimAndSwap function in the StrategyMainnet contract contains a requirement that the _minOut parameter must be greater than _amountClaim:

require(_minOut > _amountClaim, "minOut too low");

This constraint can lead to unintended behavior, as the price of alETH (the synthetic asset) and WETH (the underlying token) can often be the same (1:1) since both represent Ether. In such cases, there is no economic loss; however, the transaction would still revert due to the _minOut > _amountClaim condition. This unnecessarily blocks valid swaps.

https://github.com/Cyfrin/2024-12-alchemix/blob/82798f4891e41959eef866bd1d4cb44fc1e26439/src/StrategyMainnet.sol#L99

https://github.com/Cyfrin/2024-12-alchemix/blob/82798f4891e41959eef866bd1d4cb44fc1e26439/src/StrategyArb.sol#L84

https://github.com/Cyfrin/2024-12-alchemix/blob/82798f4891e41959eef866bd1d4cb44fc1e26439/src/StrategyOp.sol#L98

Vulnerability Details

The contract assumes that the output of the swap (_minOut) must be strictly greater than the input (_amountClaim). However, this assumption does not account for scenarios where:

  1. alETH and WETH are priced equally (1:1): Both represent Ether, and parity swaps are common.

  2. Swaps occur at parity (1:1): These should not be considered a loss, but the current requirement blocks such transactions.

If _minOut is equal to _amountClaim, the transaction reverts, preventing valid execution where no loss occurs.

Impact

  1. Blocks valid swaps where the output is equal to the input (1:1 parity).

  2. Prevents efficient strategy execution in cases where parity swaps are operationally necessary.

  3. Increases the risk of missed opportunities or inefficient behavior in certain market conditions.

Tools Used

Recommendations

Adjust the Condition for Valid Swaps:
Modify the requirement to allow swaps at parity. For example:

require(_minOut >= _amountClaim, "minOut too low");

This change permits parity swaps, ensuring valid transactions are not blocked.

Updates

Appeal created

inallhonesty Lead Judge 5 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
inallhonesty Lead Judge 5 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.