-
Notifications
You must be signed in to change notification settings - Fork 10
/
ILootbox.sol
274 lines (224 loc) · 7.12 KB
/
ILootbox.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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.9;
// Interface generated by solface: https://github.com/moonstream-to/solface
// solface version: 0.1.0
// Interface ID: 3de9ca5a
interface ILootbox {
// structs
struct Compound0 {
uint256 rewardType;
address tokenAddress;
uint256 tokenId;
uint256 amount;
uint256 weight;
}
struct Compound1 {
uint256 rewardType;
address tokenAddress;
uint256 tokenId;
uint256 amount;
uint256 weight;
}
struct Compound2 {
uint256 rewardType;
address tokenAddress;
uint256 tokenId;
uint256 amount;
uint256 weight;
}
struct Compound3 {
uint256 rewardType;
address tokenAddress;
uint256 tokenId;
uint256 amount;
uint256 weight;
}
struct Compound4 {
uint256 rewardType;
address tokenAddress;
uint256 tokenId;
uint256 amount;
uint256 weight;
}
struct Compound5 {
uint256 rewardType;
address tokenAddress;
uint256 tokenId;
uint256 amount;
uint256 weight;
}
// events
event LootboxCreated(uint256 lootboxId);
event LootboxItemAdded(uint256 lootboxId, Compound0 lootboxItem);
event LootboxItemRemoved(uint256 lootboxId, Compound1 lootboxItem);
event LootboxOpened(
uint256 lootboxId,
address opener,
uint256 lootboxItemCount
);
event LootboxOpeningBegan(address lootboxOwner, uint256 lootboxId);
event LootboxOpeningCompleted(
address lootboxOwner,
uint256 lootboxId,
bytes32 requestId,
uint256 randomness
);
event OwnershipTransferred(address previousOwner, address newOwner);
event Paused(address account);
event Unpaused(address account);
// functions
// Selector: df754a17
function ActiveLootboxOpenings(
bytes32
)
external
view
returns (
uint32 status,
address user,
uint256 lootboxId,
uint256 randomness
);
// Selector: 1d65c057
function CurrentOpeningforUser(address) external view returns (bytes32);
// Selector: 3dca84ef
function ERC1155_REWARD_TYPE() external view returns (uint256);
// Selector: f2458380
function ERC20_REWARD_TYPE() external view returns (uint256);
// Selector: cbb27da6
function ORDINARY_LOOTBOX_TYPE() external view returns (uint256);
// Selector: c08b8e11
function RANDOM_LOOTBOX_TYPE_1() external view returns (uint256);
// Selector: c33c14f3
function TERMINUS_MINTABLE_REWARD_TYPE() external view returns (uint256);
// Selector: 5af310aa
function addLootboxItem(uint256 lootboxId, Compound2 memory item) external;
// Selector: 35ed4e06
function administratorPoolId() external view returns (uint256);
// Selector: 71a55fbc
function administratorTerminusAddress() external view returns (address);
// Selector: 4f9402a7
function batchMintLootboxes(
uint256 lootboxId,
address[] memory toAddresses,
uint256[] memory amounts
) external;
// Selector: 756b9103
function batchMintLootboxesConstant(
uint256 lootboxId,
address[] memory toAddresses,
uint256 amount
) external;
// Selector: d9ced92c
function changeAdministratorPoolId(uint256 _administratorPoolId) external;
// Selector: 20619be0
function completeRandomLootboxOpening() external;
// Selector: d36eeb39
function createLootbox(
Compound3[] memory items,
uint256 lootboxType
) external;
// Selector: 5bd92be0
function createLootboxWithTerminusPool(
Compound4[] memory items,
uint256 terminusPoolId,
uint256 lootboxType
) external;
// Selector: 82158e85
function getChainlinkVRFFee() external view returns (uint256);
// Selector: 698e6a9b
function getChainlinkVRFKeyhash() external view returns (bytes32);
// Selector: 7e3a7d8e
function getLootboxBalance(
uint256 lootboxId,
address owner
) external view returns (uint256);
// Selector: a5ce8d2d
function getLootboxItemByIndex(
uint256 lootboxId,
uint256 itemIndex
) external view returns (Compound5 memory);
// Selector: ac8e014a
function getLootboxURI(
uint256 lootboxId
) external view returns (string memory);
// Selector: c634b78e
function grantAdminRole(address to) external;
// Selector: bff324db
function lootboxIdbyTerminusPoolId(uint256) external view returns (uint256);
// Selector: adfccd0f
function lootboxItemCount(
uint256 lootboxId
) external view returns (uint256);
// Selector: 08ecb9a6
function lootboxTypebyLootboxId(uint256) external view returns (uint256);
// Selector: a4f9769b
function mintLootbox(
uint256 lootboxId,
address recipient,
uint256 amount,
bytes memory data
) external;
// Selector: bc197c81
function onERC1155BatchReceived(
address,
address,
uint256[] memory,
uint256[] memory,
bytes memory
) external returns (bytes4);
// Selector: f23a6e61
function onERC1155Received(
address,
address,
uint256,
uint256,
bytes memory
) external returns (bytes4);
// Selector: 70ff0877
function openLootbox(uint256 lootboxId, uint256 count) external;
// Selector: 8da5cb5b
function owner() external view returns (address);
// Selector: 8456cb59
function pause() external;
// Selector: 5c975abb
function paused() external view returns (bool);
// Selector: 94985ddd
function rawFulfillRandomness(
bytes32 requestId,
uint256 randomness
) external;
// Selector: c53dabe5
function removeLootboxItem(uint256 lootboxId, uint256 itemIndex) external;
// Selector: 715018a6
function renounceOwnership() external;
// Selector: 9a19c7b0
function revokeAdminRole(address from) external;
// Selector: 15d67447
function setLootboxURI(uint256 lootboxId, string memory uri) external;
// Selector: 01ffc9a7
function supportsInterface(bytes4 interfaceId) external view returns (bool);
// Selector: 3c70964c
function surrenderTerminusControl() external;
// Selector: 50ebd88e
function surrenderTerminusPools(uint256[] memory poolIds) external;
// Selector: a6df6635
function terminusAddress() external view returns (address);
// Selector: c9f3e65e
function terminusPoolIdbyLootboxId(uint256) external view returns (uint256);
// Selector: daad255a
function totalLootboxCount() external view returns (uint256);
// Selector: f2fde38b
function transferOwnership(address newOwner) external;
// Selector: 3f4ba83a
function unpause() external;
// Selector: 39ead720
function withdrawERC1155(
address tokenAddress,
uint256 tokenId,
uint256 amount
) external;
// Selector: a1db9782
function withdrawERC20(address tokenAddress, uint256 amount) external;
// errors
}