Skip to content

Commit

Permalink
fix: Move Balancer flash loan receiver reset to main function
Browse files Browse the repository at this point in the history
For better readability (address PR #409 comments).
  • Loading branch information
bingen committed Sep 9, 2024
1 parent 86b2e94 commit 0f89df3
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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));
}
}

0 comments on commit 0f89df3

Please sign in to comment.