@pendle/sdk-boros 0.2.14 → 0.2.16-distributor
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/contracts/distributorAbi.d.ts +268 -0
- package/dist/contracts/distributorAbi.js +356 -0
- package/dist/contracts/distributorAbi.js.map +1 -0
- package/dist/contracts/index.d.ts +1 -0
- package/dist/contracts/index.js +3 -1
- package/dist/contracts/index.js.map +1 -1
- package/dist/entities/Distributor/constants.d.ts +1 -0
- package/dist/entities/Distributor/constants.js +5 -0
- package/dist/entities/Distributor/constants.js.map +1 -0
- package/dist/entities/Distributor/distributor.d.ts +12 -0
- package/dist/entities/Distributor/distributor.js +40 -0
- package/dist/entities/Distributor/distributor.js.map +1 -0
- package/dist/entities/Distributor/index.d.ts +2 -0
- package/dist/entities/Distributor/index.js +19 -0
- package/dist/entities/Distributor/index.js.map +1 -0
- package/dist/entities/index.d.ts +1 -0
- package/dist/entities/index.js +1 -0
- package/dist/entities/index.js.map +1 -1
- package/dist/entities/market/market.js +1 -5
- package/dist/entities/market/market.js.map +1 -1
- package/dist/types/encoders.d.ts +4 -0
- package/dist/types/encoders.js +7 -0
- package/dist/types/encoders.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
export declare const naiveDistributorAbi: readonly [{
|
|
2
|
+
readonly inputs: readonly [{
|
|
3
|
+
readonly internalType: "address";
|
|
4
|
+
readonly name: "token_";
|
|
5
|
+
readonly type: "address";
|
|
6
|
+
}];
|
|
7
|
+
readonly stateMutability: "nonpayable";
|
|
8
|
+
readonly type: "constructor";
|
|
9
|
+
}, {
|
|
10
|
+
readonly inputs: readonly [{
|
|
11
|
+
readonly internalType: "address";
|
|
12
|
+
readonly name: "target";
|
|
13
|
+
readonly type: "address";
|
|
14
|
+
}];
|
|
15
|
+
readonly name: "AddressEmptyCode";
|
|
16
|
+
readonly type: "error";
|
|
17
|
+
}, {
|
|
18
|
+
readonly inputs: readonly [{
|
|
19
|
+
readonly internalType: "address";
|
|
20
|
+
readonly name: "implementation";
|
|
21
|
+
readonly type: "address";
|
|
22
|
+
}];
|
|
23
|
+
readonly name: "ERC1967InvalidImplementation";
|
|
24
|
+
readonly type: "error";
|
|
25
|
+
}, {
|
|
26
|
+
readonly inputs: readonly [];
|
|
27
|
+
readonly name: "ERC1967NonPayable";
|
|
28
|
+
readonly type: "error";
|
|
29
|
+
}, {
|
|
30
|
+
readonly inputs: readonly [];
|
|
31
|
+
readonly name: "FailedCall";
|
|
32
|
+
readonly type: "error";
|
|
33
|
+
}, {
|
|
34
|
+
readonly inputs: readonly [];
|
|
35
|
+
readonly name: "InvalidInitialization";
|
|
36
|
+
readonly type: "error";
|
|
37
|
+
}, {
|
|
38
|
+
readonly inputs: readonly [];
|
|
39
|
+
readonly name: "NotInitializing";
|
|
40
|
+
readonly type: "error";
|
|
41
|
+
}, {
|
|
42
|
+
readonly inputs: readonly [{
|
|
43
|
+
readonly internalType: "address";
|
|
44
|
+
readonly name: "owner";
|
|
45
|
+
readonly type: "address";
|
|
46
|
+
}];
|
|
47
|
+
readonly name: "OwnableInvalidOwner";
|
|
48
|
+
readonly type: "error";
|
|
49
|
+
}, {
|
|
50
|
+
readonly inputs: readonly [{
|
|
51
|
+
readonly internalType: "address";
|
|
52
|
+
readonly name: "account";
|
|
53
|
+
readonly type: "address";
|
|
54
|
+
}];
|
|
55
|
+
readonly name: "OwnableUnauthorizedAccount";
|
|
56
|
+
readonly type: "error";
|
|
57
|
+
}, {
|
|
58
|
+
readonly inputs: readonly [{
|
|
59
|
+
readonly internalType: "address";
|
|
60
|
+
readonly name: "token";
|
|
61
|
+
readonly type: "address";
|
|
62
|
+
}];
|
|
63
|
+
readonly name: "SafeERC20FailedOperation";
|
|
64
|
+
readonly type: "error";
|
|
65
|
+
}, {
|
|
66
|
+
readonly inputs: readonly [];
|
|
67
|
+
readonly name: "UUPSUnauthorizedCallContext";
|
|
68
|
+
readonly type: "error";
|
|
69
|
+
}, {
|
|
70
|
+
readonly inputs: readonly [{
|
|
71
|
+
readonly internalType: "bytes32";
|
|
72
|
+
readonly name: "slot";
|
|
73
|
+
readonly type: "bytes32";
|
|
74
|
+
}];
|
|
75
|
+
readonly name: "UUPSUnsupportedProxiableUUID";
|
|
76
|
+
readonly type: "error";
|
|
77
|
+
}, {
|
|
78
|
+
readonly anonymous: false;
|
|
79
|
+
readonly inputs: readonly [{
|
|
80
|
+
readonly indexed: true;
|
|
81
|
+
readonly internalType: "address";
|
|
82
|
+
readonly name: "user";
|
|
83
|
+
readonly type: "address";
|
|
84
|
+
}, {
|
|
85
|
+
readonly indexed: true;
|
|
86
|
+
readonly internalType: "address";
|
|
87
|
+
readonly name: "receiver";
|
|
88
|
+
readonly type: "address";
|
|
89
|
+
}, {
|
|
90
|
+
readonly indexed: false;
|
|
91
|
+
readonly internalType: "uint256";
|
|
92
|
+
readonly name: "amount";
|
|
93
|
+
readonly type: "uint256";
|
|
94
|
+
}];
|
|
95
|
+
readonly name: "Claimed";
|
|
96
|
+
readonly type: "event";
|
|
97
|
+
}, {
|
|
98
|
+
readonly anonymous: false;
|
|
99
|
+
readonly inputs: readonly [{
|
|
100
|
+
readonly indexed: false;
|
|
101
|
+
readonly internalType: "uint64";
|
|
102
|
+
readonly name: "version";
|
|
103
|
+
readonly type: "uint64";
|
|
104
|
+
}];
|
|
105
|
+
readonly name: "Initialized";
|
|
106
|
+
readonly type: "event";
|
|
107
|
+
}, {
|
|
108
|
+
readonly anonymous: false;
|
|
109
|
+
readonly inputs: readonly [{
|
|
110
|
+
readonly indexed: true;
|
|
111
|
+
readonly internalType: "address";
|
|
112
|
+
readonly name: "previousOwner";
|
|
113
|
+
readonly type: "address";
|
|
114
|
+
}, {
|
|
115
|
+
readonly indexed: true;
|
|
116
|
+
readonly internalType: "address";
|
|
117
|
+
readonly name: "newOwner";
|
|
118
|
+
readonly type: "address";
|
|
119
|
+
}];
|
|
120
|
+
readonly name: "OwnershipTransferred";
|
|
121
|
+
readonly type: "event";
|
|
122
|
+
}, {
|
|
123
|
+
readonly anonymous: false;
|
|
124
|
+
readonly inputs: readonly [{
|
|
125
|
+
readonly indexed: true;
|
|
126
|
+
readonly internalType: "address";
|
|
127
|
+
readonly name: "implementation";
|
|
128
|
+
readonly type: "address";
|
|
129
|
+
}];
|
|
130
|
+
readonly name: "Upgraded";
|
|
131
|
+
readonly type: "event";
|
|
132
|
+
}, {
|
|
133
|
+
readonly inputs: readonly [];
|
|
134
|
+
readonly name: "UPGRADE_INTERFACE_VERSION";
|
|
135
|
+
readonly outputs: readonly [{
|
|
136
|
+
readonly internalType: "string";
|
|
137
|
+
readonly name: "";
|
|
138
|
+
readonly type: "string";
|
|
139
|
+
}];
|
|
140
|
+
readonly stateMutability: "view";
|
|
141
|
+
readonly type: "function";
|
|
142
|
+
}, {
|
|
143
|
+
readonly inputs: readonly [{
|
|
144
|
+
readonly internalType: "address";
|
|
145
|
+
readonly name: "";
|
|
146
|
+
readonly type: "address";
|
|
147
|
+
}];
|
|
148
|
+
readonly name: "accrued";
|
|
149
|
+
readonly outputs: readonly [{
|
|
150
|
+
readonly internalType: "uint256";
|
|
151
|
+
readonly name: "";
|
|
152
|
+
readonly type: "uint256";
|
|
153
|
+
}];
|
|
154
|
+
readonly stateMutability: "view";
|
|
155
|
+
readonly type: "function";
|
|
156
|
+
}, {
|
|
157
|
+
readonly inputs: readonly [{
|
|
158
|
+
readonly internalType: "address";
|
|
159
|
+
readonly name: "receiver";
|
|
160
|
+
readonly type: "address";
|
|
161
|
+
}];
|
|
162
|
+
readonly name: "claim";
|
|
163
|
+
readonly outputs: readonly [{
|
|
164
|
+
readonly internalType: "uint256";
|
|
165
|
+
readonly name: "amountOut";
|
|
166
|
+
readonly type: "uint256";
|
|
167
|
+
}];
|
|
168
|
+
readonly stateMutability: "nonpayable";
|
|
169
|
+
readonly type: "function";
|
|
170
|
+
}, {
|
|
171
|
+
readonly inputs: readonly [{
|
|
172
|
+
readonly internalType: "address";
|
|
173
|
+
readonly name: "";
|
|
174
|
+
readonly type: "address";
|
|
175
|
+
}];
|
|
176
|
+
readonly name: "claimed";
|
|
177
|
+
readonly outputs: readonly [{
|
|
178
|
+
readonly internalType: "uint256";
|
|
179
|
+
readonly name: "";
|
|
180
|
+
readonly type: "uint256";
|
|
181
|
+
}];
|
|
182
|
+
readonly stateMutability: "view";
|
|
183
|
+
readonly type: "function";
|
|
184
|
+
}, {
|
|
185
|
+
readonly inputs: readonly [{
|
|
186
|
+
readonly internalType: "address";
|
|
187
|
+
readonly name: "initialOwner";
|
|
188
|
+
readonly type: "address";
|
|
189
|
+
}];
|
|
190
|
+
readonly name: "initialize";
|
|
191
|
+
readonly outputs: readonly [];
|
|
192
|
+
readonly stateMutability: "nonpayable";
|
|
193
|
+
readonly type: "function";
|
|
194
|
+
}, {
|
|
195
|
+
readonly inputs: readonly [];
|
|
196
|
+
readonly name: "owner";
|
|
197
|
+
readonly outputs: readonly [{
|
|
198
|
+
readonly internalType: "address";
|
|
199
|
+
readonly name: "";
|
|
200
|
+
readonly type: "address";
|
|
201
|
+
}];
|
|
202
|
+
readonly stateMutability: "view";
|
|
203
|
+
readonly type: "function";
|
|
204
|
+
}, {
|
|
205
|
+
readonly inputs: readonly [];
|
|
206
|
+
readonly name: "proxiableUUID";
|
|
207
|
+
readonly outputs: readonly [{
|
|
208
|
+
readonly internalType: "bytes32";
|
|
209
|
+
readonly name: "";
|
|
210
|
+
readonly type: "bytes32";
|
|
211
|
+
}];
|
|
212
|
+
readonly stateMutability: "view";
|
|
213
|
+
readonly type: "function";
|
|
214
|
+
}, {
|
|
215
|
+
readonly inputs: readonly [];
|
|
216
|
+
readonly name: "renounceOwnership";
|
|
217
|
+
readonly outputs: readonly [];
|
|
218
|
+
readonly stateMutability: "nonpayable";
|
|
219
|
+
readonly type: "function";
|
|
220
|
+
}, {
|
|
221
|
+
readonly inputs: readonly [{
|
|
222
|
+
readonly internalType: "address";
|
|
223
|
+
readonly name: "user";
|
|
224
|
+
readonly type: "address";
|
|
225
|
+
}, {
|
|
226
|
+
readonly internalType: "uint256";
|
|
227
|
+
readonly name: "amount";
|
|
228
|
+
readonly type: "uint256";
|
|
229
|
+
}];
|
|
230
|
+
readonly name: "setAccrued";
|
|
231
|
+
readonly outputs: readonly [];
|
|
232
|
+
readonly stateMutability: "nonpayable";
|
|
233
|
+
readonly type: "function";
|
|
234
|
+
}, {
|
|
235
|
+
readonly inputs: readonly [];
|
|
236
|
+
readonly name: "token";
|
|
237
|
+
readonly outputs: readonly [{
|
|
238
|
+
readonly internalType: "address";
|
|
239
|
+
readonly name: "";
|
|
240
|
+
readonly type: "address";
|
|
241
|
+
}];
|
|
242
|
+
readonly stateMutability: "view";
|
|
243
|
+
readonly type: "function";
|
|
244
|
+
}, {
|
|
245
|
+
readonly inputs: readonly [{
|
|
246
|
+
readonly internalType: "address";
|
|
247
|
+
readonly name: "newOwner";
|
|
248
|
+
readonly type: "address";
|
|
249
|
+
}];
|
|
250
|
+
readonly name: "transferOwnership";
|
|
251
|
+
readonly outputs: readonly [];
|
|
252
|
+
readonly stateMutability: "nonpayable";
|
|
253
|
+
readonly type: "function";
|
|
254
|
+
}, {
|
|
255
|
+
readonly inputs: readonly [{
|
|
256
|
+
readonly internalType: "address";
|
|
257
|
+
readonly name: "newImplementation";
|
|
258
|
+
readonly type: "address";
|
|
259
|
+
}, {
|
|
260
|
+
readonly internalType: "bytes";
|
|
261
|
+
readonly name: "data";
|
|
262
|
+
readonly type: "bytes";
|
|
263
|
+
}];
|
|
264
|
+
readonly name: "upgradeToAndCall";
|
|
265
|
+
readonly outputs: readonly [];
|
|
266
|
+
readonly stateMutability: "payable";
|
|
267
|
+
readonly type: "function";
|
|
268
|
+
}];
|
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.naiveDistributorAbi = void 0;
|
|
4
|
+
exports.naiveDistributorAbi = [
|
|
5
|
+
{
|
|
6
|
+
"inputs": [
|
|
7
|
+
{
|
|
8
|
+
"internalType": "address",
|
|
9
|
+
"name": "token_",
|
|
10
|
+
"type": "address"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"stateMutability": "nonpayable",
|
|
14
|
+
"type": "constructor"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"inputs": [
|
|
18
|
+
{
|
|
19
|
+
"internalType": "address",
|
|
20
|
+
"name": "target",
|
|
21
|
+
"type": "address"
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"name": "AddressEmptyCode",
|
|
25
|
+
"type": "error"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"inputs": [
|
|
29
|
+
{
|
|
30
|
+
"internalType": "address",
|
|
31
|
+
"name": "implementation",
|
|
32
|
+
"type": "address"
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"name": "ERC1967InvalidImplementation",
|
|
36
|
+
"type": "error"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"inputs": [],
|
|
40
|
+
"name": "ERC1967NonPayable",
|
|
41
|
+
"type": "error"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"inputs": [],
|
|
45
|
+
"name": "FailedCall",
|
|
46
|
+
"type": "error"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"inputs": [],
|
|
50
|
+
"name": "InvalidInitialization",
|
|
51
|
+
"type": "error"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"inputs": [],
|
|
55
|
+
"name": "NotInitializing",
|
|
56
|
+
"type": "error"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"inputs": [
|
|
60
|
+
{
|
|
61
|
+
"internalType": "address",
|
|
62
|
+
"name": "owner",
|
|
63
|
+
"type": "address"
|
|
64
|
+
}
|
|
65
|
+
],
|
|
66
|
+
"name": "OwnableInvalidOwner",
|
|
67
|
+
"type": "error"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"inputs": [
|
|
71
|
+
{
|
|
72
|
+
"internalType": "address",
|
|
73
|
+
"name": "account",
|
|
74
|
+
"type": "address"
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
"name": "OwnableUnauthorizedAccount",
|
|
78
|
+
"type": "error"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"inputs": [
|
|
82
|
+
{
|
|
83
|
+
"internalType": "address",
|
|
84
|
+
"name": "token",
|
|
85
|
+
"type": "address"
|
|
86
|
+
}
|
|
87
|
+
],
|
|
88
|
+
"name": "SafeERC20FailedOperation",
|
|
89
|
+
"type": "error"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"inputs": [],
|
|
93
|
+
"name": "UUPSUnauthorizedCallContext",
|
|
94
|
+
"type": "error"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"inputs": [
|
|
98
|
+
{
|
|
99
|
+
"internalType": "bytes32",
|
|
100
|
+
"name": "slot",
|
|
101
|
+
"type": "bytes32"
|
|
102
|
+
}
|
|
103
|
+
],
|
|
104
|
+
"name": "UUPSUnsupportedProxiableUUID",
|
|
105
|
+
"type": "error"
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"anonymous": false,
|
|
109
|
+
"inputs": [
|
|
110
|
+
{
|
|
111
|
+
"indexed": true,
|
|
112
|
+
"internalType": "address",
|
|
113
|
+
"name": "user",
|
|
114
|
+
"type": "address"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"indexed": true,
|
|
118
|
+
"internalType": "address",
|
|
119
|
+
"name": "receiver",
|
|
120
|
+
"type": "address"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"indexed": false,
|
|
124
|
+
"internalType": "uint256",
|
|
125
|
+
"name": "amount",
|
|
126
|
+
"type": "uint256"
|
|
127
|
+
}
|
|
128
|
+
],
|
|
129
|
+
"name": "Claimed",
|
|
130
|
+
"type": "event"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"anonymous": false,
|
|
134
|
+
"inputs": [
|
|
135
|
+
{
|
|
136
|
+
"indexed": false,
|
|
137
|
+
"internalType": "uint64",
|
|
138
|
+
"name": "version",
|
|
139
|
+
"type": "uint64"
|
|
140
|
+
}
|
|
141
|
+
],
|
|
142
|
+
"name": "Initialized",
|
|
143
|
+
"type": "event"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"anonymous": false,
|
|
147
|
+
"inputs": [
|
|
148
|
+
{
|
|
149
|
+
"indexed": true,
|
|
150
|
+
"internalType": "address",
|
|
151
|
+
"name": "previousOwner",
|
|
152
|
+
"type": "address"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"indexed": true,
|
|
156
|
+
"internalType": "address",
|
|
157
|
+
"name": "newOwner",
|
|
158
|
+
"type": "address"
|
|
159
|
+
}
|
|
160
|
+
],
|
|
161
|
+
"name": "OwnershipTransferred",
|
|
162
|
+
"type": "event"
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"anonymous": false,
|
|
166
|
+
"inputs": [
|
|
167
|
+
{
|
|
168
|
+
"indexed": true,
|
|
169
|
+
"internalType": "address",
|
|
170
|
+
"name": "implementation",
|
|
171
|
+
"type": "address"
|
|
172
|
+
}
|
|
173
|
+
],
|
|
174
|
+
"name": "Upgraded",
|
|
175
|
+
"type": "event"
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"inputs": [],
|
|
179
|
+
"name": "UPGRADE_INTERFACE_VERSION",
|
|
180
|
+
"outputs": [
|
|
181
|
+
{
|
|
182
|
+
"internalType": "string",
|
|
183
|
+
"name": "",
|
|
184
|
+
"type": "string"
|
|
185
|
+
}
|
|
186
|
+
],
|
|
187
|
+
"stateMutability": "view",
|
|
188
|
+
"type": "function"
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"inputs": [
|
|
192
|
+
{
|
|
193
|
+
"internalType": "address",
|
|
194
|
+
"name": "",
|
|
195
|
+
"type": "address"
|
|
196
|
+
}
|
|
197
|
+
],
|
|
198
|
+
"name": "accrued",
|
|
199
|
+
"outputs": [
|
|
200
|
+
{
|
|
201
|
+
"internalType": "uint256",
|
|
202
|
+
"name": "",
|
|
203
|
+
"type": "uint256"
|
|
204
|
+
}
|
|
205
|
+
],
|
|
206
|
+
"stateMutability": "view",
|
|
207
|
+
"type": "function"
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
"inputs": [
|
|
211
|
+
{
|
|
212
|
+
"internalType": "address",
|
|
213
|
+
"name": "receiver",
|
|
214
|
+
"type": "address"
|
|
215
|
+
}
|
|
216
|
+
],
|
|
217
|
+
"name": "claim",
|
|
218
|
+
"outputs": [
|
|
219
|
+
{
|
|
220
|
+
"internalType": "uint256",
|
|
221
|
+
"name": "amountOut",
|
|
222
|
+
"type": "uint256"
|
|
223
|
+
}
|
|
224
|
+
],
|
|
225
|
+
"stateMutability": "nonpayable",
|
|
226
|
+
"type": "function"
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
"inputs": [
|
|
230
|
+
{
|
|
231
|
+
"internalType": "address",
|
|
232
|
+
"name": "",
|
|
233
|
+
"type": "address"
|
|
234
|
+
}
|
|
235
|
+
],
|
|
236
|
+
"name": "claimed",
|
|
237
|
+
"outputs": [
|
|
238
|
+
{
|
|
239
|
+
"internalType": "uint256",
|
|
240
|
+
"name": "",
|
|
241
|
+
"type": "uint256"
|
|
242
|
+
}
|
|
243
|
+
],
|
|
244
|
+
"stateMutability": "view",
|
|
245
|
+
"type": "function"
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
"inputs": [
|
|
249
|
+
{
|
|
250
|
+
"internalType": "address",
|
|
251
|
+
"name": "initialOwner",
|
|
252
|
+
"type": "address"
|
|
253
|
+
}
|
|
254
|
+
],
|
|
255
|
+
"name": "initialize",
|
|
256
|
+
"outputs": [],
|
|
257
|
+
"stateMutability": "nonpayable",
|
|
258
|
+
"type": "function"
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
"inputs": [],
|
|
262
|
+
"name": "owner",
|
|
263
|
+
"outputs": [
|
|
264
|
+
{
|
|
265
|
+
"internalType": "address",
|
|
266
|
+
"name": "",
|
|
267
|
+
"type": "address"
|
|
268
|
+
}
|
|
269
|
+
],
|
|
270
|
+
"stateMutability": "view",
|
|
271
|
+
"type": "function"
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
"inputs": [],
|
|
275
|
+
"name": "proxiableUUID",
|
|
276
|
+
"outputs": [
|
|
277
|
+
{
|
|
278
|
+
"internalType": "bytes32",
|
|
279
|
+
"name": "",
|
|
280
|
+
"type": "bytes32"
|
|
281
|
+
}
|
|
282
|
+
],
|
|
283
|
+
"stateMutability": "view",
|
|
284
|
+
"type": "function"
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
"inputs": [],
|
|
288
|
+
"name": "renounceOwnership",
|
|
289
|
+
"outputs": [],
|
|
290
|
+
"stateMutability": "nonpayable",
|
|
291
|
+
"type": "function"
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
"inputs": [
|
|
295
|
+
{
|
|
296
|
+
"internalType": "address",
|
|
297
|
+
"name": "user",
|
|
298
|
+
"type": "address"
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
"internalType": "uint256",
|
|
302
|
+
"name": "amount",
|
|
303
|
+
"type": "uint256"
|
|
304
|
+
}
|
|
305
|
+
],
|
|
306
|
+
"name": "setAccrued",
|
|
307
|
+
"outputs": [],
|
|
308
|
+
"stateMutability": "nonpayable",
|
|
309
|
+
"type": "function"
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
"inputs": [],
|
|
313
|
+
"name": "token",
|
|
314
|
+
"outputs": [
|
|
315
|
+
{
|
|
316
|
+
"internalType": "address",
|
|
317
|
+
"name": "",
|
|
318
|
+
"type": "address"
|
|
319
|
+
}
|
|
320
|
+
],
|
|
321
|
+
"stateMutability": "view",
|
|
322
|
+
"type": "function"
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
"inputs": [
|
|
326
|
+
{
|
|
327
|
+
"internalType": "address",
|
|
328
|
+
"name": "newOwner",
|
|
329
|
+
"type": "address"
|
|
330
|
+
}
|
|
331
|
+
],
|
|
332
|
+
"name": "transferOwnership",
|
|
333
|
+
"outputs": [],
|
|
334
|
+
"stateMutability": "nonpayable",
|
|
335
|
+
"type": "function"
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
"inputs": [
|
|
339
|
+
{
|
|
340
|
+
"internalType": "address",
|
|
341
|
+
"name": "newImplementation",
|
|
342
|
+
"type": "address"
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
"internalType": "bytes",
|
|
346
|
+
"name": "data",
|
|
347
|
+
"type": "bytes"
|
|
348
|
+
}
|
|
349
|
+
],
|
|
350
|
+
"name": "upgradeToAndCall",
|
|
351
|
+
"outputs": [],
|
|
352
|
+
"stateMutability": "payable",
|
|
353
|
+
"type": "function"
|
|
354
|
+
}
|
|
355
|
+
];
|
|
356
|
+
//# sourceMappingURL=distributorAbi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"distributorAbi.js","sourceRoot":"","sources":["../../src/contracts/distributorAbi.ts"],"names":[],"mappings":";;;AACa,QAAA,mBAAmB,GAAG;IAC/B;QACI,QAAQ,EAAE;YACR;gBACE,cAAc,EAAE,SAAS;gBACzB,MAAM,EAAE,QAAQ;gBAChB,MAAM,EAAE,SAAS;aAClB;SACF;QACD,iBAAiB,EAAE,YAAY;QAC/B,MAAM,EAAE,aAAa;KACtB;IACD;QACE,QAAQ,EAAE;YACR;gBACE,cAAc,EAAE,SAAS;gBACzB,MAAM,EAAE,QAAQ;gBAChB,MAAM,EAAE,SAAS;aAClB;SACF;QACD,MAAM,EAAE,kBAAkB;QAC1B,MAAM,EAAE,OAAO;KAChB;IACD;QACE,QAAQ,EAAE;YACR;gBACE,cAAc,EAAE,SAAS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S;aAClB;SACF;QACD,MAAM,EAAE,mBAAmB;QAC3B,SAAS,EAAE,EAAE;QACb,iBAAiB,EAAE,YAAY;QAC/B,MAAM,EAAE,UAAU;KACnB;IACD;QACE,QAAQ,EAAE;YACR;gBACE,cAAc,EAAE,SAAS;gBACzB,MAAM,EAAE,mBAAmB;gBAC3B,MAAM,EAAE,SAAS;aAClB;YACD;gBACE,cAAc,EAAE,OAAO;gBACvB,MAAM,EAAE,MAAM;gBACd,MAAM,EAAE,OAAO;aAChB;SACF;QACD,MAAM,EAAE,kBAAkB;QAC1B,SAAS,EAAE,EAAE;QACb,iBAAiB,EAAE,SAAS;QAC5B,MAAM,EAAE,UAAU;KACnB;CAEG,CAAC"}
|
package/dist/contracts/index.js
CHANGED
|
@@ -14,8 +14,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.PendleContractErrorsAbi = void 0;
|
|
17
|
+
exports.naiveDistributorAbi = exports.PendleContractErrorsAbi = void 0;
|
|
18
18
|
var SDKErrorsDirectory_json_1 = require("@pendle/core-v3/artifacts/contracts/offchain-helpers/errors/SDKErrorsDirectory.sol/SDKErrorsDirectory.json");
|
|
19
19
|
Object.defineProperty(exports, "PendleContractErrorsAbi", { enumerable: true, get: function () { return SDKErrorsDirectory_json_1.abi; } });
|
|
20
|
+
var distributorAbi_1 = require("./distributorAbi");
|
|
21
|
+
Object.defineProperty(exports, "naiveDistributorAbi", { enumerable: true, get: function () { return distributorAbi_1.naiveDistributorAbi; } });
|
|
20
22
|
__exportStar(require("./viemAbis"), exports);
|
|
21
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/contracts/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,sJAA4J;AAAnJ,kIAAA,GAAG,OAA2B;AACvC,6CAA2B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/contracts/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,sJAA4J;AAAnJ,kIAAA,GAAG,OAA2B;AACvC,mDAAsD;AAA7C,qHAAA,mBAAmB,OAAA;AAC5B,6CAA2B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const DISTRIBUTOR_ADDRESS = "0x0156326dD67222F3D61a1C9E53c7Ebeb027ee822";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/entities/Distributor/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,mBAAmB,GAAG,4CAA4C,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Address } from 'viem';
|
|
2
|
+
export declare class Distributor {
|
|
3
|
+
private distributorContract;
|
|
4
|
+
constructor();
|
|
5
|
+
claim(userAddress: Address): Promise<{
|
|
6
|
+
from: `0x${string}`;
|
|
7
|
+
to: string;
|
|
8
|
+
data: `0x${string}`;
|
|
9
|
+
gas: bigint;
|
|
10
|
+
}>;
|
|
11
|
+
}
|
|
12
|
+
export default Distributor;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Distributor = void 0;
|
|
4
|
+
const viem_1 = require("viem");
|
|
5
|
+
const contracts_1 = require("../../contracts");
|
|
6
|
+
const constants_1 = require("./constants");
|
|
7
|
+
const chains_1 = require("viem/chains");
|
|
8
|
+
const common_1 = require("../../common");
|
|
9
|
+
class Distributor {
|
|
10
|
+
distributorContract;
|
|
11
|
+
constructor() {
|
|
12
|
+
this.distributorContract = (0, viem_1.getContract)({
|
|
13
|
+
address: constants_1.DISTRIBUTOR_ADDRESS,
|
|
14
|
+
abi: contracts_1.naiveDistributorAbi,
|
|
15
|
+
client: (0, viem_1.createPublicClient)({
|
|
16
|
+
chain: chains_1.arbitrum,
|
|
17
|
+
transport: (0, viem_1.http)(common_1.RPC_URL),
|
|
18
|
+
}),
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
async claim(userAddress) {
|
|
22
|
+
const data = (0, viem_1.encodeFunctionData)({
|
|
23
|
+
abi: contracts_1.naiveDistributorAbi,
|
|
24
|
+
functionName: 'claim',
|
|
25
|
+
args: [userAddress]
|
|
26
|
+
});
|
|
27
|
+
const gas = await this.distributorContract.estimateGas.claim([userAddress], {
|
|
28
|
+
account: userAddress,
|
|
29
|
+
});
|
|
30
|
+
return {
|
|
31
|
+
from: userAddress,
|
|
32
|
+
to: constants_1.DISTRIBUTOR_ADDRESS,
|
|
33
|
+
data,
|
|
34
|
+
gas,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.Distributor = Distributor;
|
|
39
|
+
exports.default = Distributor;
|
|
40
|
+
//# sourceMappingURL=distributor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"distributor.js","sourceRoot":"","sources":["../../../src/entities/Distributor/distributor.ts"],"names":[],"mappings":";;;AAAA,+BAAwG;AACxG,+CAAsD;AACtD,2CAAkD;AAClD,wCAAuC;AACvC,yCAAuC;AAEvC,MAAa,WAAW;IACZ,mBAAmB,CAAC;IAC5B;QACI,IAAI,CAAC,mBAAmB,GAAG,IAAA,kBAAW,EAAC;YACnC,OAAO,EAAE,+BAAmB;YAC5B,GAAG,EAAE,+BAAmB;YACxB,MAAM,EAAE,IAAA,yBAAkB,EAAC;gBACvB,KAAK,EAAE,iBAAQ;gBACf,SAAS,EAAE,IAAA,WAAI,EAAC,gBAAO,CAAC;aAC3B,CAAC;SACL,CAAC,CAAC;IACP,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,WAAoB;QAC5B,MAAM,IAAI,GAAG,IAAA,yBAAkB,EAAC;YAC5B,GAAG,EAAE,+BAAmB;YACxB,YAAY,EAAE,OAAO;YACrB,IAAI,EAAE,CAAC,WAAW,CAAC;SACtB,CAAC,CAAA;QACF,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,EAAE;YACxE,OAAO,EAAE,WAAW;SACvB,CAAC,CAAA;QACF,OAAO;YACH,IAAI,EAAE,WAAW;YACjB,EAAE,EAAE,+BAAmB;YACvB,IAAI;YACJ,GAAG;SACN,CAAC;IACN,CAAC;CACJ;AA7BD,kCA6BC;AAED,kBAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./distributor"), exports);
|
|
18
|
+
__exportStar(require("./constants"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/entities/Distributor/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,8CAA4B"}
|
package/dist/entities/index.d.ts
CHANGED
package/dist/entities/index.js
CHANGED
|
@@ -19,4 +19,5 @@ __exportStar(require("./market"), exports);
|
|
|
19
19
|
__exportStar(require("./exchange"), exports);
|
|
20
20
|
__exportStar(require("./amm"), exports);
|
|
21
21
|
__exportStar(require("./accManager"), exports);
|
|
22
|
+
__exportStar(require("./Distributor"), exports);
|
|
22
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,2CAAyB;AACzB,6CAA2B;AAC3B,wCAAsB;AACtB,+CAA6B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,2CAAyB;AACzB,6CAA2B;AAC3B,wCAAsB;AACtB,+CAA6B;AAC7B,gDAA8B"}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Market = void 0;
|
|
4
4
|
const boros_offchain_math_1 = require("@pendle/boros-offchain-math");
|
|
5
|
-
const BUFFERED_CONTRACT_INITIAL_MARGIN_RATE_RATIO = boros_offchain_math_1.FixedX18.fromNumber(0.05);
|
|
6
5
|
const BUFFERED_ORDER_SIZE_BY_EXACT_INITIAL_MARGIN_RATIO = boros_offchain_math_1.FixedX18.fromNumber(0.001);
|
|
7
6
|
const SECONDS_PER_YEARS = 3600 * 24 * 365;
|
|
8
7
|
class Market {
|
|
@@ -32,10 +31,7 @@ class Market {
|
|
|
32
31
|
? absMarkRate
|
|
33
32
|
: minMarginIndexRate
|
|
34
33
|
: offchainRate;
|
|
35
|
-
const contractSuf = contractRate
|
|
36
|
-
.mulDown(time)
|
|
37
|
-
.mulDown(marginFactor)
|
|
38
|
-
.mulDown(boros_offchain_math_1.FixedX18.ONE.add(BUFFERED_CONTRACT_INITIAL_MARGIN_RATE_RATIO));
|
|
34
|
+
const contractSuf = contractRate.mulDown(time).mulDown(marginFactor);
|
|
39
35
|
const offchainSuf = offchainRate.mulDown(time).divDown(boros_offchain_math_1.FixedX18.fromNumber(leverage));
|
|
40
36
|
return contractSuf.gt(offchainSuf) ? contractSuf : offchainSuf;
|
|
41
37
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"market.js","sourceRoot":"","sources":["../../../src/entities/market/market.ts"],"names":[],"mappings":";;;AAAA,qEAAuD;AAEvD,MAAM,
|
|
1
|
+
{"version":3,"file":"market.js","sourceRoot":"","sources":["../../../src/entities/market/market.ts"],"names":[],"mappings":";;;AAAA,qEAAuD;AAEvD,MAAM,iDAAiD,GAAG,8BAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;AACrF,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAAE,GAAG,GAAG,CAAC;AAsC1C,MAAa,MAAM;IACjB,MAAM,CAAC,gCAAgC,CACrC,MAA8C,EAC9C,YAAqB,KAAK;QAE1B,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QAGtC,MAAM,SAAS,GAAG,8BAAQ,CAAC,YAAY,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAE7E,IAAI,SAAS,EAAE,CAAC;YACd,OAAO,SAAS,CAAC,OAAO,CAAC,8BAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,iDAAiD,CAAC,CAAC,CAAC,KAAK,CAAC;QACtG,CAAC;QAED,OAAO,SAAS,CAAC,KAAK,CAAC;IACzB,CAAC;IAED,MAAM,CAAC,2BAA2B,CAAC,MAAyC,EAAE,YAAqB,IAAI;QACrG,MAAM,KAAK,GAAG,MAAM,CAAC,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OAAO,CAAC,8BAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC;QAEtF,OAAO,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC;IACjE,CAAC;IAED,MAAM,CAAC,aAAa,CAAC,MAA2B;QAC9C,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,cAAc,EAAE,GAAG,MAAM,CAAC;QAExD,MAAM,gBAAgB,GAAG,8BAAQ,CAAC,OAAO,CACvC,MAAM,CAAC,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,EACtD,MAAM,CAAC,iBAAiB,CAAC,CAC1B,CAAC;QAEF,MAAM,UAAU,GAAG,8BAAQ,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,KAAK,CAAC;QAEvG,OAAO,UAAU,CAAC;IACpB,CAAC;CACF;AApED,wBAoEC"}
|
package/dist/types/encoders.d.ts
CHANGED
|
@@ -3,6 +3,9 @@ import { MarketAcc, MarketId, OrderId, Side, TimeInForce, TokenId } from './comm
|
|
|
3
3
|
export interface GetUserInfoParams {
|
|
4
4
|
marketAcc: MarketAcc;
|
|
5
5
|
}
|
|
6
|
+
export interface AccCashParams {
|
|
7
|
+
marketAcc: MarketAcc;
|
|
8
|
+
}
|
|
6
9
|
interface VaultTransferParams {
|
|
7
10
|
tokenId: TokenId;
|
|
8
11
|
amount: bigint;
|
|
@@ -115,5 +118,6 @@ export declare const functionEncoder: {
|
|
|
115
118
|
removeLiquidityDualFromAmm(params: RemoveLiquidityDualFromAmmReq): `0x${string}`;
|
|
116
119
|
removeLiquiditySingleCashFromAmm(params: RemoveLiquiditySingleCashFromAmmReq): `0x${string}`;
|
|
117
120
|
getUserInfo(params: GetUserInfoParams): Hex;
|
|
121
|
+
accCash(params: AccCashParams): `0x${string}`;
|
|
118
122
|
};
|
|
119
123
|
export {};
|
package/dist/types/encoders.js
CHANGED
|
@@ -109,5 +109,12 @@ exports.functionEncoder = {
|
|
|
109
109
|
args: [params.marketAcc],
|
|
110
110
|
});
|
|
111
111
|
},
|
|
112
|
+
accCash(params) {
|
|
113
|
+
return (0, viem_1.encodeFunctionData)({
|
|
114
|
+
abi: viemAbis_1.iMarketHubAbi,
|
|
115
|
+
functionName: 'accCash',
|
|
116
|
+
args: [params.marketAcc],
|
|
117
|
+
});
|
|
118
|
+
},
|
|
112
119
|
};
|
|
113
120
|
//# sourceMappingURL=encoders.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"encoders.js","sourceRoot":"","sources":["../../src/types/encoders.ts"],"names":[],"mappings":";;;AAAA,+
|
|
1
|
+
{"version":3,"file":"encoders.js","sourceRoot":"","sources":["../../src/types/encoders.ts"],"names":[],"mappings":";;;AAAA,+BAA+C;AAC/C,oDAAgF;AA0HnE,QAAA,eAAe,GAAG;IAC7B,aAAa,CAAC,MAA2B;QACvC,OAAO,IAAA,yBAAkB,EAAC;YACxB,GAAG,EAAE,qBAAU;YACf,YAAY,EAAE,eAAe;YAC7B,IAAI,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,SAAS,CAAC;SACxD,CAAC,CAAC;IACL,CAAC;IAED,kBAAkB,CAAC,MAAgC;QACjD,OAAO,IAAA,yBAAkB,EAAC;YACxB,GAAG,EAAE,qBAAU;YACf,YAAY,EAAE,oBAAoB;YAClC,IAAI,EAAE,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,SAAS,CAAC;SAC1E,CAAC,CAAC;IACL,CAAC;IAED,YAAY,CAAC,GAAoB;QAC/B,OAAO,IAAA,yBAAkB,EAAC;YACxB,GAAG,EAAE,qBAAU;YACf,Y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