Skip to content

Commit

Permalink
add optimizations for changing loan state, remove double encoding of …
Browse files Browse the repository at this point in the history
…data
  • Loading branch information
androolloyd committed Nov 18, 2023
1 parent 7644548 commit 5ce193a
Show file tree
Hide file tree
Showing 7 changed files with 170 additions and 138 deletions.
216 changes: 108 additions & 108 deletions .gas-snapshot
Original file line number Diff line number Diff line change
@@ -1,144 +1,144 @@
IntegrationTestCaveats:testOriginateUnapprovedFulfiller() (gas: 369661)
IntegrationTestCaveats:testOriginateWBorrowerApproval() (gas: 323396)
IntegrationTestCaveats:testOriginateWCaveats() (gas: 297490)
IntegrationTestCaveats:testOriginateWCaveatsExpired() (gas: 177232)
IntegrationTestCaveats:testOriginateWCaveatsIncrementedNonce() (gas: 205798)
IntegrationTestCaveats:testOriginateWCaveatsInvalidSalt() (gas: 303741)
IntegrationTestCaveats:testOriginateWCaveatsInvalidSaltManual() (gas: 179719)
IntegrationTestCaveats:testOriginateWLenderApproval() (gas: 323472)
IntegrationTestCaveats:testRefinanceAsLender() (gas: 1088486)
IntegrationTestCaveats:testRefinanceCaveatFailure() (gas: 437593)
IntegrationTestCaveats:testRefinanceLoanStartAtBlockTimestampInvalidLoan() (gas: 384839)
IntegrationTestCaveats:testRefinanceUnapprovedFulfiller() (gas: 495473)
IntegrationTestCaveats:testRefinanceWCaveatsInvalidSalt() (gas: 414240)
IntegrationTestCaveats:testRefinanceWLenderApproval() (gas: 437569)
ModuleTesting:testFixedTermDutchAuctionSettlement() (gas: 436235)
ModuleTesting:testFixedTermDutchAuctionSettlementGetSettlementAuctionExpired() (gas: 439102)
ModuleTesting:testFixedTermDutchAuctionSettlementNotValid() (gas: 435225)
ModuleTesting:testFixedTermDutchAuctionSettlementValid() (gas: 436046)
ModuleTesting:testModuleValidation() (gas: 1272876)
IntegrationTestCaveats:testOriginateUnapprovedFulfiller() (gas: 327463)
IntegrationTestCaveats:testOriginateWBorrowerApproval() (gas: 281035)
IntegrationTestCaveats:testOriginateWCaveatsAsBorrower() (gas: 303196)
IntegrationTestCaveats:testOriginateWCaveatsExpired() (gas: 157332)
IntegrationTestCaveats:testOriginateWCaveatsIncrementedNonce() (gas: 166063)
IntegrationTestCaveats:testOriginateWCaveatsInvalidSalt() (gas: 281280)
IntegrationTestCaveats:testOriginateWCaveatsInvalidSaltManual() (gas: 139941)
IntegrationTestCaveats:testOriginateWLenderApproval() (gas: 281111)
IntegrationTestCaveats:testRefinanceAsLender() (gas: 1043639)
IntegrationTestCaveats:testRefinanceCaveatFailure() (gas: 395726)
IntegrationTestCaveats:testRefinanceLoanStartAtBlockTimestampInvalidLoan() (gas: 342926)
IntegrationTestCaveats:testRefinanceUnapprovedFulfiller() (gas: 450960)
IntegrationTestCaveats:testRefinanceWCaveatsInvalidSalt() (gas: 372181)
IntegrationTestCaveats:testRefinanceWLenderApproval() (gas: 392766)
ModuleTesting:testFixedTermDutchAuctionSettlement() (gas: 433859)
ModuleTesting:testFixedTermDutchAuctionSettlementGetSettlementAuctionExpired() (gas: 436726)
ModuleTesting:testFixedTermDutchAuctionSettlementNotValid() (gas: 432849)
ModuleTesting:testFixedTermDutchAuctionSettlementValid() (gas: 433670)
ModuleTesting:testModuleValidation() (gas: 1270500)
PausableNonReentrantImpl:test() (gas: 2442)
PausableNonReentrantImpl:testReentrancy() (gas: 2735)
TestBorrowerEnforcer:testBERevertAdditionalTransfers() (gas: 75686)
TestBorrowerEnforcer:testBERevertInvalidLoanTerms() (gas: 80961)
TestBorrowerEnforcer:testBEValidLoanTerms() (gas: 72045)
TestBorrowerEnforcer:testBEValidLoanTermsAnyIssuer() (gas: 72109)
TestCustodian:testCannotLazyMintTwice() (gas: 78796)
TestBorrowerEnforcer:testBERevertAdditionalTransfers() (gas: 75878)
TestBorrowerEnforcer:testBERevertInvalidLoanTerms() (gas: 81153)
TestBorrowerEnforcer:testBEValidLoanTerms() (gas: 72237)
TestBorrowerEnforcer:testBEValidLoanTermsAnyIssuer() (gas: 72301)
TestCustodian:testCannotLazyMintTwice() (gas: 78788)
TestCustodian:testCannotMintInvalidLoanInvalidCustodian() (gas: 69031)
TestCustodian:testCannotMintInvalidLoanValidCustodian() (gas: 74555)
TestCustodian:testCannotMintInvalidLoanValidCustodian() (gas: 74547)
TestCustodian:testCustodySelector() (gas: 2908178)
TestCustodian:testDefaultCustodySelectorRevert() (gas: 72312)
TestCustodian:testGenerateOrderInvalidPostRepayment() (gas: 173324)
TestCustodian:testGenerateOrderInvalidPostSettlement() (gas: 163179)
TestCustodian:testGenerateOrderRepay() (gas: 177479)
TestCustodian:testGenerateOrderRepayAsRepayApprovedBorrower() (gas: 193948)
TestCustodian:testGenerateOrderRepayERC1155AndERC20() (gas: 874228)
TestCustodian:testGenerateOrderRepayERC1155AndERC20HandlerAuthorized() (gas: 803621)
TestCustodian:testGenerateOrderInvalidPostRepayment() (gas: 173178)
TestCustodian:testGenerateOrderInvalidPostSettlement() (gas: 163033)
TestCustodian:testGenerateOrderRepay() (gas: 177333)
TestCustodian:testGenerateOrderRepayAsRepayApprovedBorrower() (gas: 193802)
TestCustodian:testGenerateOrderRepayERC1155AndERC20() (gas: 868811)
TestCustodian:testGenerateOrderRepayERC1155AndERC20HandlerAuthorized() (gas: 798204)
TestCustodian:testGenerateOrderRepayInvalidHookAddress() (gas: 97601)
TestCustodian:testGenerateOrderRepayInvalidHookReturnType() (gas: 91984)
TestCustodian:testGenerateOrderRepayNotBorrower() (gas: 106839)
TestCustodian:testGenerateOrderSettlement() (gas: 154934)
TestCustodian:testGenerateOrderSettlementHandlerAuthorized() (gas: 160331)
TestCustodian:testGenerateOrderSettlementNoActiveLoan() (gas: 163342)
TestCustodian:testGenerateOrderSettlement() (gas: 154788)
TestCustodian:testGenerateOrderSettlementHandlerAuthorized() (gas: 160185)
TestCustodian:testGenerateOrderSettlementNoActiveLoan() (gas: 163250)
TestCustodian:testGenerateOrderSettlementUnauthorized() (gas: 101813)
TestCustodian:testGenerateOrdersWithLoanStartAtBlockTimestampInvalidLoan() (gas: 461077)
TestCustodian:testGenerateOrdersWithLoanStartAtBlockTimestampInvalidLoan() (gas: 458513)
TestCustodian:testGetBorrower() (gas: 78641)
TestCustodian:testInvalidAction() (gas: 173284)
TestCustodian:testInvalidActionRepayInActiveLoan() (gas: 130104)
TestCustodian:testInvalidActionSettleActiveLoan() (gas: 130086)
TestCustodian:testInvalidAction() (gas: 173196)
TestCustodian:testInvalidActionRepayInActiveLoan() (gas: 130060)
TestCustodian:testInvalidActionSettleActiveLoan() (gas: 130042)
TestCustodian:testInvalidEncodedData() (gas: 26192)
TestCustodian:testMintWithApprovalSetAsBorrower() (gas: 362821)
TestCustodian:testMintWithApprovalSetAsBorrower() (gas: 360252)
TestCustodian:testMintWithApprovalSetAsBorrowerInvalidLoan() (gas: 60792)
TestCustodian:testMintWithApprovalSetNotAuthorized() (gas: 76759)
TestCustodian:testMintWithApprovalSetNotAuthorized() (gas: 76751)
TestCustodian:testName() (gas: 7121)
TestCustodian:testNonPayableFunctions() (gas: 215173)
TestCustodian:testOnlySeaport() (gas: 17829)
TestCustodian:testPreviewOrderNoActiveLoan() (gas: 105805)
TestCustodian:testPreviewOrderRepay() (gas: 230692)
TestCustodian:testPreviewOrderSettlement() (gas: 191848)
TestCustodian:testPreviewOrderSettlementInvalidFufliller() (gas: 108234)
TestCustodian:testPreviewOrderSettlementInvalidRepayer() (gas: 116961)
TestCustodian:testRatifyOrder() (gas: 184300)
TestCustodian:testPreviewOrderNoActiveLoan() (gas: 105761)
TestCustodian:testPreviewOrderRepay() (gas: 230502)
TestCustodian:testPreviewOrderSettlement() (gas: 191658)
TestCustodian:testPreviewOrderSettlementInvalidFufliller() (gas: 108190)
TestCustodian:testPreviewOrderSettlementInvalidRepayer() (gas: 116917)
TestCustodian:testRatifyOrder() (gas: 184154)
TestCustodian:testSeaportMetadata() (gas: 8632)
TestCustodian:testSupportsInterface() (gas: 9428)
TestCustodian:testSymbol() (gas: 7105)
TestCustodian:testTokenURI() (gas: 67024)
TestCustodian:testTokenURIInvalidLoan() (gas: 13151)
TestLenderEnforcer:testLERevertAdditionalTransfersFromLender() (gas: 76234)
TestLenderEnforcer:testLERevertInvalidLoanTerms() (gas: 80986)
TestLenderEnforcer:testLEValidLoanTerms() (gas: 71979)
TestLenderEnforcer:testLEValidLoanTermsAnyBorrower() (gas: 72111)
TestLenderEnforcer:testLEValidLoanTermsWithAdditionalTransfers() (gas: 73334)
TestLoanCombinations:testLoan20For721SimpleInterestDutchFixedRepay() (gas: 589974)
TestLoanCombinations:testLoan20for20SimpleInterestDutchFixedRepay() (gas: 597187)
TestLoanCombinations:testLoan721for20SimpleInterestDutchFixedRepay() (gas: 588268)
TestLoanCombinations:testLoanAstariaSettlementRepay() (gas: 578078)
TestNewLoan:testBuyNowPayLater() (gas: 2872565)
TestLenderEnforcer:testLERevertAdditionalTransfersFromLender() (gas: 76426)
TestLenderEnforcer:testLERevertInvalidLoanTerms() (gas: 81178)
TestLenderEnforcer:testLEValidLoanTerms() (gas: 72171)
TestLenderEnforcer:testLEValidLoanTermsAnyBorrower() (gas: 72303)
TestLenderEnforcer:testLEValidLoanTermsWithAdditionalTransfers() (gas: 73526)
TestLoanCombinations:testLoan20For721SimpleInterestDutchFixedRepay() (gas: 587408)
TestLoanCombinations:testLoan20for20SimpleInterestDutchFixedRepay() (gas: 594621)
TestLoanCombinations:testLoan721for20SimpleInterestDutchFixedRepay() (gas: 585694)
TestLoanCombinations:testLoanAstariaSettlementRepay() (gas: 575512)
TestNewLoan:testBuyNowPayLater() (gas: 2870235)
TestNewLoan:testInvalidSenderBNPL() (gas: 1613720)
TestNewLoan:testInvalidUserDataHashBNPL() (gas: 1616299)
TestNewLoan:testNewLoanAs1271ProxyAccountSender() (gas: 864196)
TestNewLoan:testNewLoanAs1271ProxyAccountThirdPartyFiller() (gas: 873605)
TestNewLoan:testNewLoanERC721CollateralDefaultTerms2() (gas: 427399)
TestNewLoan:testNewLoanRefinance() (gas: 588930)
TestNewLoan:testNewLoanViaOriginatorBorrowerApprovalAndLenderApproval() (gas: 328439)
TestNewLoan:testNewLoanViaOriginatorLenderApproval() (gas: 384757)
TestNewLoan:testSettleLoan() (gas: 639458)
TestNewLoan:testNewLoanAs1271ProxyAccountSender() (gas: 861567)
TestNewLoan:testNewLoanAs1271ProxyAccountThirdPartyFiller() (gas: 871197)
TestNewLoan:testNewLoanERC721CollateralDefaultTerms2() (gas: 425023)
TestNewLoan:testNewLoanRefinance() (gas: 583685)
TestNewLoan:testNewLoanViaOriginatorBorrowerApprovalAndLenderApproval() (gas: 325727)
TestNewLoan:testNewLoanViaOriginatorLenderApproval() (gas: 382218)
TestNewLoan:testSettleLoan() (gas: 636936)
TestPausableNonReentrant:testNotOwner() (gas: 21254)
TestPausableNonReentrant:testPauseAndUnpause() (gas: 22555)
TestPausableNonReentrant:testReentrancy() (gas: 15360)
TestPausableNonReentrant:testUnpauseWhenNotPaused() (gas: 12582)
TestRepayLoan:testRepayLoanApprovedRepayer() (gas: 661964)
TestRepayLoan:testRepayLoanBase() (gas: 598167)
TestRepayLoan:testRepayLoanGenerateOrderNotSeaport() (gas: 436430)
TestRepayLoan:testRepayLoanInSettlement() (gas: 583494)
TestRepayLoan:testRepayLoanInvalidRepayer() (gas: 601825)
TestRepayLoan:testRepayLoanThatDoesNotExist() (gas: 857474)
TestRepayLoan:testRepayLoanApprovedRepayer() (gas: 659390)
TestRepayLoan:testRepayLoanBase() (gas: 595601)
TestRepayLoan:testRepayLoanGenerateOrderNotSeaport() (gas: 434054)
TestRepayLoan:testRepayLoanInSettlement() (gas: 581074)
TestRepayLoan:testRepayLoanInvalidRepayer() (gas: 599405)
TestRepayLoan:testRepayLoanThatDoesNotExist() (gas: 854680)
TestSimpleInterestPricing:test_calculateInterest() (gas: 895930)
TestSimpleInterestPricing:test_getPaymentConsideration() (gas: 943140)
TestSimpleInterestPricing:test_getRefinanceConsideration() (gas: 933907)
TestStarport:testActive() (gas: 69320)
TestStarport:testAdditionalTransfers() (gas: 301306)
TestStarport:testAdditionalTransfersOriginate() (gas: 276024)
TestStarport:testAdditionalTransfersRefinance() (gas: 214275)
TestStarport:testApplyRefinanceConsiderationToLoanMalformed() (gas: 121896)
TestStarport:testCannotIssueSameLoanTwice() (gas: 364620)
TestStarport:testCannotOriginateWhilePaused() (gas: 73457)
TestStarport:testCannotSettleInvalidLoan() (gas: 74915)
TestStarport:testActive() (gas: 69312)
TestStarport:testAdditionalTransfers() (gas: 298767)
TestStarport:testAdditionalTransfersOriginate() (gas: 273485)
TestStarport:testAdditionalTransfersRefinance() (gas: 211382)
TestStarport:testApplyRefinanceConsiderationToLoanMalformed() (gas: 121962)
TestStarport:testCannotIssueSameLoanTwice() (gas: 359673)
TestStarport:testCannotOriginateWhilePaused() (gas: 73479)
TestStarport:testCannotSettleInvalidLoan() (gas: 74823)
TestStarport:testCannotSettleUnlessValidCustodian() (gas: 70985)
TestStarport:testCaveatEnforcerRevert() (gas: 99214)
TestStarport:testDefaultFeeRake() (gas: 361445)
TestStarport:testDefaultFeeRakeExoticDebt() (gas: 370957)
TestStarport:testExoticDebtWithNoCaveatsNotAsBorrower() (gas: 377428)
TestStarport:testIncrementCaveatNonce() (gas: 35208)
TestStarport:testInitializedFlagSetProperly() (gas: 67393)
TestStarport:testInvalidAdditionalTransfersOriginate() (gas: 228493)
TestStarport:testInvalidAdditionalTransfersRefinance() (gas: 163974)
TestStarport:testInvalidAmountCollateral() (gas: 163505)
TestStarport:testInvalidAmountCollateral721() (gas: 163505)
TestStarport:testInvalidItemType() (gas: 149453)
TestStarport:testInvalidTransferLengthCollateral() (gas: 151659)
TestStarport:testInvalidTransferLengthDebt() (gas: 173460)
TestStarport:testInvalidateCaveatSalt() (gas: 33463)
TestStarport:testNonDefaultCustodianCustodyCallFails() (gas: 264471)
TestStarport:testNonDefaultCustodianCustodyCallSuccess() (gas: 290684)
TestStarport:testNonPayableFunctions() (gas: 112043)
TestStarport:testOverrideFeeRake() (gas: 357341)
TestStarport:testPause() (gas: 18093)
TestStarport:testRefinancePostRepaymentFails() (gas: 120803)
TestStarport:testTokenNoCodeCollateral() (gas: 148266)
TestStarport:testTokenNoCodeDebt() (gas: 178673)
TestStarport:testUnpause() (gas: 17198)
TestStarport:testDefaultFeeRake() (gas: 358915)
TestStarport:testDefaultFeeRakeExoticDebt() (gas: 368427)
TestStarport:testExoticDebtWithNoCaveatsNotAsBorrower() (gas: 374612)
TestStarport:testIncrementCaveatNonce() (gas: 35230)
TestStarport:testInitializedFlagSetProperly() (gas: 67349)
TestStarport:testInvalidAdditionalTransfersOriginate() (gas: 228685)
TestStarport:testInvalidAdditionalTransfersRefinance() (gas: 163850)
TestStarport:testInvalidAmountCollateral() (gas: 163697)
TestStarport:testInvalidAmountCollateral721() (gas: 163697)
TestStarport:testInvalidItemType() (gas: 149645)
TestStarport:testInvalidTransferLengthCollateral() (gas: 151851)
TestStarport:testInvalidTransferLengthDebt() (gas: 173652)
TestStarport:testInvalidateCaveatSalt() (gas: 33485)
TestStarport:testNonDefaultCustodianCustodyCallFails() (gas: 261910)
TestStarport:testNonDefaultCustodianCustodyCallSuccess() (gas: 288123)
TestStarport:testNonPayableFunctions() (gas: 112065)
TestStarport:testOverrideFeeRake() (gas: 354826)
TestStarport:testPause() (gas: 18115)
TestStarport:testRefinancePostRepaymentFails() (gas: 120679)
TestStarport:testTokenNoCodeCollateral() (gas: 148458)
TestStarport:testTokenNoCodeDebt() (gas: 178865)
TestStarport:testUnpause() (gas: 17220)
TestStrategistOriginator:testEncodeWithAccountCounter() (gas: 12307)
TestStrategistOriginator:testGetStrategistData() (gas: 1489933)
TestStrategistOriginator:testIncrementCounterAsStrategist() (gas: 18676)
TestStrategistOriginator:testIncrementCounterNotAuthorized() (gas: 13401)
TestStrategistOriginator:testInvalidCollateral() (gas: 209797)
TestStrategistOriginator:testInvalidDeadline() (gas: 215512)
TestStrategistOriginator:testInvalidDebt() (gas: 211435)
TestStrategistOriginator:testInvalidDebtAmountAskingMoreThanOffered() (gas: 211796)
TestStrategistOriginator:testInvalidDebtAmountOfferingZero() (gas: 212095)
TestStrategistOriginator:testInvalidDebtAmountRequestingZero() (gas: 212049)
TestStrategistOriginator:testInvalidDebtLength() (gas: 210678)
TestStrategistOriginator:testInvalidOffer() (gas: 427326)
TestStrategistOriginator:testInvalidSigner() (gas: 214006)
TestStrategistOriginator:testInvalidCollateral() (gas: 209819)
TestStrategistOriginator:testInvalidDeadline() (gas: 215534)
TestStrategistOriginator:testInvalidDebt() (gas: 211457)
TestStrategistOriginator:testInvalidDebtAmountAskingMoreThanOffered() (gas: 211818)
TestStrategistOriginator:testInvalidDebtAmountOfferingZero() (gas: 212117)
TestStrategistOriginator:testInvalidDebtAmountRequestingZero() (gas: 212071)
TestStrategistOriginator:testInvalidDebtLength() (gas: 210700)
TestStrategistOriginator:testInvalidOffer() (gas: 424787)
TestStrategistOriginator:testInvalidSigner() (gas: 214028)
TestStrategistOriginator:testSetStrategist() (gas: 17796)
58 changes: 42 additions & 16 deletions src/Starport.sol
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,9 @@ contract Starport is PausableNonReentrant {
BORROWER,
LENDER
}
enum FieldFlags {
INACTIVE,
ACTIVE
}

uint256 public constant LOAN_INACTIVE_FLAG = 0x0;
uint256 public constant LOAN_ACTIVE_FLAG = 0x1;

struct Terms {
address status; //the address of the status module
Expand Down Expand Up @@ -413,7 +412,7 @@ contract Starport is PausableNonReentrant {
* @return True if the loan is active
*/
function active(uint256 loanId) public view returns (bool) {
return loanState[loanId] == uint256(FieldFlags.ACTIVE);
return loanState[loanId] == LOAN_ACTIVE_FLAG;
}

/**
Expand All @@ -422,7 +421,7 @@ contract Starport is PausableNonReentrant {
* @return True if the loan is inactive
*/
function inactive(uint256 loanId) public view returns (bool) {
return loanState[loanId] == uint256(FieldFlags.INACTIVE);
return loanState[loanId] == LOAN_INACTIVE_FLAG;
}

/**
Expand All @@ -437,13 +436,28 @@ contract Starport is PausableNonReentrant {
_settle(loan);
}

bytes32 private constant _INVALID_LOAN = 0x045f33d100000000000000000000000000000000000000000000000000000000;
bytes32 private constant _LOAN_EXISTS = 0x14ec57fc00000000000000000000000000000000000000000000000000000000;

function _settle(Loan memory loan) internal {
uint256 loanId = loan.getId();
if (inactive(loanId)) {
revert InvalidLoan();
}
assembly {
mstore(0x0, loanId)
mstore(0x20, loanState.slot)

// loanState[loanId]

let loc := keccak256(0x0, 0x40)

loanState[loanId] = uint256(FieldFlags.INACTIVE);
// if (inactive(loanId)) {
if iszero(sload(loc)) {
//revert InvalidLoan()
mstore(0x0, _INVALID_LOAN)
revert(0x0, 0x04)
}

sstore(loc, LOAN_INACTIVE_FLAG)
}

emit Close(loanId);
}
Expand Down Expand Up @@ -528,14 +542,26 @@ contract Starport is PausableNonReentrant {
loan.start = block.timestamp;
loan.originator = loan.originator != address(0) ? loan.originator : msg.sender;

bytes memory encodedLoan = abi.encode(loan);

uint256 loanId = loan.getId();
if (active(loanId)) {
revert LoanExists();
}
// if (active(loanId)) {
// revert LoanExists();
// }
//
assembly {
mstore(0x0, loanId)
mstore(0x20, loanState.slot)

//loanState[loanId]
let loc := keccak256(0x0, 0x40)
// if (active(loanId))
if iszero(iszero(sload(loc))) {
//revert LoanExists()
mstore(0x0, _LOAN_EXISTS)
revert(0x0, 0x04)
}

loanState[loanId] = uint256(FieldFlags.ACTIVE);
sstore(loc, LOAN_ACTIVE_FLAG)
}
emit Open(loanId, loan);
}
}
2 changes: 1 addition & 1 deletion src/enforcers/BorrowerEnforcer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ contract BorrowerEnforcer is CaveatEnforcer {
Details memory details
) internal pure {
details.loan.issuer = loan.issuer;
details.loan.originator = address(0);
details.loan.originator = loan.originator;
if (keccak256(abi.encode(loan)) != keccak256(abi.encode(details.loan))) revert InvalidLoanTerms();

//Should additional transfers from the accounts other than the borrower be allowed?
Expand Down
2 changes: 1 addition & 1 deletion src/enforcers/BorrowerEnforcerBNPL.sol
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ contract BorrowerEnforcerBNPL is CaveatEnforcer {
revert BorrowerOnlyEnforcer();
}
details.loan.issuer = loan.issuer;

details.loan.originator = loan.originator;
if (loanHash != keccak256(abi.encode(details.loan))) {
revert InvalidLoanTerms();
}
Expand Down
Loading

0 comments on commit 5ce193a

Please sign in to comment.