Skip to content

Commit

Permalink
Temporarily switch back 2 safeApproves to approve
Browse files Browse the repository at this point in the history
Openzeppelin has a bug in the safeApprove, we will need to write our own
OpenZeppelin/openzeppelin-contracts#2219
We still use safeApprove in cases where we are sure the subsequent
transferFrom switches the approve balance back to 0.
  • Loading branch information
Daniel Graczer committed Sep 22, 2022
1 parent 292131f commit 7f08fc0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions contracts/strategies/traderjoe/TraderJoe.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
Expand Down

0 comments on commit 7f08fc0

Please sign in to comment.