Skip to content

Commit 1d15617

Browse files
committed
Fixed a mistake in the fee calculation with round up
1 parent 923763f commit 1d15617

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

patterns/flash-loans/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ function flashLoan(
7676
uint256 balanceBefore = token.balanceOf(address(this));
7777
require(balanceBefore >= borrowAmount, 'too much');
7878
// Compute the fee, rounded up.
79-
uint256 fee = FEE_BPS * (borrowAmount + 1e4-1) / 1e4;
79+
uint256 fee = (FEE_BPS * borrowAmount + 1e4-1) / 1e4;
8080
// Transfer tokens to the borrower contract.
8181
token.transfer(address(borrower), borrowAmount);
8282
// Let the borrower do its thing.

0 commit comments

Comments
 (0)