Summary
The StrategyArb
contract is intended to perform token swaps at a premium, ensuring that the value of the output token is greater than the input token. However, the current implementation lacks a built-in mechanism to guarantee this premium, relying instead on the caller to set the minimum output parameter (_minOut
) correctly. This report identifies the potential issue and provides recommendations for mitigation.
In the claimAndSwap
and _swapUnderlyingToAsset
functions of the StrategyArb.sol
contract contains a logic issue, the main issue is the reliance on the caller to set _minOut
without any internal checks to ensure a premium swap.
claimAndSwap
Function:
_swapUnderlyingToAsset
Function:
Without a mechanism to ensure a premium swap, the contract may execute swaps at unfavorable rates, potentially leading to financial losses. The reliance on the caller to set _minOut
correctly introduces the risk of human error or manipulation, which could result in swaps being executed at a loss.
Manual code review
Integrate Price Oracles:
Use a price oracle to fetch current market rates for WETH and alETH. This can help dynamically calculate the appropriate _minOut
value to ensure a premium swap.
Implement Price Checks:
Add logic to compare the value of the assets being swapped, rather than just their quantities. This can involve checking the current market price and ensuring the swap rate is better than 1:1.
Automate _minOut
Calculation:
Automate the calculation of _minOut
based on real-time market data to reduce reliance on the caller and minimize the risk of human error.
Add Additional Safeguards:
Implement additional checks or constraints to ensure that swaps are only executed when favorable conditions are met, such as a minimum premium threshold.
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.