From b45a9e331dfea3d81a7826fd9313648ec87aa5ac Mon Sep 17 00:00:00 2001 From: PraneshASP Date: Mon, 15 Apr 2024 11:38:34 +0530 Subject: [PATCH] fix: add min amounts in deposit() --- .../contracts/strategies/AerodromeEthStrategy.sol | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/contracts/contracts/strategies/AerodromeEthStrategy.sol b/contracts/contracts/strategies/AerodromeEthStrategy.sol index 3ac390d6f3..4fa244d3a4 100644 --- a/contracts/contracts/strategies/AerodromeEthStrategy.sol +++ b/contracts/contracts/strategies/AerodromeEthStrategy.sol @@ -212,9 +212,12 @@ contract AerodromeEthStrategy is InitializableAbstractStrategy { IVault(vaultAddress).mintForStrategy(oethToAdd); // adjust for slippage - oethToAdd = oethToAdd.mulTruncate(uint256(1e18) - MAX_SLIPPAGE); - wethToAdd = wethToAdd.mulTruncate(uint256(1e18) - MAX_SLIPPAGE); - + uint256 minOethToAdd = oethToAdd.mulTruncate( + uint256(1e18) - MAX_SLIPPAGE + ); + uint256 minWethToAdd = wethToAdd.mulTruncate( + uint256(1e18) - MAX_SLIPPAGE + ); // Do the deposit to the Aerodrome pool // slither-disable-next-line arbitrary-send (, , uint256 lpReceived) = aeroRouterAddress.addLiquidity( @@ -223,8 +226,8 @@ contract AerodromeEthStrategy is InitializableAbstractStrategy { true, wethToAdd, oethToAdd, - 0, - 0, + minWethToAdd, + minOethToAdd, address(this), block.timestamp );