-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathIOpenseaExchange.sol
137 lines (124 loc) · 3.94 KB
/
IOpenseaExchange.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
// SPDX-License-Identifier: Beta Software
pragma solidity ^0.8;
interface IOpenseaExchange {
error InvalidTime();
enum OrderType {
FULL_OPEN,
PARTIAL_OPEN,
FULL_RESTRICTED,
PARTIAL_RESTRICTED
}
enum ItemType {
NATIVE,
ERC20,
ERC721,
ERC1155,
ERC721_WITH_CRITERIA,
ERC1155_WITH_CRITERIA
}
enum BasicOrderType {
ETH_TO_ERC721_FULL_OPEN,
ETH_TO_ERC721_PARTIAL_OPEN,
ETH_TO_ERC721_FULL_RESTRICTED,
ETH_TO_ERC721_PARTIAL_RESTRICTED,
ETH_TO_ERC1155_FULL_OPEN,
ETH_TO_ERC1155_PARTIAL_OPEN,
ETH_TO_ERC1155_FULL_RESTRICTED,
ETH_TO_ERC1155_PARTIAL_RESTRICTED,
ERC20_TO_ERC721_FULL_OPEN,
ERC20_TO_ERC721_PARTIAL_OPEN,
ERC20_TO_ERC721_FULL_RESTRICTED,
ERC20_TO_ERC721_PARTIAL_RESTRICTED,
ERC20_TO_ERC1155_FULL_OPEN,
ERC20_TO_ERC1155_PARTIAL_OPEN,
ERC20_TO_ERC1155_FULL_RESTRICTED,
ERC20_TO_ERC1155_PARTIAL_RESTRICTED,
ERC721_TO_ERC20_FULL_OPEN,
ERC721_TO_ERC20_PARTIAL_OPEN,
ERC721_TO_ERC20_FULL_RESTRICTED,
ERC721_TO_ERC20_PARTIAL_RESTRICTED,
ERC1155_TO_ERC20_FULL_OPEN,
ERC1155_TO_ERC20_PARTIAL_OPEN,
ERC1155_TO_ERC20_FULL_RESTRICTED,
ERC1155_TO_ERC20_PARTIAL_RESTRICTED
}
struct OfferItem {
ItemType itemType;
address token;
uint256 identifierOrCriteria;
uint256 startAmount;
uint256 endAmount;
}
struct ConsiderationItem {
ItemType itemType;
address token;
uint256 identifierOrCriteria;
uint256 startAmount;
uint256 endAmount;
address payable recipient;
}
struct OrderParameters {
address offerer;
address zone;
OfferItem[] offer;
ConsiderationItem[] consideration;
OrderType orderType;
uint256 startTime;
uint256 endTime;
bytes32 zoneHash;
uint256 salt;
bytes32 conduitKey;
uint256 totalOriginalConsiderationItems;
}
struct Order {
OrderParameters parameters;
bytes signature;
}
struct OrderComponents {
address offerer;
address zone;
OfferItem[] offer;
ConsiderationItem[] consideration;
OrderType orderType;
uint256 startTime;
uint256 endTime;
bytes32 zoneHash;
uint256 salt;
bytes32 conduitKey;
uint256 nonce;
}
struct AdditionalRecipient {
uint256 amount;
address payable recipient;
}
struct BasicOrderParameters {
address considerationToken;
uint256 considerationIdentifier;
uint256 considerationAmount;
address payable offerer;
address zone;
address offerToken;
uint256 offerIdentifier;
uint256 offerAmount;
BasicOrderType basicOrderType;
uint256 startTime;
uint256 endTime;
bytes32 zoneHash;
uint256 salt;
bytes32 offererConduitKey;
bytes32 fulfillerConduitKey;
uint256 totalOriginalAdditionalRecipients;
AdditionalRecipient[] additionalRecipients;
bytes signature;
}
function cancel(OrderComponents[] calldata orders) external returns (bool cancelled);
function validate(Order[] calldata orders) external returns (bool validated);
function fulfillBasicOrder(BasicOrderParameters calldata parameters) external payable returns (bool fulfilled);
function fulfillOrder(Order calldata order, bytes32 fulfillerConduitKey) external payable returns (bool fulfilled);
function getOrderStatus(bytes32 orderHash)
external
view
returns (bool isValidated, bool isCancelled, uint256 totalFilled, uint256 totalSize);
function getOrderHash(OrderComponents calldata order) external view returns (bytes32 orderHash);
function getNonce(address offerer) external view returns (uint256 nonce);
}