From 06f81d2f41c4f627b2240b66e76b566a4ac47e15 Mon Sep 17 00:00:00 2001 From: Andrew Redden Date: Mon, 20 Nov 2023 15:49:24 -0400 Subject: [PATCH 1/2] ensure the helper will repay all the borrowed tokens/debt/fees --- src/BNPLHelper.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/BNPLHelper.sol b/src/BNPLHelper.sol index c2e1ff31..53b4bddc 100644 --- a/src/BNPLHelper.sol +++ b/src/BNPLHelper.sol @@ -96,10 +96,10 @@ contract BNPLHelper is IFlashLoanRecipient { transfers[i] = AdditionalTransfer({ itemType: ItemType.ERC20, identifier: 0, - token: tokens[0], + token: tokens[i], from: execution.borrower, to: vault, - amount: amounts[0] + feeAmounts[0] + amount: amounts[i] + feeAmounts[i] }); unchecked { ++i; From b64d9252360b7c5027cd55c076a650079efb65c6 Mon Sep 17 00:00:00 2001 From: Andrew Redden Date: Mon, 20 Nov 2023 15:54:36 -0400 Subject: [PATCH 2/2] chore: update snapshot --- .gas-snapshot | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gas-snapshot b/.gas-snapshot index c3263658..4493cd12 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -73,9 +73,9 @@ TestLoanCombinations:testLoan20For721SimpleInterestDutchFixedRepay() (gas: 58727 TestLoanCombinations:testLoan20for20SimpleInterestDutchFixedRepay() (gas: 594461) TestLoanCombinations:testLoan721for20SimpleInterestDutchFixedRepay() (gas: 585469) TestLoanCombinations:testLoanAstariaSettlementRepay() (gas: 575374) -TestNewLoan:testBuyNowPayLater() (gas: 2869909) -TestNewLoan:testInvalidSenderBNPL() (gas: 1613720) -TestNewLoan:testInvalidUserDataHashBNPL() (gas: 1616299) +TestNewLoan:testBuyNowPayLater() (gas: 2869309) +TestNewLoan:testInvalidSenderBNPL() (gas: 1613120) +TestNewLoan:testInvalidUserDataHashBNPL() (gas: 1615699) TestNewLoan:testNewLoanAs1271ProxyAccountSender() (gas: 861457) TestNewLoan:testNewLoanAs1271ProxyAccountThirdPartyFiller() (gas: 871145) TestNewLoan:testNewLoanERC721CollateralDefaultTerms2() (gas: 424965)