-
Notifications
You must be signed in to change notification settings - Fork 10
/
IGOFP.sol
243 lines (211 loc) · 6.1 KB
/
IGOFP.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
// SPDX-License-Identifier: Apache-2.0
/**
* Authors: Moonstream Engineering (engineering@moonstream.to)
* GitHub: https://github.com/bugout-dev/engine
*/
pragma solidity ^0.8.9;
// Interface generated by solface: https://github.com/bugout-dev/solface
// solface version: 0.0.5
// Interface ID: d4c1a036
interface IGOFP {
// structs
struct Compound0 {
address terminusAddress;
uint256 terminusPoolId;
uint256 rewardAmount;
}
struct Compound1 {
address playerTokenAddress;
address paymentTokenAddress;
uint256 paymentAmount;
bool isActive;
bool isChoosingActive;
string uri;
uint256[] stages;
bool isForgiving;
}
struct Compound2 {
address terminusAddress;
uint256 terminusPoolId;
uint256 rewardAmount;
}
// events
event PathChosen(
uint256 sessionId,
uint256 tokenId,
uint256 stage,
uint256 path
);
event PathRegistered(uint256 sessionId, uint256 stage, uint256 path);
event PathRewardChanged(
uint256 sessionId,
uint256 stage,
uint256 path,
address terminusAddress,
uint256 terminusPoolId,
uint256 rewardAmount
);
event SessionActivated(uint256 sessionId, bool isActive);
event SessionChoosingActivated(uint256 sessionId, bool isChoosingActive);
event SessionCreated(
uint256 sessionId,
address playerTokenAddress,
address paymentTokenAddress,
uint256 paymentAmount,
string uri,
bool active,
bool isForgiving
);
event SessionUriChanged(uint256 sessionId, string uri);
event StageRewardChanged(
uint256 sessionId,
uint256 stage,
address terminusAddress,
uint256 terminusPoolId,
uint256 rewardAmount
);
// functions
// Selector: a69d7337
function adminTerminusInfo() external view returns (address, uint256);
// Selector: b8bfca94
function chooseCurrentStagePaths(
uint256 sessionId,
uint256[] memory tokenIds,
uint256[] memory paths
) external;
// Selector: 2b0f430a
function createSession(
address playerTokenAddress,
address paymentTokenAddress,
uint256 paymentAmount,
bool isActive,
string memory uri,
uint256[] memory stages,
bool isForgiving
) external;
// Selector: 59dbfb2f
function getCorrectPathForStage(
uint256 sessionId,
uint256 stage
) external view returns (uint256);
// Selector: 2458d472
function getCurrentStage(uint256 sessionId) external view returns (uint256);
// Selector: ef9aab24
function getPathChoice(
uint256 sessionId,
uint256 tokenId,
uint256 stage
) external view returns (uint256);
// Selector: 98cf6f2f
function getPathReward(
uint256 sessionId,
uint256 stage,
uint256 path
) external view returns (Compound0 memory);
// Selector: 402ff0db
function getSession(
uint256 sessionId
) external view returns (Compound1 memory);
// Selector: 05917a03
function getSessionTokenStakeGuard(
uint256 sessionId,
uint256 tokenId
) external view returns (bool);
// Selector: b4fbb0f7
function getStageReward(
uint256 sessionId,
uint256 stage
) external view returns (Compound2 memory);
// Selector: 0bafef5f
function getStakedTokenInfo(
address nftAddress,
uint256 tokenId
) external view returns (uint256, address);
// Selector: 399ae724
function init(
address adminTerminusAddress,
uint256 adminTerminusPoolID
) external;
// Selector: 5ced609f
function numSessions() external view returns (uint256);
// Selector: 29399844
function numTokensStakedIntoSession(
uint256 sessionId,
address staker
) external view returns (uint256);
// 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: 150b7a02
function onERC721Received(
address,
address,
uint256,
bytes memory
) external returns (bytes4);
// Selector: 7828b1c5
function setCorrectPathForStage(
uint256 sessionId,
uint256 stage,
uint256 path,
bool setIsChoosingActive
) external;
// Selector: 31ac12a9
function setPathRewards(
uint256 sessionId,
uint256[] memory stages,
uint256[] memory paths,
address[] memory terminusAddresses,
uint256[] memory terminusPoolIds,
uint256[] memory rewardAmounts
) external;
// Selector: 649bec36
function setSessionActive(uint256 sessionId, bool isActive) external;
// Selector: f3ba70b9
function setSessionChoosingActive(
uint256 sessionId,
bool isChoosingActive
) external;
// Selector: b315c947
function setSessionUri(uint256 sessionId, string memory uri) external;
// Selector: dccd1370
function setStageRewards(
uint256 sessionId,
uint256[] memory stages,
address[] memory terminusAddresses,
uint256[] memory terminusPoolIds,
uint256[] memory rewardAmounts
) external;
// Selector: b075f42b
function stakeTokensIntoSession(
uint256 sessionId,
uint256[] memory tokenIds
) external;
// Selector: 01ffc9a7
function supportsInterface(bytes4 interfaceId) external view returns (bool);
// Selector: ebe5ecd4
function tokenOfStakerInSessionByIndex(
uint256 sessionId,
address staker,
uint256 index
) external view returns (uint256);
// Selector: eda42728
function unstakeTokensFromSession(
uint256 sessionId,
uint256[] memory tokenIds
) external;
// errors
}