Skip to content

Commit

Permalink
πŸ‘· fix: odos unwind swap return (#57)
Browse files Browse the repository at this point in the history
* πŸ‘· fix: odos unwind swap return

* fix

* ✨ fmt

---------

Co-authored-by: Moss <moss@cc.snxdao.io>
  • Loading branch information
Flocqst and moss-eth authored Nov 4, 2024
1 parent bba3dee commit eb5be27
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/Zap.sol
Original file line number Diff line number Diff line change
Expand Up @@ -503,9 +503,12 @@ contract Zap is Reentrancy, Errors, Flush(msg.sender) {
// i.e., USDe -(swap)-> USDC -(repay)-> Aave
// i.e., USDC -(repay)-> Aave
// whatever collateral amount is remaining is returned to the caller
unwound -= _collateral == USDC
? _flashloan
: odosSwap(_collateral, _swapAmountIn, _path);
if (_collateral == USDC) {
unwound -= _flashloan;
} else {
odosSwap(_collateral, _swapAmountIn, _path);
unwound -= _swapAmountIn;
}

/// @notice the path and max amount in must take into consideration:
/// (1) Aave flashloan amount
Expand Down

0 comments on commit eb5be27

Please sign in to comment.