Skip to content

Commit

Permalink
allow auto redemption of eth
Browse files Browse the repository at this point in the history
  • Loading branch information
ewansheldon committed Dec 9, 2024
1 parent a03351f commit cc452b1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions contracts/SmartVaultV4.sol
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,10 @@ contract SmartVaultV4 is ISmartVault, IRedeemable {
_withdrawn = ISmartVaultYieldManager(_yieldManager).quickWithdraw(_hypervisor, _collateralToken);
IERC20(_hypervisor).forceApprove(_yieldManager, 0);
}
if (_collateralToken == address(0)) {
_collateralToken = ISmartVaultManager(manager).weth();
IWETH(_collateralToken).deposit{value: address(this).balance}();
}
swapCollateral(_swapRouterAddress, _quoterAddress, _collateralToken, _swapPath, _USDCTargetAmount);
_redeemed = USDs.balanceOf(address(this));
minted -= _redeemed;
Expand Down

0 comments on commit cc452b1

Please sign in to comment.