diff --git a/.gas-snapshot b/.gas-snapshot index 1e79de56..4a00d893 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -1,154 +1,154 @@ -IntegrationTestCaveats:testInvalidCaveatLength() (gas: 130019) -IntegrationTestCaveats:testInvalidCaveats() (gas: 162046) -IntegrationTestCaveats:testOriginateUnapprovedFulfiller() (gas: 332147) -IntegrationTestCaveats:testOriginateWBorrowerApproval() (gas: 283288) -IntegrationTestCaveats:testOriginateWCaveatsAsBorrower() (gas: 306526) -IntegrationTestCaveats:testOriginateWCaveatsExpired() (gas: 159299) -IntegrationTestCaveats:testOriginateWCaveatsIncrementedNonce() (gas: 167791) -IntegrationTestCaveats:testOriginateWCaveatsInvalidSalt() (gas: 284586) -IntegrationTestCaveats:testOriginateWCaveatsInvalidSaltManual() (gas: 141962) -IntegrationTestCaveats:testOriginateWLenderApproval() (gas: 283408) -IntegrationTestCaveats:testRefinanceAsLender() (gas: 1053605) -IntegrationTestCaveats:testRefinanceCaveatFailure() (gas: 407716) -IntegrationTestCaveats:testRefinanceLoanStartAtBlockTimestampInvalidLoan() (gas: 347568) -IntegrationTestCaveats:testRefinanceUnapprovedFulfiller() (gas: 456374) -IntegrationTestCaveats:testRefinanceWCaveatsInvalidSalt() (gas: 377067) -IntegrationTestCaveats:testRefinanceWLenderApproval() (gas: 402764) -ModuleTesting:testFixedTermDutchAuctionSettlement() (gas: 438033) -ModuleTesting:testFixedTermDutchAuctionSettlementAuctionNotStarted() (gas: 441409) -ModuleTesting:testFixedTermDutchAuctionSettlementGetSettlementAuctionExpired() (gas: 440947) -ModuleTesting:testFixedTermDutchAuctionSettlementNotValid() (gas: 437045) -ModuleTesting:testFixedTermDutchAuctionSettlementValid() (gas: 437844) -ModuleTesting:testModuleValidation() (gas: 1274232) +IntegrationTestCaveats:testInvalidCaveatLength() (gas: 129975) +IntegrationTestCaveats:testInvalidCaveats() (gas: 162024) +IntegrationTestCaveats:testOriginateUnapprovedFulfiller() (gas: 332103) +IntegrationTestCaveats:testOriginateWBorrowerApproval() (gas: 283244) +IntegrationTestCaveats:testOriginateWCaveatsAsBorrower() (gas: 306482) +IntegrationTestCaveats:testOriginateWCaveatsExpired() (gas: 159190) +IntegrationTestCaveats:testOriginateWCaveatsIncrementedNonce() (gas: 167771) +IntegrationTestCaveats:testOriginateWCaveatsInvalidSalt() (gas: 284520) +IntegrationTestCaveats:testOriginateWCaveatsInvalidSaltManual() (gas: 141940) +IntegrationTestCaveats:testOriginateWLenderApproval() (gas: 283364) +IntegrationTestCaveats:testRefinanceAsLender() (gas: 1053539) +IntegrationTestCaveats:testRefinanceCaveatFailure() (gas: 407606) +IntegrationTestCaveats:testRefinanceLoanStartAtBlockTimestampInvalidLoan() (gas: 347413) +IntegrationTestCaveats:testRefinanceUnapprovedFulfiller() (gas: 456197) +IntegrationTestCaveats:testRefinanceWCaveatsInvalidSalt() (gas: 376957) +IntegrationTestCaveats:testRefinanceWLenderApproval() (gas: 402676) +ModuleTesting:testFixedTermDutchAuctionSettlement() (gas: 437967) +ModuleTesting:testFixedTermDutchAuctionSettlementAuctionNotStarted() (gas: 441343) +ModuleTesting:testFixedTermDutchAuctionSettlementGetSettlementAuctionExpired() (gas: 440792) +ModuleTesting:testFixedTermDutchAuctionSettlementNotValid() (gas: 437001) +ModuleTesting:testFixedTermDutchAuctionSettlementValid() (gas: 437778) +ModuleTesting:testModuleValidation() (gas: 1274188) PausableNonReentrantImpl:test() (gas: 2464) PausableNonReentrantImpl:testReentrancy() (gas: 2757) TestBorrowerEnforcer:testBERevertAdditionalTransfersFromBorrower() (gas: 76462) TestBorrowerEnforcer:testBERevertInvalidLoanTerms() (gas: 81160) TestBorrowerEnforcer:testBEValidLoanTerms() (gas: 72257) TestBorrowerEnforcer:testBEValidLoanTermsAnyIssuer() (gas: 72321) -TestCustodian:testCannotLazyMintTwice() (gas: 82131) -TestCustodian:testCannotMintInvalidLoanInvalidCustodian() (gas: 72437) -TestCustodian:testCannotMintInvalidLoanValidCustodian() (gas: 77947) -TestCustodian:testCustodianCannotBeAuthorized() (gas: 142196) -TestCustodian:testCustodySelector() (gas: 2731904) -TestCustodian:testDefaultCustodySelectorRevert() (gas: 72420) -TestCustodian:testGenerateOrderInvalidPostRepayment() (gas: 173073) -TestCustodian:testGenerateOrderInvalidPostSettlement() (gas: 163214) -TestCustodian:testGenerateOrderRepay() (gas: 177231) -TestCustodian:testGenerateOrderRepayAsRepayApprovedBorrower() (gas: 193695) -TestCustodian:testGenerateOrderRepayERC1155AndERC20() (gas: 876053) -TestCustodian:testGenerateOrderRepayERC1155AndERC20HandlerAuthorized() (gas: 804641) -TestCustodian:testGenerateOrderRepayInvalidHookAddress() (gas: 97653) -TestCustodian:testGenerateOrderRepayInvalidHookReturnType() (gas: 92014) -TestCustodian:testGenerateOrderRepayNotBorrower() (gas: 106914) -TestCustodian:testGenerateOrderSettlement() (gas: 154947) -TestCustodian:testGenerateOrderSettlementHandlerAuthorized() (gas: 160344) -TestCustodian:testGenerateOrderSettlementNoActiveLoan() (gas: 163392) -TestCustodian:testGenerateOrderSettlementUnauthorized() (gas: 101879) -TestCustodian:testGenerateOrdersWithLoanStartAtBlockTimestampInvalidLoan() (gas: 461629) -TestCustodian:testGetBorrower() (gas: 78621) -TestCustodian:testInvalidAction() (gas: 173362) -TestCustodian:testInvalidActionRepayInActiveLoan() (gas: 130206) -TestCustodian:testInvalidActionSettleActiveLoan() (gas: 130166) -TestCustodian:testInvalidEncodedData() (gas: 26170) -TestCustodian:testMintWithApprovalSetAsBorrower() (gas: 366745) -TestCustodian:testMintWithApprovalSetAsBorrowerInvalidLoan() (gas: 64632) -TestCustodian:testMintWithApprovalSetNotAuthorized() (gas: 66873) -TestCustodian:testName() (gas: 7099) -TestCustodian:testNonPayableFunctions() (gas: 215173) -TestCustodian:testOnlySeaport() (gas: 17918) -TestCustodian:testPreviewOrderNoActiveLoan() (gas: 105759) -TestCustodian:testPreviewOrderRepay() (gas: 230241) -TestCustodian:testPreviewOrderSettlement() (gas: 191969) -TestCustodian:testPreviewOrderSettlementInvalidFufliller() (gas: 108320) -TestCustodian:testPreviewOrderSettlementInvalidRepayer() (gas: 117031) -TestCustodian:testRatifyOrder() (gas: 184052) -TestCustodian:testSeaportMetadata() (gas: 8644) +TestCustodian:testCannotLazyMintTwice() (gas: 82167) +TestCustodian:testCannotMintInvalidLoanInvalidCustodian() (gas: 72517) +TestCustodian:testCannotMintInvalidLoanValidCustodian() (gas: 77895) +TestCustodian:testCustodianCannotBeAuthorized() (gas: 142186) +TestCustodian:testCustodySelector() (gas: 2731984) +TestCustodian:testDefaultCustodySelectorRevert() (gas: 72370) +TestCustodian:testGenerateOrderInvalidPostRepayment() (gas: 173046) +TestCustodian:testGenerateOrderInvalidPostSettlement() (gas: 163209) +TestCustodian:testGenerateOrderRepay() (gas: 177204) +TestCustodian:testGenerateOrderRepayAsRepayApprovedBorrower() (gas: 193690) +TestCustodian:testGenerateOrderRepayERC1155AndERC20() (gas: 875889) +TestCustodian:testGenerateOrderRepayERC1155AndERC20HandlerAuthorized() (gas: 804477) +TestCustodian:testGenerateOrderRepayInvalidHookAddress() (gas: 97670) +TestCustodian:testGenerateOrderRepayInvalidHookReturnType() (gas: 92031) +TestCustodian:testGenerateOrderRepayNotBorrower() (gas: 106931) +TestCustodian:testGenerateOrderSettlement() (gas: 154920) +TestCustodian:testGenerateOrderSettlementHandlerAuthorized() (gas: 160317) +TestCustodian:testGenerateOrderSettlementNoActiveLoan() (gas: 163387) +TestCustodian:testGenerateOrderSettlementUnauthorized() (gas: 101896) +TestCustodian:testGenerateOrdersWithLoanStartAtBlockTimestampInvalidLoan() (gas: 461580) +TestCustodian:testGetBorrower() (gas: 78643) +TestCustodian:testInvalidAction() (gas: 173552) +TestCustodian:testInvalidActionRepayInActiveLoan() (gas: 130196) +TestCustodian:testInvalidActionSettleActiveLoan() (gas: 130134) +TestCustodian:testInvalidEncodedData() (gas: 26160) +TestCustodian:testMintWithApprovalSetAsBorrower() (gas: 366679) +TestCustodian:testMintWithApprovalSetAsBorrowerInvalidLoan() (gas: 64523) +TestCustodian:testMintWithApprovalSetNotAuthorized() (gas: 66842) +TestCustodian:testName() (gas: 7121) +TestCustodian:testNonPayableFunctions() (gas: 215289) +TestCustodian:testOnlySeaport() (gas: 17829) +TestCustodian:testPreviewOrderNoActiveLoan() (gas: 105754) +TestCustodian:testPreviewOrderRepay() (gas: 230209) +TestCustodian:testPreviewOrderSettlement() (gas: 191937) +TestCustodian:testPreviewOrderSettlementInvalidFufliller() (gas: 108315) +TestCustodian:testPreviewOrderSettlementInvalidRepayer() (gas: 117026) +TestCustodian:testRatifyOrder() (gas: 184025) +TestCustodian:testSeaportMetadata() (gas: 8666) TestCustodian:testSupportsInterface() (gas: 9428) -TestCustodian:testSymbol() (gas: 7216) -TestCustodian:testTokenURI() (gas: 84908) -TestCustodian:testTokenURIInvalidLoan() (gas: 13157) -TestLenderEnforcer:testLERevertAdditionalTransfersFromLender() (gas: 76455) -TestLenderEnforcer:testLERevertInvalidLoanTerms() (gas: 81096) -TestLenderEnforcer:testLEValidLoanTerms() (gas: 72169) -TestLenderEnforcer:testLEValidLoanTermsAnyBorrower() (gas: 72323) -TestLenderEnforcer:testLEValidLoanTermsWithAdditionalTransfers() (gas: 73525) -TestLoanCombinations:testLoan20For721SimpleInterestDutchFixedRepay() (gas: 593006) -TestLoanCombinations:testLoan20for20SimpleInterestDutchFixedRepay() (gas: 600197) -TestLoanCombinations:testLoan721for20SimpleInterestDutchFixedRepay() (gas: 590370) -TestLoanCombinations:testLoanAstariaSettlementRepay() (gas: 580232) -TestNewLoan:testBuyNowPayLater() (gas: 3018439) -TestNewLoan:testNewLoanAs1271ProxyAccountSender() (gas: 874205) -TestNewLoan:testNewLoanAs1271ProxyAccountThirdPartyFiller() (gas: 885161) -TestNewLoan:testNewLoanERC721CollateralDefaultTerms2() (gas: 429545) -TestNewLoan:testNewLoanRefinance() (gas: 590031) -TestNewLoan:testNewLoanViaOriginatorBorrowerApprovalAndLenderApproval() (gas: 325963) -TestNewLoan:testNewLoanViaOriginatorLenderApproval() (gas: 384859) -TestNewLoan:testSettleLoan() (gas: 642103) -TestPausableNonReentrant:testNotOwner() (gas: 21254) -TestPausableNonReentrant:testPauseAndUnpause() (gas: 22621) +TestCustodian:testSymbol() (gas: 7127) +TestCustodian:testTokenURI() (gas: 85172) +TestCustodian:testTokenURIInvalidLoan() (gas: 13179) +TestLenderEnforcer:testLERevertAdditionalTransfersFromLender() (gas: 76366) +TestLenderEnforcer:testLERevertInvalidLoanTerms() (gas: 81118) +TestLenderEnforcer:testLEValidLoanTerms() (gas: 72191) +TestLenderEnforcer:testLEValidLoanTermsAnyBorrower() (gas: 72234) +TestLenderEnforcer:testLEValidLoanTermsWithAdditionalTransfers() (gas: 73547) +TestLoanCombinations:testLoan20For721SimpleInterestDutchFixedRepay() (gas: 592874) +TestLoanCombinations:testLoan20for20SimpleInterestDutchFixedRepay() (gas: 600087) +TestLoanCombinations:testLoan721for20SimpleInterestDutchFixedRepay() (gas: 590238) +TestLoanCombinations:testLoanAstariaSettlementRepay() (gas: 580122) +TestNewLoan:testBuyNowPayLater() (gas: 3018373) +TestNewLoan:testNewLoanAs1271ProxyAccountSender() (gas: 874071) +TestNewLoan:testNewLoanAs1271ProxyAccountThirdPartyFiller() (gas: 885063) +TestNewLoan:testNewLoanERC721CollateralDefaultTerms2() (gas: 429479) +TestNewLoan:testNewLoanRefinance() (gas: 589899) +TestNewLoan:testNewLoanViaOriginatorBorrowerApprovalAndLenderApproval() (gas: 324388) +TestNewLoan:testNewLoanViaOriginatorLenderApproval() (gas: 383305) +TestNewLoan:testSettleLoan() (gas: 642037) +TestPausableNonReentrant:testNotOwner() (gas: 21276) +TestPausableNonReentrant:testPauseAndUnpause() (gas: 22643) TestPausableNonReentrant:testReentrancy() (gas: 15404) -TestPausableNonReentrant:testUnpauseWhenNotPaused() (gas: 12582) -TestRepayLoan:testRepayLoanApprovedRepayer() (gas: 667101) -TestRepayLoan:testRepayLoanBase() (gas: 599887) -TestRepayLoan:testRepayLoanGenerateOrderNotSeaport() (gas: 438687) -TestRepayLoan:testRepayLoanInSettlement() (gas: 585679) -TestRepayLoan:testRepayLoanInvalidRepayer() (gas: 603988) -TestRepayLoan:testRepayLoanThatDoesNotExist() (gas: 858619) +TestPausableNonReentrant:testUnpauseWhenNotPaused() (gas: 12604) +TestRepayLoan:testRepayLoanApprovedRepayer() (gas: 666991) +TestRepayLoan:testRepayLoanBase() (gas: 599777) +TestRepayLoan:testRepayLoanGenerateOrderNotSeaport() (gas: 438621) +TestRepayLoan:testRepayLoanInSettlement() (gas: 585591) +TestRepayLoan:testRepayLoanInvalidRepayer() (gas: 603900) +TestRepayLoan:testRepayLoanThatDoesNotExist() (gas: 858443) TestSimpleInterestPricing:test_calculateInterest() (gas: 881296) TestSimpleInterestPricing:test_getPaymentConsideration() (gas: 928510) TestSimpleInterestPricing:test_getRefinanceConsideration() (gas: 919314) -TestStarport:testAcquireTokensFail() (gas: 60430) -TestStarport:testAcquireTokensSuccess() (gas: 162999) -TestStarport:testActive() (gas: 69224) -TestStarport:testAdditionalTransfers() (gas: 300721) -TestStarport:testAdditionalTransfersOriginate() (gas: 275417) -TestStarport:testAdditionalTransfersRefinance() (gas: 218147) -TestStarport:testApplyRefinanceConsiderationToLoanMalformed() (gas: 129974) -TestStarport:testCannotIssueSameLoanTwice() (gas: 364057) -TestStarport:testCannotOriginateWhilePaused() (gas: 73567) -TestStarport:testCannotSettleInvalidLoan() (gas: 74903) -TestStarport:testCannotSettleUnlessValidCustodian() (gas: 70963) -TestStarport:testCaveatEnforcerRevert() (gas: 100284) -TestStarport:testDefaultFeeRake1() (gas: 387812) -TestStarport:testDefaultFeeRake2() (gas: 450155) -TestStarport:testDefaultFeeRakeExoticDebt() (gas: 397641) -TestStarport:testEIP712Signing() (gas: 83089) -TestStarport:testExoticDebtWithCustomPricingAndRepayment() (gas: 1237771) -TestStarport:testExoticDebtWithCustomPricingAndSettlement() (gas: 1692792) -TestStarport:testExoticDebtWithNoCaveatsNotAsBorrower() (gas: 376819) -TestStarport:testIncrementCaveatNonce() (gas: 35006) -TestStarport:testInitializedFlagSetProperly() (gas: 67438) -TestStarport:testInvalidAdditionalTransfersOriginate() (gas: 230392) -TestStarport:testInvalidAdditionalTransfersRefinance() (gas: 170796) -TestStarport:testInvalidAmountCollateral() (gas: 165912) -TestStarport:testInvalidAmountCollateral721() (gas: 165934) -TestStarport:testInvalidItemType() (gas: 151860) -TestStarport:testInvalidTransferLengthCollateral() (gas: 154173) -TestStarport:testInvalidTransferLengthDebt() (gas: 175950) +TestStarport:testAcquireTokensFail() (gas: 60408) +TestStarport:testAcquireTokensSuccess() (gas: 162977) +TestStarport:testActive() (gas: 69202) +TestStarport:testAdditionalTransfers() (gas: 300677) +TestStarport:testAdditionalTransfersOriginate() (gas: 275373) +TestStarport:testAdditionalTransfersRefinance() (gas: 218125) +TestStarport:testApplyRefinanceConsiderationToLoanMalformed() (gas: 129820) +TestStarport:testCannotIssueSameLoanTwice() (gas: 363969) +TestStarport:testCannotOriginateWhilePaused() (gas: 73523) +TestStarport:testCannotSettleInvalidLoan() (gas: 74881) +TestStarport:testCannotSettleUnlessValidCustodian() (gas: 70941) +TestStarport:testCaveatEnforcerRevert() (gas: 100240) +TestStarport:testDefaultFeeRake1() (gas: 387902) +TestStarport:testDefaultFeeRake2() (gas: 450245) +TestStarport:testDefaultFeeRakeExoticDebt() (gas: 397731) +TestStarport:testEIP712Signing() (gas: 83086) +TestStarport:testExoticDebtWithCustomPricingAndRepayment() (gas: 1237683) +TestStarport:testExoticDebtWithCustomPricingAndSettlement() (gas: 1692704) +TestStarport:testExoticDebtWithNoCaveatsNotAsBorrower() (gas: 376775) +TestStarport:testIncrementCaveatNonce() (gas: 35183) +TestStarport:testInitializedFlagSetProperly() (gas: 67416) +TestStarport:testInvalidAdditionalTransfersOriginate() (gas: 230348) +TestStarport:testInvalidAdditionalTransfersRefinance() (gas: 170774) +TestStarport:testInvalidAmountCollateral() (gas: 165890) +TestStarport:testInvalidAmountCollateral721() (gas: 165890) +TestStarport:testInvalidItemType() (gas: 151838) +TestStarport:testInvalidTransferLengthCollateral() (gas: 154129) +TestStarport:testInvalidTransferLengthDebt() (gas: 175906) TestStarport:testInvalidateCaveatSalt() (gas: 33450) -TestStarport:testNonDefaultCustodianCustodyCallFails() (gas: 264255) -TestStarport:testNonDefaultCustodianCustodyCallSuccess() (gas: 290380) -TestStarport:testNonPayableFunctions() (gas: 112229) -TestStarport:testOverrideFeeRake() (gas: 384046) -TestStarport:testPause() (gas: 18259) -TestStarport:testRefinancePostRepaymentFails() (gas: 127973) -TestStarport:testStargateGetOwner() (gas: 8808) -TestStarport:testTokenNoCodeCollateral() (gas: 150695) -TestStarport:testTokenNoCodeDebt() (gas: 180946) -TestStarport:testUnpause() (gas: 17363) +TestStarport:testNonDefaultCustodianCustodyCallFails() (gas: 264211) +TestStarport:testNonDefaultCustodianCustodyCallSuccess() (gas: 290336) +TestStarport:testNonPayableFunctions() (gas: 112185) +TestStarport:testOverrideFeeRake() (gas: 384225) +TestStarport:testPause() (gas: 18215) +TestStarport:testRefinancePostRepaymentFails() (gas: 127864) +TestStarport:testStargateGetOwner() (gas: 8786) +TestStarport:testTokenNoCodeCollateral() (gas: 150651) +TestStarport:testTokenNoCodeDebt() (gas: 180902) +TestStarport:testUnpause() (gas: 17297) TestStrategistOriginator:testEncodeWithAccountCounter() (gas: 12330) TestStrategistOriginator:testGetStrategistData() (gas: 1790990) -TestStrategistOriginator:testIncrementCounterAsStrategist() (gas: 38465) +TestStrategistOriginator:testIncrementCounterAsStrategist() (gas: 38488) TestStrategistOriginator:testIncrementCounterNotAuthorized() (gas: 13423) -TestStrategistOriginator:testInvalidCollateral() (gas: 211094) -TestStrategistOriginator:testInvalidDeadline() (gas: 216915) -TestStrategistOriginator:testInvalidDebt() (gas: 212802) -TestStrategistOriginator:testInvalidDebtAmountAskingMoreThanOffered() (gas: 213176) -TestStrategistOriginator:testInvalidDebtAmountOfferingZero() (gas: 213486) -TestStrategistOriginator:testInvalidDebtAmountRequestingZero() (gas: 213441) -TestStrategistOriginator:testInvalidDebtLength() (gas: 212096) -TestStrategistOriginator:testInvalidOffer() (gas: 427919) -TestStrategistOriginator:testInvalidSigner() (gas: 215234) +TestStrategistOriginator:testInvalidCollateral() (gas: 210294) +TestStrategistOriginator:testInvalidDeadline() (gas: 216115) +TestStrategistOriginator:testInvalidDebt() (gas: 212002) +TestStrategistOriginator:testInvalidDebtAmountAskingMoreThanOffered() (gas: 212376) +TestStrategistOriginator:testInvalidDebtAmountOfferingZero() (gas: 212706) +TestStrategistOriginator:testInvalidDebtAmountRequestingZero() (gas: 212641) +TestStrategistOriginator:testInvalidDebtLength() (gas: 211296) +TestStrategistOriginator:testInvalidOffer() (gas: 427097) +TestStrategistOriginator:testInvalidSigner() (gas: 214434) TestStrategistOriginator:testSetStrategist() (gas: 17884) TestStrategistOriginator:testWithdraw() (gas: 168001) \ No newline at end of file diff --git a/lib/forge-std b/lib/forge-std index e8a047e3..87a2a0af 160000 --- a/lib/forge-std +++ b/lib/forge-std @@ -1 +1 @@ -Subproject commit e8a047e3f40f13fa37af6fe14e6e06283d9a060e +Subproject commit 87a2a0afc5fafd6297538a45a52ac19e71a84562 diff --git a/lib/seaport b/lib/seaport index 43d06a18..50a0c096 160000 --- a/lib/seaport +++ b/lib/seaport @@ -1 +1 @@ -Subproject commit 43d06a187b082dfc27fc5867ba182301cf485af2 +Subproject commit 50a0c09621f90196e8d07dbfb6c564256a241e66 diff --git a/lib/solady b/lib/solady index 88bb5f22..741bda9b 160000 --- a/lib/solady +++ b/lib/solady @@ -1 +1 @@ -Subproject commit 88bb5f223ae3d8567229f39d6c19b5d4c7c4a069 +Subproject commit 741bda9b2914444bf3060da85c7615f64ce4eee1 diff --git a/lib/solmate b/lib/solmate index 2001af43..4b47a190 160000 --- a/lib/solmate +++ b/lib/solmate @@ -1 +1 @@ -Subproject commit 2001af43aedb46fdc2335d2a7714fb2dae7cfcd1 +Subproject commit 4b47a19038b798b4a33d9749d25e570443520647 diff --git a/src/Starport.sol b/src/Starport.sol index 46aa29ec..779267ee 100644 --- a/src/Starport.sol +++ b/src/Starport.sol @@ -92,7 +92,6 @@ contract Starport is PausableNonReentrant { Stargate public immutable SG; uint256 public immutable chainId; - address public immutable defaultCustodian; bytes32 public immutable DEFAULT_CUSTODIAN_CODE_HASH; bytes32 public immutable CACHED_DOMAIN_SEPARATOR; @@ -173,7 +172,6 @@ contract Starport is PausableNonReentrant { assembly ("memory-safe") { defaultCustodianCodeHash := extcodehash(custodian) } - defaultCustodian = custodian; DEFAULT_CUSTODIAN_CODE_HASH = defaultCustodianCodeHash; _initializeOwner(msg.sender); } diff --git a/test/StarportTest.sol b/test/StarportTest.sol index 8efc3142..ae8d4924 100644 --- a/test/StarportTest.sol +++ b/test/StarportTest.sol @@ -185,7 +185,7 @@ contract StarportTest is BaseOrderTest, Stargate { fulfiller = makeAndAllocateAccount("fulfiller"); SP = new Starport(address(consideration), Stargate(address(this))); - custodian = Custodian(payable(SP.defaultCustodian())); + custodian = new Custodian(SP, address(consideration)); SO = new StrategistOriginator(SP, strategist.addr, 1e16, address(this)); pricing = new SimpleInterestPricing(SP); settlement = new FixedTermDutchAuctionSettlement(SP); diff --git a/test/fuzz-testing/TestFuzzStarport.sol b/test/fuzz-testing/TestFuzzStarport.sol index 12162287..960d4164 100644 --- a/test/fuzz-testing/TestFuzzStarport.sol +++ b/test/fuzz-testing/TestFuzzStarport.sol @@ -224,7 +224,7 @@ contract TestFuzzStarport is StarportTest, Bound, DeepEq { loan.debt = debt; loan.borrower = borrower.addr; - loan.custodian = SP.defaultCustodian(); + loan.custodian = address(custodian); loan.issuer = lender.addr; return loan; } diff --git a/test/integration-testing/TestNewLoan.sol b/test/integration-testing/TestNewLoan.sol index 286ad142..b91dbc30 100644 --- a/test/integration-testing/TestNewLoan.sol +++ b/test/integration-testing/TestNewLoan.sol @@ -277,7 +277,7 @@ contract TestNewLoan is StarportTest { Starport.Loan memory loan = generateDefaultLoanTerms(); StrategistOriginator.Details memory newLoanDetails = StrategistOriginator.Details({ - custodian: SP.defaultCustodian(), + custodian: address(custodian), issuer: lender.addr, deadline: block.number + 8, offer: StrategistOriginator.Offer({ @@ -311,14 +311,14 @@ contract TestNewLoan is StarportTest { ); assert(erc20s[0].balanceOf(borrower.addr) == borrowerBalanceBefore + loan.debt[0].amount); assert(erc20s[0].balanceOf(lender.addr) == lenderBalanceBefore - loan.debt[0].amount); - assert(erc721s[0].ownerOf(loan.collateral[0].identifier) == address(SP.defaultCustodian())); + assert(erc721s[0].ownerOf(loan.collateral[0].identifier) == address(address(custodian))); } function testNewLoanViaOriginatorBorrowerApprovalAndLenderApproval() public { Starport.Loan memory loan = generateDefaultLoanTerms(); StrategistOriginator.Details memory newLoanDetails = StrategistOriginator.Details({ - custodian: SP.defaultCustodian(), + custodian: address(custodian), issuer: lender.addr, deadline: block.number + 8, offer: StrategistOriginator.Offer({ @@ -354,7 +354,7 @@ contract TestNewLoan is StarportTest { ); assert(erc20s[0].balanceOf(borrower.addr) == borrowerBalanceBefore + loan.debt[0].amount); assert(erc20s[0].balanceOf(lender.addr) == lenderBalanceBefore - loan.debt[0].amount); - assert(erc721s[0].ownerOf(loan.collateral[0].identifier) == address(SP.defaultCustodian())); + assert(erc721s[0].ownerOf(loan.collateral[0].identifier) == address(address(custodian))); } event log_receivedItems(ReceivedItem[] items); diff --git a/test/unit-testing/TestStrategistOriginator.sol b/test/unit-testing/TestStrategistOriginator.sol index bfef3f78..0ba9bc33 100644 --- a/test/unit-testing/TestStrategistOriginator.sol +++ b/test/unit-testing/TestStrategistOriginator.sol @@ -66,7 +66,7 @@ contract TestStrategistOriginator is StarportTest, DeepEq { Starport.Loan memory loan = generateDefaultLoanTerms(); StrategistOriginator.Details memory newLoanDetails = StrategistOriginator.Details({ - custodian: SP.defaultCustodian(), + custodian: address(custodian), issuer: lender.addr, deadline: block.timestamp + 8, offer: StrategistOriginator.Offer({ @@ -108,7 +108,7 @@ contract TestStrategistOriginator is StarportTest, DeepEq { Starport.Loan memory loan = generateDefaultLoanTerms(); StrategistOriginator.Details memory newLoanDetails = StrategistOriginator.Details({ - custodian: SP.defaultCustodian(), + custodian: address(custodian), issuer: lender.addr, deadline: block.timestamp + 8, offer: StrategistOriginator.Offer({ @@ -151,7 +151,7 @@ contract TestStrategistOriginator is StarportTest, DeepEq { Starport.Loan memory loan = generateDefaultLoanTerms(); StrategistOriginator.Details memory newLoanDetails = StrategistOriginator.Details({ - custodian: SP.defaultCustodian(), + custodian: address(custodian), issuer: lender.addr, deadline: block.timestamp + 8, offer: StrategistOriginator.Offer({ @@ -194,7 +194,7 @@ contract TestStrategistOriginator is StarportTest, DeepEq { Starport.Loan memory loan = generateDefaultLoanTerms(); StrategistOriginator.Details memory newLoanDetails = StrategistOriginator.Details({ - custodian: SP.defaultCustodian(), + custodian: address(custodian), issuer: lender.addr, deadline: block.timestamp + 8, offer: StrategistOriginator.Offer({ @@ -238,7 +238,7 @@ contract TestStrategistOriginator is StarportTest, DeepEq { loan.debt[0].amount = 0; StrategistOriginator.Details memory newLoanDetails = StrategistOriginator.Details({ - custodian: SP.defaultCustodian(), + custodian: address(custodian), issuer: lender.addr, deadline: block.timestamp + 8, offer: StrategistOriginator.Offer({ @@ -280,7 +280,7 @@ contract TestStrategistOriginator is StarportTest, DeepEq { Starport.Loan memory loan = generateDefaultLoanTerms(); StrategistOriginator.Details memory newLoanDetails = StrategistOriginator.Details({ - custodian: SP.defaultCustodian(), + custodian: address(custodian), issuer: lender.addr, deadline: block.timestamp + 8, offer: StrategistOriginator.Offer({ @@ -322,7 +322,7 @@ contract TestStrategistOriginator is StarportTest, DeepEq { Starport.Loan memory loan = generateDefaultLoanTerms(); StrategistOriginator.Details memory newLoanDetails = StrategistOriginator.Details({ - custodian: SP.defaultCustodian(), + custodian: address(custodian), issuer: lender.addr, deadline: block.timestamp + 8, offer: StrategistOriginator.Offer({ @@ -366,7 +366,7 @@ contract TestStrategistOriginator is StarportTest, DeepEq { Starport.Loan memory loan = generateDefaultLoanTerms(); StrategistOriginator.Details memory newLoanDetails = StrategistOriginator.Details({ - custodian: SP.defaultCustodian(), + custodian: address(custodian), issuer: lender.addr, deadline: block.timestamp + 8, offer: StrategistOriginator.Offer({ @@ -410,7 +410,7 @@ contract TestStrategistOriginator is StarportTest, DeepEq { Starport.Loan memory loan = generateDefaultLoanTerms(); StrategistOriginator.Details memory newLoanDetails = StrategistOriginator.Details({ - custodian: SP.defaultCustodian(), + custodian: address(custodian), issuer: lender.addr, deadline: block.timestamp + 8, offer: StrategistOriginator.Offer({