Skip to content

Commit

Permalink
update order of operations to account for changes to the applyRefinan…
Browse files Browse the repository at this point in the history
…ceConsiderationToLoan method accessing memory directly
  • Loading branch information
androolloyd committed Nov 20, 2023
1 parent 942b8b8 commit a4cd30b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions .gas-snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ IntegrationTestCaveats:testOriginateWCaveatsIncrementedNonce() (gas: 166170)
IntegrationTestCaveats:testOriginateWCaveatsInvalidSalt() (gas: 281363)
IntegrationTestCaveats:testOriginateWCaveatsInvalidSaltManual() (gas: 140101)
IntegrationTestCaveats:testOriginateWLenderApproval() (gas: 281057)
IntegrationTestCaveats:testRefinanceAsLender() (gas: 1043304)
IntegrationTestCaveats:testRefinanceCaveatFailure() (gas: 395363)
IntegrationTestCaveats:testRefinanceAsLender() (gas: 1043289)
IntegrationTestCaveats:testRefinanceCaveatFailure() (gas: 395348)
IntegrationTestCaveats:testRefinanceLoanStartAtBlockTimestampInvalidLoan() (gas: 342963)
IntegrationTestCaveats:testRefinanceUnapprovedFulfiller() (gas: 443639)
IntegrationTestCaveats:testRefinanceWCaveatsInvalidSalt() (gas: 364745)
IntegrationTestCaveats:testRefinanceWLenderApproval() (gas: 392364)
IntegrationTestCaveats:testRefinanceUnapprovedFulfiller() (gas: 443624)
IntegrationTestCaveats:testRefinanceWCaveatsInvalidSalt() (gas: 364730)
IntegrationTestCaveats:testRefinanceWLenderApproval() (gas: 392349)
ModuleTesting:testFixedTermDutchAuctionSettlement() (gas: 433475)
ModuleTesting:testFixedTermDutchAuctionSettlementGetSettlementAuctionExpired() (gas: 436253)
ModuleTesting:testFixedTermDutchAuctionSettlementNotValid() (gas: 432487)
Expand Down Expand Up @@ -79,7 +79,7 @@ TestNewLoan:testInvalidUserDataHashBNPL() (gas: 1616299)
TestNewLoan:testNewLoanAs1271ProxyAccountSender() (gas: 861457)
TestNewLoan:testNewLoanAs1271ProxyAccountThirdPartyFiller() (gas: 871145)
TestNewLoan:testNewLoanERC721CollateralDefaultTerms2() (gas: 424965)
TestNewLoan:testNewLoanRefinance() (gas: 577299)
TestNewLoan:testNewLoanRefinance() (gas: 577284)
TestNewLoan:testNewLoanViaOriginatorBorrowerApprovalAndLenderApproval() (gas: 325441)
TestNewLoan:testNewLoanViaOriginatorLenderApproval() (gas: 382057)
TestNewLoan:testSettleLoan() (gas: 636584)
Expand All @@ -99,7 +99,7 @@ TestSimpleInterestPricing:test_getRefinanceConsideration() (gas: 937602)
TestStarport:testActive() (gas: 69225)
TestStarport:testAdditionalTransfers() (gas: 298383)
TestStarport:testAdditionalTransfersOriginate() (gas: 273101)
TestStarport:testAdditionalTransfersRefinance() (gas: 211152)
TestStarport:testAdditionalTransfersRefinance() (gas: 211137)
TestStarport:testApplyRefinanceConsiderationToLoanMalformed() (gas: 129578)
TestStarport:testCannotIssueSameLoanTwice() (gas: 359427)
TestStarport:testCannotOriginateWhilePaused() (gas: 73501)
Expand All @@ -114,7 +114,7 @@ TestStarport:testExoticDebtWithNoCaveatsNotAsBorrower() (gas: 374504)
TestStarport:testIncrementCaveatNonce() (gas: 35252)
TestStarport:testInitializedFlagSetProperly() (gas: 67349)
TestStarport:testInvalidAdditionalTransfersOriginate() (gas: 228054)
TestStarport:testInvalidAdditionalTransfersRefinance() (gas: 163805)
TestStarport:testInvalidAdditionalTransfersRefinance() (gas: 163790)
TestStarport:testInvalidAmountCollateral() (gas: 163619)
TestStarport:testInvalidAmountCollateral721() (gas: 163552)
TestStarport:testInvalidItemType() (gas: 149567)
Expand Down
4 changes: 2 additions & 2 deletions src/Starport.sol
Original file line number Diff line number Diff line change
Expand Up @@ -209,13 +209,13 @@ contract Starport is PausableNonReentrant {

_settle(loan);
_postRepaymentExecute(loan, msg.sender);
loan.debt = applyRefinanceConsiderationToLoan(considerationPayment, carryPayment);
loan.terms.pricingData = pricingData;

StarportLib.transferSpentItems(considerationPayment, lender, loan.issuer, false);
if (carryPayment.length > 0) {
StarportLib.transferSpentItems(carryPayment, lender, loan.originator, false);
}
loan.debt = applyRefinanceConsiderationToLoan(considerationPayment, carryPayment);
loan.terms.pricingData = pricingData;

loan.issuer = lender;
loan.originator = address(0);
Expand Down

0 comments on commit a4cd30b

Please sign in to comment.