From 120549715cc02bbf5fe2d53c57885cd187d67c4f Mon Sep 17 00:00:00 2001 From: Gregory Curtis Date: Wed, 14 Feb 2024 12:43:51 -0700 Subject: [PATCH] remove lazy mint functionality from custodian --- .gas-snapshot | 101 +++++++++----------- src/Custodian.sol | 96 ++----------------- test/integration-testing/TestRepayLoan.sol | 28 ------ test/unit-testing/TestCustodian.sol | 106 --------------------- test/unit-testing/TestStarport.sol | 1 - 5 files changed, 52 insertions(+), 280 deletions(-) diff --git a/.gas-snapshot b/.gas-snapshot index d7e0d354..da2246d5 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -26,57 +26,45 @@ TestBorrowerEnforcer:testBERevertAdditionalTransfersFromBorrower() (gas: 76462) TestBorrowerEnforcer:testBERevertInvalidLoanTerms() (gas: 81160) TestBorrowerEnforcer:testBEValidLoanTerms() (gas: 72257) TestBorrowerEnforcer:testBEValidLoanTermsAnyIssuer() (gas: 72343) -TestCustodian:testCannotLazyMintTwice() (gas: 82105) -TestCustodian:testCannotMintInvalidLoanInvalidCustodian() (gas: 72477) -TestCustodian:testCannotMintInvalidLoanValidCustodian() (gas: 77943) -TestCustodian:testCustodianCannotBeAuthorized() (gas: 142026) -TestCustodian:testCustodySelector() (gas: 2732377) -TestCustodian:testDefaultCustodySelectorRevert() (gas: 72478) -TestCustodian:testGenerateOrderInvalidPostRepayment() (gas: 172939) -TestCustodian:testGenerateOrderInvalidPostSettlement() (gas: 163178) -TestCustodian:testGenerateOrderRepay() (gas: 177099) -TestCustodian:testGenerateOrderRepayAsRepayApprovedBorrower() (gas: 193567) -TestCustodian:testGenerateOrderRepayERC1155AndERC20() (gas: 876545) -TestCustodian:testGenerateOrderRepayERC1155AndERC20HandlerAuthorized() (gas: 804495) -TestCustodian:testGenerateOrderRepayInvalidHookAddress() (gas: 97556) -TestCustodian:testGenerateOrderRepayInvalidHookReturnType() (gas: 91917) -TestCustodian:testGenerateOrderRepayNotBorrower() (gas: 106827) -TestCustodian:testGenerateOrderSettlement() (gas: 154891) -TestCustodian:testGenerateOrderSettlementHandlerAuthorized() (gas: 160288) -TestCustodian:testGenerateOrderSettlementNoActiveLoan() (gas: 163374) -TestCustodian:testGenerateOrderSettlementUnauthorized() (gas: 101809) -TestCustodian:testGenerateOrdersWithLoanStartAtBlockTimestampInvalidLoan() (gas: 461511) -TestCustodian:testGetBorrower() (gas: 78603) -TestCustodian:testInvalidAction() (gas: 179808) -TestCustodian:testInvalidActionRepayInActiveLoan() (gas: 130095) -TestCustodian:testInvalidActionSettleActiveLoan() (gas: 130032) -TestCustodian:testInvalidEncodedData() (gas: 26219) -TestCustodian:testMintWithApprovalSetAsBorrower() (gas: 366740) -TestCustodian:testMintWithApprovalSetAsBorrowerInvalidLoan() (gas: 64505) -TestCustodian:testMintWithApprovalSetNotAuthorized() (gas: 66842) -TestCustodian:testName() (gas: 7077) -TestCustodian:testNonPayableFunctions() (gas: 215289) -TestCustodian:testOnlySeaport() (gas: 17915) -TestCustodian:testPreviewOrderNoActiveLoan() (gas: 105729) -TestCustodian:testPreviewOrderRepay() (gas: 232018) -TestCustodian:testPreviewOrderSettlement() (gas: 191813) -TestCustodian:testPreviewOrderSettlementInvalidFufliller() (gas: 110326) -TestCustodian:testPreviewOrderSettlementInvalidRepayer() (gas: 116902) -TestCustodian:testRatifyOrder() (gas: 183917) -TestCustodian:testSeaportMetadata() (gas: 8588) -TestCustodian:testSupportsInterface() (gas: 9428) -TestCustodian:testSymbol() (gas: 7194) -TestCustodian:testTokenURI() (gas: 85244) -TestCustodian:testTokenURIInvalidLoan() (gas: 13179) +TestCustodian:testCustodianCannotBeAuthorized() (gas: 141762) +TestCustodian:testCustodySelector() (gas: 1975305) +TestCustodian:testDefaultCustodySelectorRevert() (gas: 72301) +TestCustodian:testGenerateOrderInvalidPostRepayment() (gas: 161196) +TestCustodian:testGenerateOrderInvalidPostSettlement() (gas: 154883) +TestCustodian:testGenerateOrderRepay() (gas: 165356) +TestCustodian:testGenerateOrderRepayERC1155AndERC20() (gas: 860554) +TestCustodian:testGenerateOrderRepayERC1155AndERC20HandlerAuthorized() (gas: 794955) +TestCustodian:testGenerateOrderRepayInvalidHookAddress() (gas: 97362) +TestCustodian:testGenerateOrderRepayInvalidHookReturnType() (gas: 91788) +TestCustodian:testGenerateOrderRepayNotBorrower() (gas: 96209) +TestCustodian:testGenerateOrderSettlement() (gas: 146585) +TestCustodian:testGenerateOrderSettlementHandlerAuthorized() (gas: 151993) +TestCustodian:testGenerateOrderSettlementNoActiveLoan() (gas: 158096) +TestCustodian:testGenerateOrderSettlementUnauthorized() (gas: 101735) +TestCustodian:testGenerateOrdersWithLoanStartAtBlockTimestampInvalidLoan() (gas: 461954) +TestCustodian:testInvalidAction() (gas: 179384) +TestCustodian:testInvalidActionRepayInActiveLoan() (gas: 129808) +TestCustodian:testInvalidActionSettleActiveLoan() (gas: 129790) +TestCustodian:testInvalidEncodedData() (gas: 26064) +TestCustodian:testNonPayableFunctions() (gas: 145115) +TestCustodian:testOnlySeaport() (gas: 17738) +TestCustodian:testPreviewOrderNoActiveLoan() (gas: 105721) +TestCustodian:testPreviewOrderRepay() (gas: 216678) +TestCustodian:testPreviewOrderSettlement() (gas: 183427) +TestCustodian:testPreviewOrderSettlementInvalidFufliller() (gas: 110202) +TestCustodian:testPreviewOrderSettlementInvalidRepayer() (gas: 106296) +TestCustodian:testRatifyOrder() (gas: 172130) +TestCustodian:testSeaportMetadata() (gas: 8496) +TestCustodian:testSupportsInterface() (gas: 5823) TestLenderEnforcer:testLERevertAdditionalTransfersFromLender() (gas: 76455) TestLenderEnforcer:testLERevertInvalidLoanTerms() (gas: 81096) TestLenderEnforcer:testLEValidLoanTerms() (gas: 72169) TestLenderEnforcer:testLEValidLoanTermsAnyBorrower() (gas: 72234) TestLenderEnforcer:testLEValidLoanTermsWithAdditionalTransfers() (gas: 73525) -TestLoanCombinations:testLoan20For721SimpleInterestDutchFixedRepay() (gas: 593400) -TestLoanCombinations:testLoan20for20SimpleInterestDutchFixedRepay() (gas: 599835) -TestLoanCombinations:testLoan721for20SimpleInterestDutchFixedRepay() (gas: 590053) -TestLoanCombinations:testLoanAstariaSettlementRepay() (gas: 579870) +TestLoanCombinations:testLoan20For721SimpleInterestDutchFixedRepay() (gas: 581478) +TestLoanCombinations:testLoan20for20SimpleInterestDutchFixedRepay() (gas: 587913) +TestLoanCombinations:testLoan721for20SimpleInterestDutchFixedRepay() (gas: 578143) +TestLoanCombinations:testLoanAstariaSettlementRepay() (gas: 567960) TestNewLoan:testBuyNowPayLater() (gas: 3018543) TestNewLoan:testNewLoanAs1271ProxyAccountSender() (gas: 874195) TestNewLoan:testNewLoanAs1271ProxyAccountThirdPartyFiller() (gas: 885220) @@ -84,17 +72,16 @@ TestNewLoan:testNewLoanERC721CollateralDefaultTerms2() (gas: 429635) TestNewLoan:testNewLoanRefinance() (gas: 593205) TestNewLoan:testNewLoanViaOriginatorBorrowerApprovalAndLenderApproval() (gas: 324707) TestNewLoan:testNewLoanViaOriginatorLenderApproval() (gas: 383503) -TestNewLoan:testSettleLoan() (gas: 642162) +TestNewLoan:testSettleLoan() (gas: 636847) TestPausableNonReentrant:testNotOwner() (gas: 21276) TestPausableNonReentrant:testPauseAndUnpause() (gas: 22643) TestPausableNonReentrant:testReentrancy() (gas: 15404) TestPausableNonReentrant:testUnpauseWhenNotPaused() (gas: 12604) -TestRepayLoan:testRepayLoanApprovedRepayer() (gas: 666799) -TestRepayLoan:testRepayLoanBase() (gas: 599665) -TestRepayLoan:testRepayLoanGenerateOrderNotSeaport() (gas: 438777) -TestRepayLoan:testRepayLoanInSettlement() (gas: 585692) -TestRepayLoan:testRepayLoanInvalidRepayer() (gas: 603729) -TestRepayLoan:testRepayLoanThatDoesNotExist() (gas: 857990) +TestRepayLoan:testRepayLoanBase() (gas: 587731) +TestRepayLoan:testRepayLoanGenerateOrderNotSeaport() (gas: 438666) +TestRepayLoan:testRepayLoanInSettlement() (gas: 585332) +TestRepayLoan:testRepayLoanInvalidRepayer() (gas: 579691) +TestRepayLoan:testRepayLoanThatDoesNotExist() (gas: 829691) TestSimpleInterestPricing:test_calculateInterest() (gas: 887709) TestSimpleInterestPricing:test_getPaymentConsideration() (gas: 935199) TestSimpleInterestPricing:test_getRefinanceConsideration() (gas: 926059) @@ -115,8 +102,8 @@ TestStarport:testDefaultFeeRake2() (gas: 445805) TestStarport:testDefaultFeeRakeExoticDebt() (gas: 394352) TestStarport:testEIP712Signing() (gas: 83093) TestStarport:testExcessiveFeeRake() (gas: 19992) -TestStarport:testExoticDebtWithCustomPricingAndRepayment() (gas: 1237813) -TestStarport:testExoticDebtWithCustomPricingAndSettlement() (gas: 1695865) +TestStarport:testExoticDebtWithCustomPricingAndRepayment() (gas: 1225352) +TestStarport:testExoticDebtWithCustomPricingAndSettlement() (gas: 1690270) TestStarport:testExoticDebtWithNoCaveatsNotAsBorrower() (gas: 376631) TestStarport:testIncrementCaveatNonce() (gas: 35117) TestStarport:testInitializedFlagSetProperly() (gas: 67372) @@ -128,8 +115,8 @@ TestStarport:testInvalidItemType() (gas: 151908) TestStarport:testInvalidTransferLengthCollateral() (gas: 154177) TestStarport:testInvalidTransferLengthDebt() (gas: 175976) TestStarport:testInvalidateCaveatSalt() (gas: 33428) -TestStarport:testNonDefaultCustodianCustodyCallFails() (gas: 264259) -TestStarport:testNonDefaultCustodianCustodyCallSuccess() (gas: 290384) +TestStarport:testNonDefaultCustodianCustodyCallFails() (gas: 264236) +TestStarport:testNonDefaultCustodianCustodyCallSuccess() (gas: 290428) TestStarport:testNonPayableFunctions() (gas: 114479) TestStarport:testOverrideFeeRake() (gas: 379857) TestStarport:testPause() (gas: 18127) diff --git a/src/Custodian.sol b/src/Custodian.sol index 0623d52a..0bab6944 100644 --- a/src/Custodian.sol +++ b/src/Custodian.sol @@ -42,7 +42,7 @@ import {FixedPointMathLib} from "solady/src/utils/FixedPointMathLib.sol"; import {SafeTransferLib} from "solady/src/utils/SafeTransferLib.sol"; import {LibString} from "solady/src/utils/LibString.sol"; -contract Custodian is ERC721, ContractOffererInterface { +contract Custodian is ContractOffererInterface { using {StarportLib.getId} for Starport.Loan; using {LibString.concat} for string; @@ -100,49 +100,6 @@ contract Custodian is ERC721, ContractOffererInterface { /* FUNCTION OVERRIDES */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ - /** - * @dev The name of the ERC721 contract - * @return string The name of the contract - */ - function name() public pure override returns (string memory) { - return "Starport Custodian"; - } - - /** - * @dev The symbol of the ERC721 contract - * @return string The symbol of the contract - */ - function symbol() public pure override returns (string memory) { - return "SC"; - } - - /** - * @dev ERC-721 tokenURI override - * @param loanId The id of the custody token/loan - * @return string URI of the custody token/loan - */ - function tokenURI(uint256 loanId) public view override returns (string memory) { - if (!_exists(loanId)) { - revert InvalidLoan(); - } - return string("https://astaria.xyz/metadata/loan/").concat(LibString.toString(loanId)); - } - - /** - * @dev Helper to determine if an interface is supported by this contract - * @param interfaceId The interface to check - * @return bool Returns true if the interface is supported - */ - function supportsInterface(bytes4 interfaceId) - public - view - override (ERC721, ContractOffererInterface) - returns (bool) - { - return interfaceId == type(ERC721).interfaceId || interfaceId == type(ContractOffererInterface).interfaceId - || super.supportsInterface(interfaceId); - } - /** * @dev onERC1155Received handler, if we are able to increment the counter * in seaport that means we have not entered into seaport we dont add for @@ -157,38 +114,6 @@ contract Custodian is ERC721, ContractOffererInterface { /* EXTERNAL FUNCTIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ - /** - * @dev Mints a custody token for a loan. - * @param loan The loan to mint a custody token for - */ - function mint(Starport.Loan calldata loan) external { - _validateAndMint(loan); - } - - /** - * @dev Mints a custody token for a loan. - * @param loan The loan to mint a custody token for - * @param approvedTo The address with pre approvals set - */ - function mintWithApprovalSet(Starport.Loan calldata loan, address approvedTo) external { - if (msg.sender != loan.borrower) { - revert NotAuthorized(); - } - _approve(loan.borrower, approvedTo, _validateAndMint(loan)); - } - - /** - * @dev internal helper that validates and mints a custody token for a loan. - * @param loan The loan to mint a custody token for - */ - function _validateAndMint(Starport.Loan calldata loan) internal returns (uint256 loanId) { - loanId = loan.getId(); - if (loan.custodian != address(this) || SP.closed(loanId)) { - revert InvalidLoan(); - } - _safeMint(loan.borrower, loanId); - } - /** * @dev Generates the order for this contract offerer * @return ratifyOrderMagicValue The magic value returned by the ratify @@ -222,7 +147,7 @@ contract Custodian is ERC721, ContractOffererInterface { } bool loanActive = Status(loan.terms.status).isActive(loan, close.extraData); if (close.action == Actions.Repayment && loanActive) { - if (fulfiller != getBorrower(loan) && fulfiller != _getApproved(loan.getId())) { + if (fulfiller != loan.borrower) { revert InvalidRepayer(); } @@ -292,13 +217,12 @@ contract Custodian is ERC721, ContractOffererInterface { /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /** - * @dev Fetches the borrower of the loan, first checks to see if we've minted the token for the loan - * @param loan Loan to get the borrower of - * @return address The address of the loan borrower(returns the ownerOf the token if any) defaults to loan.borrower + * @dev Helper to determine if an interface is supported by this contract + * @param interfaceId The interface to check + * @return bool Returns true if the interface is supported */ - function getBorrower(Starport.Loan memory loan) public view returns (address) { - uint256 loanId = loan.getId(); - return _exists(loanId) ? ownerOf(loanId) : loan.borrower; + function supportsInterface(bytes4 interfaceId) public view override returns (bool) { + return interfaceId == type(ContractOffererInterface).interfaceId; } /** @@ -324,7 +248,7 @@ contract Custodian is ERC721, ContractOffererInterface { } bool loanActive = Status(loan.terms.status).isActive(loan, close.extraData); if (close.action == Actions.Repayment && loanActive) { - if (fulfiller != getBorrower(loan) && fulfiller != _getApproved(loan.getId())) { + if (fulfiller != loan.borrower) { revert InvalidRepayer(); } offer = loan.collateral; @@ -453,10 +377,6 @@ contract Custodian is ERC721, ContractOffererInterface { */ function _settleLoan(Starport.Loan memory loan) internal virtual { _beforeSettleLoanHook(loan); - uint256 loanId = loan.getId(); - if (_exists(loanId)) { - _burn(loanId); - } SP.settle(loan); _afterSettleLoanHook(loan); } diff --git a/test/integration-testing/TestRepayLoan.sol b/test/integration-testing/TestRepayLoan.sol index cc03cae0..6dc01e3d 100644 --- a/test/integration-testing/TestRepayLoan.sol +++ b/test/integration-testing/TestRepayLoan.sol @@ -108,34 +108,6 @@ contract TestRepayLoan is StarportTest { }); } - function testRepayLoanApprovedRepayer() public { - uint256 borrowAmount = 1e18; - Starport.Terms memory terms = Starport.Terms({ - status: address(status), - settlement: address(settlement), - pricing: address(pricing), - pricingData: defaultPricingData, - settlementData: defaultSettlementData, - statusData: defaultStatusData - }); - - Starport.Loan memory loan = - _createLoan721Collateral20Debt({lender: lender.addr, borrowAmount: borrowAmount, terms: terms}); - - vm.startPrank(borrower.addr); - skip(10 days); - SimpleInterestPricing.Details memory details = - abi.decode(loan.terms.pricingData, (SimpleInterestPricing.Details)); - uint256 interest = SimpleInterestPricing(loan.terms.pricing).calculateInterest( - 10 days, loan.debt[0].amount, details.rate, details.decimals - ); - erc20s[0].approve(address(consideration), loan.debt[0].amount + interest); - custodian.mintWithApprovalSet(loan, address(this)); - vm.stopPrank(); - - _repayLoan(loan, address(this)); - } - // calling generateOrder on the Custodian to test the onlySeaport modifier function testRepayLoanGenerateOrderNotSeaport() public { Starport.Terms memory terms = Starport.Terms({ diff --git a/test/unit-testing/TestCustodian.sol b/test/unit-testing/TestCustodian.sol index b40ecc38..92a33533 100644 --- a/test/unit-testing/TestCustodian.sol +++ b/test/unit-testing/TestCustodian.sol @@ -57,32 +57,17 @@ contract TestCustodian is StarportTest, DeepEq, MockCall { super.setUp(); Starport.Loan memory loan = newLoanWithDefaultTerms(false); - Custodian(custodian).mint(loan); loan.toStorage(activeLoan); skip(1); } function testNonPayableFunctions() public { - vm.expectRevert(); - payable(address(custodian)).call{value: 1 ether}( - abi.encodeWithSelector(Custodian.tokenURI.selector, uint256(0)) - ); - vm.expectRevert(); - payable(address(custodian)).call{value: 1 ether}( - abi.encodeWithSelector(Custodian.getBorrower.selector, uint256(0)) - ); vm.expectRevert(); payable(address(custodian)).call{value: 1 ether}( abi.encodeWithSelector(Custodian.supportsInterface.selector, bytes4(0)) ); vm.expectRevert(); - payable(address(custodian)).call{value: 1 ether}(abi.encodeWithSelector(Custodian.name.selector)); - vm.expectRevert(); - payable(address(custodian)).call{value: 1 ether}(abi.encodeWithSelector(Custodian.symbol.selector)); - vm.expectRevert(); - payable(address(custodian)).call{value: 1 ether}(abi.encodeWithSelector(Custodian.mint.selector, activeLoan)); - vm.expectRevert(); payable(address(custodian)).call{value: 1 ether}( abi.encodeWithSelector( Custodian.ratifyOrder.selector, @@ -122,84 +107,10 @@ contract TestCustodian is StarportTest, DeepEq, MockCall { ); } - function testName() public { - assertEq(custodian.name(), "Starport Custodian"); - } - - function testSymbol() public { - assertEq(custodian.symbol(), "SC"); - } - - function testTokenURI() public { - string memory expected = string( - abi.encodePacked( - "https://astaria.xyz/metadata/loan/", LibString.toString(uint256(keccak256(abi.encode(activeLoan)))) - ) - ); - assertEq(custodian.tokenURI(uint256(keccak256(abi.encode(activeLoan)))), expected); - } - - function testTokenURIInvalidLoan() public { - vm.expectRevert(abi.encodeWithSelector(Custodian.InvalidLoan.selector)); - custodian.tokenURI(uint256(0)); - } - event Approval(address owner, address account, uint256 id); - function testMintWithApprovalSetAsBorrower() public { - Starport.Loan memory loan = generateDefaultLoanTerms(); - loan.collateral[0].identifier = uint256(3); - - newLoan(loan, bytes32(msg.sig), bytes32(msg.sig), borrower.addr); - loan.start = block.timestamp; - loan.originator = borrower.addr; - // vm.expectEmit(); - // emit Transfer(address(0), borrower.addr, loan.getId()); - // vm.expectEmit(address(custodian)); - // emit Approval(loan.borrower, address(this), loan.getId()); - vm.prank(borrower.addr); - Custodian(custodian).mintWithApprovalSet(loan, address(this)); - assert(Custodian(custodian).getApproved(loan.getId()) == address(this)); - } - - function testMintWithApprovalSetAsBorrowerInvalidLoan() public { - Starport.Loan memory loan = generateDefaultLoanTerms(); - loan.collateral[0].identifier = uint256(3); - loan.start = block.timestamp; - loan.originator = borrower.addr; - loan.custodian = address(this); - vm.expectRevert(abi.encodeWithSelector(Custodian.InvalidLoan.selector)); - vm.prank(borrower.addr); - Custodian(custodian).mintWithApprovalSet(loan, address(this)); - } - - function testMintWithApprovalSetNotAuthorized() public { - vm.expectRevert(abi.encodeWithSelector(Custodian.NotAuthorized.selector)); - Custodian(custodian).mintWithApprovalSet(activeLoan, address(this)); - } - - function testCannotMintInvalidLoanValidCustodian() public { - activeLoan.borrower = address(0); - vm.expectRevert(abi.encodeWithSelector(Custodian.InvalidLoan.selector)); - Custodian(custodian).mint(activeLoan); - } - - function testCannotMintInvalidLoanInvalidCustodian() public { - activeLoan.custodian = address(0); - vm.expectRevert(abi.encodeWithSelector(Custodian.InvalidLoan.selector)); - Custodian(custodian).mint(activeLoan); - } - - function testCannotLazyMintTwice() public { - vm.expectRevert(abi.encodeWithSelector(ERC721.TokenAlreadyExists.selector)); - Custodian(custodian).mint(activeLoan); - } - function testSupportsInterface() public { assertTrue(custodian.supportsInterface(type(ContractOffererInterface).interfaceId)); - assertTrue(custodian.supportsInterface(type(ERC721).interfaceId)); - assertTrue(custodian.supportsInterface(bytes4(0x5b5e139f))); - assertTrue(custodian.supportsInterface(bytes4(0x01ffc9a7))); } function testOnlySeaport() public { @@ -215,10 +126,6 @@ contract TestCustodian is StarportTest, DeepEq, MockCall { custodian.getSeaportMetadata(); } - function testGetBorrower() public { - assertEq(custodian.getBorrower(activeLoan.toMemory()), activeLoan.borrower); - } - function testCustodySelector() public { MockCustodian custodianMock = new MockCustodian(SP, address(seaport)); vm.prank(address(custodianMock.SP())); @@ -241,19 +148,6 @@ contract TestCustodian is StarportTest, DeepEq, MockCall { abi.encode(Custodian.Command(Actions.Repayment, activeLoan, "")) ); } - //TODO: add assertions - - function testGenerateOrderRepayAsRepayApprovedBorrower() public { - vm.prank(activeLoan.borrower); - custodian.approve(address(this), activeLoan.getId()); - vm.prank(seaportAddr); - custodian.generateOrder( - address(this), - new SpentItem[](0), - activeDebt, - abi.encode(Custodian.Command(Actions.Repayment, activeLoan, "")) - ); - } function testGenerateOrdersWithLoanStartAtBlockTimestampInvalidLoan() public { // 1155 diff --git a/test/unit-testing/TestStarport.sol b/test/unit-testing/TestStarport.sol index 9aa39c43..176ebad6 100644 --- a/test/unit-testing/TestStarport.sol +++ b/test/unit-testing/TestStarport.sol @@ -274,7 +274,6 @@ contract TestStarport is StarportTest, DeepEq { super.setUp(); mockCustodian = new MockCustodian(SP, address(seaport)); Starport.Loan memory loan = newLoanWithDefaultTerms(); - Custodian(custodian).mint(loan); loan.toStorage(activeLoan); }