From f3784cb1c669592f8b08d09a7c505b66d2939a4f Mon Sep 17 00:00:00 2001 From: Daniel Graczer Date: Thu, 22 Sep 2022 15:04:01 +0700 Subject: [PATCH] Temporarily switch back 2 safeApproves to approve Openzeppelin has a bug in the safeApprove, we will need to write our own https://github.com/OpenZeppelin/openzeppelin-contracts/issues/2219 We still use safeApprove in cases where we are sure the subsequent transferFrom switches the approve balance back to 0. --- contracts/strategies/traderjoe/TraderJoe.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/strategies/traderjoe/TraderJoe.sol b/contracts/strategies/traderjoe/TraderJoe.sol index 76bf1bdd..2036dbc5 100644 --- a/contracts/strategies/traderjoe/TraderJoe.sol +++ b/contracts/strategies/traderjoe/TraderJoe.sol @@ -94,11 +94,11 @@ contract TraderJoe is UUPSUpgradeable, StrategyOwnablePausableBaseUpgradeable { ); uint256 depositTokenDesired = amount - swapAmount; - strategyStorage.pairDepositToken.safeApprove( + strategyStorage.pairDepositToken.approve( address(strategyStorage.router), pairDepositTokenDesired ); - depositToken.safeApprove( + depositToken.approve( address(strategyStorage.router), depositTokenDesired );