Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

safeApprove of openZeppelin is deprecated #28

Closed
code423n4 opened this issue Dec 9, 2021 · 1 comment
Closed

safeApprove of openZeppelin is deprecated #28

code423n4 opened this issue Dec 9, 2021 · 1 comment
Labels
1 (Low Risk) Assets are not at risk. State handling, function incorrect as to spec, issues with comments bug Something isn't working duplicate This issue or pull request already exists

Comments

@code423n4
Copy link
Contributor

Handle

robee

Vulnerability details

You use safeApprove of openZeppelin although it's deprecated.
(see https://github.com/OpenZeppelin/openzeppelin-contracts/blob/566a774222707e424896c0c390a84dc3c13bdcb2/contracts/token/ERC20/utils/SafeERC20.sol#L38)
You should change it to increase/decrease Allowance as OpenZeppilin says.
This appears in the following locations in the code base:

    Deprecated safeApprove in CreditLine.sol line 646: IERC20(_collateralAsset).approve(_strategy, _amount); 
    Deprecated safeApprove in CreditLine.sol line 774: IERC20(_borrowAsset).approve(_defaultStrategy, _amount); 
    Deprecated safeApprove in Controller.sol line 195: IERC20(_token).safeApprove(onesplit, 0); 
    Deprecated safeApprove in Controller.sol line 196: IERC20(_token).safeApprove(onesplit, _amount); 
    Deprecated safeApprove in Strategy.sol line 41: // IERC20(token).approve(mcd_join_eth_a, uint256(-1)); 
    Deprecated safeApprove in SavingsAccount.sol line 171: IERC20(_token).safeApprove(_newStrategy, _tokensReceived); 
    Deprecated safeApprove in SavingsAccountUtil.sol line 60: IERC20(_token).safeApprove(_approveTo, _amount); 
    Deprecated safeApprove in AaveYield.sol line 293: IERC20(asset).approve(lendingPool, 0); 
    Deprecated safeApprove in AaveYield.sol line 294: IERC20(asset).approve(lendingPool, amount); 
    Deprecated safeApprove in AaveYield.sol line 303: IERC20(IWETHGateway(wethGateway).getAWETHAddress()).approve(wethGateway, amount); 
    Deprecated safeApprove in AaveYield.sol line 320: IERC20(aToken).approve(lendingPool, amount); 
    Deprecated safeApprove in CompoundYield.sol line 207: IERC20(asset).approve(cToken, 0); 
    Deprecated safeApprove in CompoundYield.sol line 208: IERC20(asset).approve(cToken, amount); 
    Deprecated safeApprove in YearnYield.sol line 206: IERC20(asset).approve(vault, 0); 
    Deprecated safeApprove in YearnYield.sol line 207: IERC20(asset).approve(vault, amount); 
@code423n4 code423n4 added 1 (Low Risk) Assets are not at risk. State handling, function incorrect as to spec, issues with comments bug Something isn't working labels Dec 9, 2021
code423n4 added a commit that referenced this issue Dec 9, 2021
@ritik99 ritik99 added the duplicate This issue or pull request already exists label Dec 25, 2021
@ritik99
Copy link
Collaborator

ritik99 commented Dec 25, 2021

Duplicate of #2

@ritik99 ritik99 marked this as a duplicate of #2 Dec 25, 2021
@ritik99 ritik99 closed this as completed Dec 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 (Low Risk) Assets are not at risk. State handling, function incorrect as to spec, issues with comments bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants