Skip to content

Commit

Permalink
Removed redundant approve
Browse files Browse the repository at this point in the history
  • Loading branch information
asselstine committed Jul 20, 2021
1 parent 12c1fb5 commit e478a58
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions contracts/yield-source/YearnV2YieldSource.sol
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,6 @@ contract YearnV2YieldSource is IYieldSource, ERC20Upgradeable, OwnableUpgradeabl
IYVaultV2 v = vault; // NOTE: for gas usage
IERC20Upgradeable _token = token;

if (_token.allowance(address(this), address(v)) < _token.balanceOf(address(this))) {
_token.safeApprove(address(v), type(uint256).max);
}

// this will deposit full balance (for cases like not enough room in Vault)
return v.deposit();
}
Expand Down

0 comments on commit e478a58

Please sign in to comment.