From 3932609a2ed19b23d0b8d67877915157494918aa Mon Sep 17 00:00:00 2001 From: 0xdapper <0xdapp@protonmail.com> Date: Mon, 13 Mar 2023 18:32:05 +0000 Subject: [PATCH] add comment re swapper calls --- lib/solady | 2 +- src/Unwind.sol | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/solady b/lib/solady index 2b69b66..3d57528 160000 --- a/lib/solady +++ b/lib/solady @@ -1 +1 @@ -Subproject commit 2b69b665decfbd23ac1fb0f028588e8e76ef4059 +Subproject commit 3d57528984275d1746ee6597acd36277f51c091d diff --git a/src/Unwind.sol b/src/Unwind.sol index 12cf117..1ded60e 100644 --- a/src/Unwind.sol +++ b/src/Unwind.sol @@ -124,6 +124,10 @@ contract Unwind is IFlashLoanRecipient, IFlashLoanSimpleReceiver { // swap the collateral for debt token uint totalRepay = _flashBorrowedAmount + _flashBorrowFee; ERC20(_collToken).safeApprove(_swapper, _collToWithdraw); + // VERY open. Make sure you don't leave any pending token approvals + // credit delegations or tokens on this contract. + // Revoke after use or approve only required amounts that will + // exhaust all of the approved amount. (bool success, ) = _swapper.call(_swapData); if (ERC20(_debtToken).balanceOf(address(this)) < totalRepay) revert InsufficientOutput(