diff --git a/contracts/contracts/strategies/ConvexEthMetaStrategy.sol b/contracts/contracts/strategies/ConvexEthMetaStrategy.sol index 525e338a9e..16ed6426df 100644 --- a/contracts/contracts/strategies/ConvexEthMetaStrategy.sol +++ b/contracts/contracts/strategies/ConvexEthMetaStrategy.sol @@ -163,6 +163,7 @@ contract ConvexEthMetaStrategy is InitializableAbstractStrategy { override onlyVault nonReentrant + improveMetapoolBalance { _deposit(_weth, _amount); } @@ -235,7 +236,13 @@ contract ConvexEthMetaStrategy is InitializableAbstractStrategy { /** * @notice Deposit the strategy's entire balance of WETH into the Curve Metapool */ - function depositAll() external override onlyVault nonReentrant { + function depositAll() + external + override + onlyVault + nonReentrant + improveMetapoolBalance + { uint256 balance = weth.balanceOf(address(this)); if (balance > 0) { _deposit(address(weth), balance); @@ -257,7 +264,7 @@ contract ConvexEthMetaStrategy is InitializableAbstractStrategy { address _recipient, address _weth, uint256 _amount - ) external override onlyVault nonReentrant { + ) external override onlyVault nonReentrant improveMetapoolBalance { require(_amount > 0, "Invalid amount"); require(_weth == address(weth), "Can only withdraw WETH"); @@ -324,7 +331,13 @@ contract ConvexEthMetaStrategy is InitializableAbstractStrategy { * @notice Remove all ETH and OETH from the Metapool, burn the OETH, * convert the ETH to WETH and transfer to the Vault contract. */ - function withdrawAll() external override onlyVaultOrGovernor nonReentrant { + function withdrawAll() + external + override + onlyVaultOrGovernor + nonReentrant + improveMetapoolBalance + { uint256 gaugeTokens = cvxRewardStaker.balanceOf(address(this)); _lpWithdraw(gaugeTokens); @@ -373,8 +386,8 @@ contract ConvexEthMetaStrategy is InitializableAbstractStrategy { function mintAndAddOTokens(uint256 _oTokens) external onlyStrategist - improveMetapoolBalance nonReentrant + improveMetapoolBalance { IVault(vaultAddress).mintForStrategy(_oTokens); @@ -417,8 +430,8 @@ contract ConvexEthMetaStrategy is InitializableAbstractStrategy { function removeAndBurnOTokens(uint256 _lpTokens) external onlyStrategist - improveMetapoolBalance nonReentrant + improveMetapoolBalance { // Withdraw Metapool LP tokens from Convex and remove OTokens from the Metapool uint256 oethToBurn = _withdrawAndRemoveFromPool( @@ -452,8 +465,8 @@ contract ConvexEthMetaStrategy is InitializableAbstractStrategy { function removeOnlyAssets(uint256 _lpTokens) external onlyStrategist - improveMetapoolBalance nonReentrant + improveMetapoolBalance { // Withdraw Metapool LP tokens from Convex and remove ETH from the Metapool uint256 ethAmount = _withdrawAndRemoveFromPool(_lpTokens, ethCoinIndex);