Skip to content

Commit

Permalink
👷 add pay to unwindCollateralETH
Browse files Browse the repository at this point in the history
  • Loading branch information
cmontecoding committed Dec 14, 2024
1 parent 57b3ce9 commit 66d08aa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Engine.sol
Original file line number Diff line number Diff line change
Expand Up @@ -517,8 +517,8 @@ contract Engine is
uint256 balanceAfter = WETH.balanceOf(address(this));
uint256 receivedAmount = balanceAfter - balanceBefore;

// Convert WETH to ETH and send to user
WETH.withdrawTo(msg.sender, receivedAmount);
WETH.approve(address(pay), receivedAmount);
pay.unwrapAndPay(receivedAmount, msg.sender);
}

/// @inheritdoc IEngine
Expand Down

0 comments on commit 66d08aa

Please sign in to comment.