Skip to content

Commit

Permalink
Move reset allowance code
Browse files Browse the repository at this point in the history
  • Loading branch information
shahthepro committed Oct 30, 2023
1 parent d0fb60f commit 2d6fa59
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions contracts/contracts/buyback/BaseBuyback.sol
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,6 @@ abstract contract BaseBuyback is Initializable, Strategizable {
}

function _setUniswapUniversalRouter(address _router) internal {
if (universalRouter != address(0)) {
// Remove previous router's allowance
// slither-disable-next-line unused-return
IERC20(oToken).approve(universalRouter, 0);
}

universalRouter = _router;

emit UniswapUniversalRouterUpdated(_router);
Expand Down Expand Up @@ -242,6 +236,9 @@ abstract contract BaseBuyback is Initializable, Strategizable {
*/
function safeApproveAllTokens() external onlyGovernorOrStrategist {
IERC20(cvx).safeApprove(cvxLocker, type(uint256).max);
// Remove Router's allowance if any
// slither-disable-next-line unused-return
IERC20(oToken).approve(universalRouter, 0);
}

/**
Expand Down

0 comments on commit 2d6fa59

Please sign in to comment.