From 0f89df3d7820a3d3c7ed19decdaf7d8517486665 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=9Fingen?= Date: Mon, 9 Sep 2024 10:52:56 +0100 Subject: [PATCH] fix: Move Balancer flash loan receiver reset to main function For better readability (address PR #409 comments). --- .../src/Zappers/Modules/FlashLoans/BalancerFlashLoan.sol | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contracts/src/Zappers/Modules/FlashLoans/BalancerFlashLoan.sol b/contracts/src/Zappers/Modules/FlashLoans/BalancerFlashLoan.sol index 3920f500..0c01ee43 100644 --- a/contracts/src/Zappers/Modules/FlashLoans/BalancerFlashLoan.sol +++ b/contracts/src/Zappers/Modules/FlashLoans/BalancerFlashLoan.sol @@ -46,6 +46,9 @@ contract BalancerFlashLoan is IFlashLoanRecipient, IFlashLoanProvider { receiver = IFlashLoanReceiver(msg.sender); vault.flashLoan(this, tokens, amounts, userData); + + // Reset receiver + receiver = IFlashLoanReceiver(address(0)); } function receiveFlashLoan( @@ -99,8 +102,5 @@ contract BalancerFlashLoan is IFlashLoanRecipient, IFlashLoanProvider { // Return flash loan tokens[0].safeTransfer(address(vault), amounts[0] + feeAmounts[0]); - - // Reset receiver - receiver = IFlashLoanReceiver(address(0)); } }