From 878e192d6079086c959c5edf012e570748ce7049 Mon Sep 17 00:00:00 2001 From: Andrew Redden Date: Wed, 11 Oct 2023 21:48:58 -0300 Subject: [PATCH] custodian updates --- src/Custodian.sol | 6 ++---- src/custodians/DefaultCustodian.sol | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 src/custodians/DefaultCustodian.sol diff --git a/src/Custodian.sol b/src/Custodian.sol index 31f54324..32d9c605 100644 --- a/src/Custodian.sol +++ b/src/Custodian.sol @@ -37,7 +37,7 @@ import {LoanManager} from "starport-core/LoanManager.sol"; import {ConduitHelper} from "starport-core/ConduitHelper.sol"; import {StarPortLib} from "starport-core/lib/StarPortLib.sol"; -contract Custodian is ContractOffererInterface, TokenReceiverInterface, ConduitHelper, ERC721 { +abstract contract Custodian is ContractOffererInterface, TokenReceiverInterface, ConduitHelper, ERC721 { using {StarPortLib.getId} for LoanManager.Loan; LoanManager public immutable LM; @@ -167,9 +167,7 @@ contract Custodian is ContractOffererInterface, TokenReceiverInterface, ConduitH bytes32[] calldata orderHashes, uint256 contractNonce, bytes calldata context - ) external virtual onlyLoanManager returns (bytes4 selector) { - selector = Custodian.custody.selector; - } + ) external virtual onlyLoanManager returns (bytes4 selector); //todo work with seaport function getSeaportMetadata() external pure returns (string memory, Schema[] memory schemas) { diff --git a/src/custodians/DefaultCustodian.sol b/src/custodians/DefaultCustodian.sol new file mode 100644 index 00000000..44185a14 --- /dev/null +++ b/src/custodians/DefaultCustodian.sol @@ -0,0 +1,16 @@ +import {Custodian} from "starport-core/Custodian.sol"; +import {LoanManager} from "starport-core/LoanManager.sol"; +import {ReceivedItem} from "starport-types/src/lib/ConsiderationStructs.sol"; + +contract DefaultCustodian is Custodian { + constructor(LoanManager LM_, address seaport_) Custodian(LM_, seaport_) {} + + function custody( + ReceivedItem[] calldata consideration, + bytes32[] calldata orderHashes, + uint256 contractNonce, + bytes calldata context + ) external virtual onlyLoanManager returns (bytes4 selector) { + selector = Custodian.custody.selector; + } +}