Skip to content

Commit

Permalink
use approve instead of safeApprove for WETH
Browse files Browse the repository at this point in the history
  • Loading branch information
sparrowDom committed Oct 7, 2024
1 parent c7346e6 commit 1321f22
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -555,8 +555,7 @@ contract AerodromeAMOStrategy is InitializableAbstractStrategy {

// approve the specific amount of WETH required
if (_swapWeth) {
IERC20(WETH).safeApprove(address(swapRouter), 0);
IERC20(WETH).safeApprove(address(swapRouter), _amountToSwap);
IERC20(WETH).approve(address(swapRouter), _amountToSwap);

Check warning on line 558 in contracts/contracts/strategies/aerodrome/AerodromeAMOStrategy.sol

View check run for this annotation

Codecov / codecov/patch

contracts/contracts/strategies/aerodrome/AerodromeAMOStrategy.sol#L558

Added line #L558 was not covered by tests
}

// Swap it
Expand Down Expand Up @@ -631,8 +630,7 @@ contract AerodromeAMOStrategy is InitializableAbstractStrategy {
}

// approve the specific amount of WETH required
IERC20(WETH).safeApprove(address(positionManager), 0);
IERC20(WETH).safeApprove(address(positionManager), _wethBalance);
IERC20(WETH).approve(address(positionManager), _wethBalance);

Check warning on line 633 in contracts/contracts/strategies/aerodrome/AerodromeAMOStrategy.sol

View check run for this annotation

Codecov / codecov/patch

contracts/contracts/strategies/aerodrome/AerodromeAMOStrategy.sol#L633

Added line #L633 was not covered by tests

uint256 _wethAmountSupplied;
uint256 _oethbAmountSupplied;
Expand Down Expand Up @@ -907,8 +905,8 @@ contract AerodromeAMOStrategy is InitializableAbstractStrategy {
* un-approving WETH to the swapRouter & positionManager and only approving
* the required amount before a transaction
*/
IERC20(WETH).safeApprove(address(swapRouter), 0);
IERC20(WETH).safeApprove(address(positionManager), 0);
IERC20(WETH).approve(address(swapRouter), 0);
IERC20(WETH).approve(address(positionManager), 0);

Check warning on line 909 in contracts/contracts/strategies/aerodrome/AerodromeAMOStrategy.sol

View check run for this annotation

Codecov / codecov/patch

contracts/contracts/strategies/aerodrome/AerodromeAMOStrategy.sol#L908-L909

Added lines #L908 - L909 were not covered by tests
}

/***************************************
Expand Down

0 comments on commit 1321f22

Please sign in to comment.