@gearbox-protocol/sdk 10.7.2 → 10.8.0
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/cjs/abi/AccountMigrator.js +325 -0
- package/dist/cjs/permissionless/bindings/bytecode-repository.js +11 -0
- package/dist/cjs/plugins/adapters/AdaptersPlugin.js +3 -0
- package/dist/cjs/plugins/adapters/abi/conctructorAbi.js +3 -0
- package/dist/cjs/plugins/adapters/contracts/AccountMigratorAdapterContract.js +35 -0
- package/dist/cjs/plugins/adapters/types.js +1 -0
- package/dist/esm/abi/AccountMigrator.js +301 -0
- package/dist/esm/permissionless/bindings/bytecode-repository.js +11 -0
- package/dist/esm/plugins/adapters/AdaptersPlugin.js +3 -0
- package/dist/esm/plugins/adapters/abi/conctructorAbi.js +3 -0
- package/dist/esm/plugins/adapters/contracts/AccountMigratorAdapterContract.js +11 -0
- package/dist/esm/plugins/adapters/types.js +1 -0
- package/dist/types/abi/AccountMigrator.d.ts +230 -0
- package/dist/types/permissionless/bindings/bytecode-repository.d.ts +2 -0
- package/dist/types/permissionless/core/bytecode.d.ts +0 -15
- package/dist/types/plugins/adapters/contracts/AccountMigratorAdapterContract.d.ts +238 -0
- package/dist/types/plugins/adapters/types.d.ts +2 -1
- package/package.json +1 -1
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var AccountMigrator_exports = {};
|
|
20
|
+
__export(AccountMigrator_exports, {
|
|
21
|
+
accountMigratorAbi: () => accountMigratorAbi
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(AccountMigrator_exports);
|
|
24
|
+
const accountMigratorAbi = [
|
|
25
|
+
{
|
|
26
|
+
type: "constructor",
|
|
27
|
+
inputs: [
|
|
28
|
+
{
|
|
29
|
+
name: "_creditManager",
|
|
30
|
+
type: "address",
|
|
31
|
+
internalType: "address"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: "_targetContract",
|
|
35
|
+
type: "address",
|
|
36
|
+
internalType: "address"
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
stateMutability: "nonpayable"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
type: "function",
|
|
43
|
+
name: "acl",
|
|
44
|
+
inputs: [],
|
|
45
|
+
outputs: [
|
|
46
|
+
{
|
|
47
|
+
name: "",
|
|
48
|
+
type: "address",
|
|
49
|
+
internalType: "address"
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
stateMutability: "view"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
type: "function",
|
|
56
|
+
name: "contractType",
|
|
57
|
+
inputs: [],
|
|
58
|
+
outputs: [
|
|
59
|
+
{
|
|
60
|
+
name: "",
|
|
61
|
+
type: "bytes32",
|
|
62
|
+
internalType: "bytes32"
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
stateMutability: "view"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
type: "function",
|
|
69
|
+
name: "creditManager",
|
|
70
|
+
inputs: [],
|
|
71
|
+
outputs: [
|
|
72
|
+
{
|
|
73
|
+
name: "",
|
|
74
|
+
type: "address",
|
|
75
|
+
internalType: "address"
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
stateMutability: "view"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
type: "function",
|
|
82
|
+
name: "lock",
|
|
83
|
+
inputs: [],
|
|
84
|
+
outputs: [],
|
|
85
|
+
stateMutability: "nonpayable"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
type: "function",
|
|
89
|
+
name: "locked",
|
|
90
|
+
inputs: [],
|
|
91
|
+
outputs: [
|
|
92
|
+
{
|
|
93
|
+
name: "",
|
|
94
|
+
type: "bool",
|
|
95
|
+
internalType: "bool"
|
|
96
|
+
}
|
|
97
|
+
],
|
|
98
|
+
stateMutability: "view"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
type: "function",
|
|
102
|
+
name: "migrate",
|
|
103
|
+
inputs: [
|
|
104
|
+
{
|
|
105
|
+
name: "params",
|
|
106
|
+
type: "tuple",
|
|
107
|
+
internalType: "struct MigrationParams",
|
|
108
|
+
components: [
|
|
109
|
+
{
|
|
110
|
+
name: "accountOwner",
|
|
111
|
+
type: "address",
|
|
112
|
+
internalType: "address"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
name: "sourceCreditAccount",
|
|
116
|
+
type: "address",
|
|
117
|
+
internalType: "address"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
name: "targetCreditManager",
|
|
121
|
+
type: "address",
|
|
122
|
+
internalType: "address"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
name: "migratedCollaterals",
|
|
126
|
+
type: "tuple[]",
|
|
127
|
+
internalType: "struct MigratedCollateral[]",
|
|
128
|
+
components: [
|
|
129
|
+
{
|
|
130
|
+
name: "collateral",
|
|
131
|
+
type: "address",
|
|
132
|
+
internalType: "address"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
name: "amount",
|
|
136
|
+
type: "uint256",
|
|
137
|
+
internalType: "uint256"
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
name: "targetQuotaIncrease",
|
|
141
|
+
type: "uint96",
|
|
142
|
+
internalType: "uint96"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
name: "underlyingInSource",
|
|
146
|
+
type: "bool",
|
|
147
|
+
internalType: "bool"
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
name: "underlyingInTarget",
|
|
151
|
+
type: "bool",
|
|
152
|
+
internalType: "bool"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
name: "phantomTokenParams",
|
|
156
|
+
type: "tuple",
|
|
157
|
+
internalType: "struct PhantomTokenParams",
|
|
158
|
+
components: [
|
|
159
|
+
{
|
|
160
|
+
name: "isPhantomToken",
|
|
161
|
+
type: "bool",
|
|
162
|
+
internalType: "bool"
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
name: "underlying",
|
|
166
|
+
type: "address",
|
|
167
|
+
internalType: "address"
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
name: "underlyingAmount",
|
|
171
|
+
type: "uint256",
|
|
172
|
+
internalType: "uint256"
|
|
173
|
+
}
|
|
174
|
+
]
|
|
175
|
+
}
|
|
176
|
+
]
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
name: "targetBorrowAmount",
|
|
180
|
+
type: "uint256",
|
|
181
|
+
internalType: "uint256"
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
name: "underlyingSwapCalls",
|
|
185
|
+
type: "tuple[]",
|
|
186
|
+
internalType: "struct MultiCall[]",
|
|
187
|
+
components: [
|
|
188
|
+
{
|
|
189
|
+
name: "target",
|
|
190
|
+
type: "address",
|
|
191
|
+
internalType: "address"
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
name: "callData",
|
|
195
|
+
type: "bytes",
|
|
196
|
+
internalType: "bytes"
|
|
197
|
+
}
|
|
198
|
+
]
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
name: "extraOpeningCalls",
|
|
202
|
+
type: "tuple[]",
|
|
203
|
+
internalType: "struct MultiCall[]",
|
|
204
|
+
components: [
|
|
205
|
+
{
|
|
206
|
+
name: "target",
|
|
207
|
+
type: "address",
|
|
208
|
+
internalType: "address"
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
name: "callData",
|
|
212
|
+
type: "bytes",
|
|
213
|
+
internalType: "bytes"
|
|
214
|
+
}
|
|
215
|
+
]
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
name: "uniqueTransferredTokens",
|
|
219
|
+
type: "address[]",
|
|
220
|
+
internalType: "address[]"
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
name: "numAddCollateralCalls",
|
|
224
|
+
type: "uint256",
|
|
225
|
+
internalType: "uint256"
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
name: "numRemoveQuotasCalls",
|
|
229
|
+
type: "uint256",
|
|
230
|
+
internalType: "uint256"
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
name: "numIncreaseQuotaCalls",
|
|
234
|
+
type: "uint256",
|
|
235
|
+
internalType: "uint256"
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
name: "numPhantomTokenCalls",
|
|
239
|
+
type: "uint256",
|
|
240
|
+
internalType: "uint256"
|
|
241
|
+
}
|
|
242
|
+
]
|
|
243
|
+
}
|
|
244
|
+
],
|
|
245
|
+
outputs: [
|
|
246
|
+
{
|
|
247
|
+
name: "",
|
|
248
|
+
type: "bool",
|
|
249
|
+
internalType: "bool"
|
|
250
|
+
}
|
|
251
|
+
],
|
|
252
|
+
stateMutability: "nonpayable"
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
type: "function",
|
|
256
|
+
name: "serialize",
|
|
257
|
+
inputs: [],
|
|
258
|
+
outputs: [
|
|
259
|
+
{
|
|
260
|
+
name: "serializedData",
|
|
261
|
+
type: "bytes",
|
|
262
|
+
internalType: "bytes"
|
|
263
|
+
}
|
|
264
|
+
],
|
|
265
|
+
stateMutability: "view"
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
type: "function",
|
|
269
|
+
name: "targetContract",
|
|
270
|
+
inputs: [],
|
|
271
|
+
outputs: [
|
|
272
|
+
{
|
|
273
|
+
name: "",
|
|
274
|
+
type: "address",
|
|
275
|
+
internalType: "address"
|
|
276
|
+
}
|
|
277
|
+
],
|
|
278
|
+
stateMutability: "view"
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
type: "function",
|
|
282
|
+
name: "unlock",
|
|
283
|
+
inputs: [],
|
|
284
|
+
outputs: [],
|
|
285
|
+
stateMutability: "nonpayable"
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
type: "function",
|
|
289
|
+
name: "version",
|
|
290
|
+
inputs: [],
|
|
291
|
+
outputs: [
|
|
292
|
+
{
|
|
293
|
+
name: "",
|
|
294
|
+
type: "uint256",
|
|
295
|
+
internalType: "uint256"
|
|
296
|
+
}
|
|
297
|
+
],
|
|
298
|
+
stateMutability: "view"
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
type: "error",
|
|
302
|
+
name: "AddressIsNotContractException",
|
|
303
|
+
inputs: [
|
|
304
|
+
{
|
|
305
|
+
name: "",
|
|
306
|
+
type: "address",
|
|
307
|
+
internalType: "address"
|
|
308
|
+
}
|
|
309
|
+
]
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
type: "error",
|
|
313
|
+
name: "CallerNotCreditFacadeException",
|
|
314
|
+
inputs: []
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
type: "error",
|
|
318
|
+
name: "ZeroAddressException",
|
|
319
|
+
inputs: []
|
|
320
|
+
}
|
|
321
|
+
];
|
|
322
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
323
|
+
0 && (module.exports = {
|
|
324
|
+
accountMigratorAbi
|
|
325
|
+
});
|
|
@@ -51,11 +51,22 @@ class BytecodeRepositoryContract extends import_base_contract.BaseContract {
|
|
|
51
51
|
(0, import_viem.stringToHex)(type_, { size: 32 })
|
|
52
52
|
]);
|
|
53
53
|
}
|
|
54
|
+
async getAllowedBytecodeHash(type_, version) {
|
|
55
|
+
return await this.contract.read.getAllowedBytecodeHash([
|
|
56
|
+
(0, import_viem.stringToHex)(type_, { size: 32 }),
|
|
57
|
+
BigInt(version)
|
|
58
|
+
]);
|
|
59
|
+
}
|
|
54
60
|
async isPublicDomain(domain) {
|
|
55
61
|
return await this.contract.read.isPublicDomain([
|
|
56
62
|
(0, import_viem.stringToHex)(domain, { size: 32 })
|
|
57
63
|
]);
|
|
58
64
|
}
|
|
65
|
+
async isSystemDomain(domain) {
|
|
66
|
+
return await this.contract.read.isSystemDomain([
|
|
67
|
+
(0, import_viem.stringToHex)(domain, { size: 32 })
|
|
68
|
+
]);
|
|
69
|
+
}
|
|
59
70
|
// // Write functions
|
|
60
71
|
// async uploadBytecode(bytecode: Bytecode) {
|
|
61
72
|
// return await this.contract.write.uploadBytecode([bytecode]);
|
|
@@ -22,6 +22,7 @@ __export(AdaptersPlugin_exports, {
|
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(AdaptersPlugin_exports);
|
|
24
24
|
var import_sdk = require("../../sdk/index.js");
|
|
25
|
+
var import_AccountMigratorAdapterContract = require("./contracts/AccountMigratorAdapterContract.js");
|
|
25
26
|
var import_contracts = require("./contracts/index.js");
|
|
26
27
|
class AdaptersPlugin extends import_sdk.BasePlugin {
|
|
27
28
|
name = "Adapters";
|
|
@@ -33,6 +34,8 @@ class AdaptersPlugin extends import_sdk.BasePlugin {
|
|
|
33
34
|
args.baseParams.contractType
|
|
34
35
|
);
|
|
35
36
|
switch (adapterType) {
|
|
37
|
+
case "ADAPTER::ACCOUNT_MIGRATOR":
|
|
38
|
+
return new import_AccountMigratorAdapterContract.AccountMigratorAdapterContract(this.sdk, args);
|
|
36
39
|
case "ADAPTER::BALANCER_V3_ROUTER":
|
|
37
40
|
return new import_contracts.BalancerV3RouterAdapterContract(this.sdk, args);
|
|
38
41
|
case "ADAPTER::BALANCER_V3_WRAPPER":
|
|
@@ -25,6 +25,9 @@ var import_types = require("../types.js");
|
|
|
25
25
|
var import_conctructorAbiPatterns = require("./conctructorAbiPatterns.js");
|
|
26
26
|
const adapterConstructorAbi = {
|
|
27
27
|
// DEX and protocol adapters - basic pattern [creditManager, target]
|
|
28
|
+
[import_types.AdapterType.ACCOUNT_MIGRATOR]: {
|
|
29
|
+
310: import_conctructorAbiPatterns.BASIC_ADAPTER_ABI
|
|
30
|
+
},
|
|
28
31
|
[import_types.AdapterType.BALANCER_VAULT]: {
|
|
29
32
|
310: import_conctructorAbiPatterns.BASIC_ADAPTER_ABI
|
|
30
33
|
},
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var AccountMigratorAdapterContract_exports = {};
|
|
20
|
+
__export(AccountMigratorAdapterContract_exports, {
|
|
21
|
+
AccountMigratorAdapterContract: () => AccountMigratorAdapterContract
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(AccountMigratorAdapterContract_exports);
|
|
24
|
+
var import_AccountMigrator = require("../../../abi/AccountMigrator.js");
|
|
25
|
+
var import_AbstractAdapter = require("./AbstractAdapter.js");
|
|
26
|
+
const abi = import_AccountMigrator.accountMigratorAbi;
|
|
27
|
+
class AccountMigratorAdapterContract extends import_AbstractAdapter.AbstractAdapterContract {
|
|
28
|
+
constructor(sdk, args) {
|
|
29
|
+
super(sdk, { ...args, abi });
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
33
|
+
0 && (module.exports = {
|
|
34
|
+
AccountMigratorAdapterContract
|
|
35
|
+
});
|
|
@@ -22,6 +22,7 @@ __export(types_exports, {
|
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(types_exports);
|
|
24
24
|
var AdapterType = /* @__PURE__ */ ((AdapterType2) => {
|
|
25
|
+
AdapterType2["ACCOUNT_MIGRATOR"] = "ACCOUNT_MIGRATOR";
|
|
25
26
|
AdapterType2["BALANCER_V3_ROUTER"] = "BALANCER_V3_ROUTER";
|
|
26
27
|
AdapterType2["BALANCER_V3_WRAPPER"] = "BALANCER_V3_WRAPPER";
|
|
27
28
|
AdapterType2["BALANCER_VAULT"] = "BALANCER_VAULT";
|
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
const accountMigratorAbi = [
|
|
2
|
+
{
|
|
3
|
+
type: "constructor",
|
|
4
|
+
inputs: [
|
|
5
|
+
{
|
|
6
|
+
name: "_creditManager",
|
|
7
|
+
type: "address",
|
|
8
|
+
internalType: "address"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
name: "_targetContract",
|
|
12
|
+
type: "address",
|
|
13
|
+
internalType: "address"
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
stateMutability: "nonpayable"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
type: "function",
|
|
20
|
+
name: "acl",
|
|
21
|
+
inputs: [],
|
|
22
|
+
outputs: [
|
|
23
|
+
{
|
|
24
|
+
name: "",
|
|
25
|
+
type: "address",
|
|
26
|
+
internalType: "address"
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
stateMutability: "view"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
type: "function",
|
|
33
|
+
name: "contractType",
|
|
34
|
+
inputs: [],
|
|
35
|
+
outputs: [
|
|
36
|
+
{
|
|
37
|
+
name: "",
|
|
38
|
+
type: "bytes32",
|
|
39
|
+
internalType: "bytes32"
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
stateMutability: "view"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
type: "function",
|
|
46
|
+
name: "creditManager",
|
|
47
|
+
inputs: [],
|
|
48
|
+
outputs: [
|
|
49
|
+
{
|
|
50
|
+
name: "",
|
|
51
|
+
type: "address",
|
|
52
|
+
internalType: "address"
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
stateMutability: "view"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
type: "function",
|
|
59
|
+
name: "lock",
|
|
60
|
+
inputs: [],
|
|
61
|
+
outputs: [],
|
|
62
|
+
stateMutability: "nonpayable"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
type: "function",
|
|
66
|
+
name: "locked",
|
|
67
|
+
inputs: [],
|
|
68
|
+
outputs: [
|
|
69
|
+
{
|
|
70
|
+
name: "",
|
|
71
|
+
type: "bool",
|
|
72
|
+
internalType: "bool"
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
stateMutability: "view"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
type: "function",
|
|
79
|
+
name: "migrate",
|
|
80
|
+
inputs: [
|
|
81
|
+
{
|
|
82
|
+
name: "params",
|
|
83
|
+
type: "tuple",
|
|
84
|
+
internalType: "struct MigrationParams",
|
|
85
|
+
components: [
|
|
86
|
+
{
|
|
87
|
+
name: "accountOwner",
|
|
88
|
+
type: "address",
|
|
89
|
+
internalType: "address"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
name: "sourceCreditAccount",
|
|
93
|
+
type: "address",
|
|
94
|
+
internalType: "address"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
name: "targetCreditManager",
|
|
98
|
+
type: "address",
|
|
99
|
+
internalType: "address"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
name: "migratedCollaterals",
|
|
103
|
+
type: "tuple[]",
|
|
104
|
+
internalType: "struct MigratedCollateral[]",
|
|
105
|
+
components: [
|
|
106
|
+
{
|
|
107
|
+
name: "collateral",
|
|
108
|
+
type: "address",
|
|
109
|
+
internalType: "address"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
name: "amount",
|
|
113
|
+
type: "uint256",
|
|
114
|
+
internalType: "uint256"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
name: "targetQuotaIncrease",
|
|
118
|
+
type: "uint96",
|
|
119
|
+
internalType: "uint96"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
name: "underlyingInSource",
|
|
123
|
+
type: "bool",
|
|
124
|
+
internalType: "bool"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
name: "underlyingInTarget",
|
|
128
|
+
type: "bool",
|
|
129
|
+
internalType: "bool"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
name: "phantomTokenParams",
|
|
133
|
+
type: "tuple",
|
|
134
|
+
internalType: "struct PhantomTokenParams",
|
|
135
|
+
components: [
|
|
136
|
+
{
|
|
137
|
+
name: "isPhantomToken",
|
|
138
|
+
type: "bool",
|
|
139
|
+
internalType: "bool"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
name: "underlying",
|
|
143
|
+
type: "address",
|
|
144
|
+
internalType: "address"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
name: "underlyingAmount",
|
|
148
|
+
type: "uint256",
|
|
149
|
+
internalType: "uint256"
|
|
150
|
+
}
|
|
151
|
+
]
|
|
152
|
+
}
|
|
153
|
+
]
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
name: "targetBorrowAmount",
|
|
157
|
+
type: "uint256",
|
|
158
|
+
internalType: "uint256"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
name: "underlyingSwapCalls",
|
|
162
|
+
type: "tuple[]",
|
|
163
|
+
internalType: "struct MultiCall[]",
|
|
164
|
+
components: [
|
|
165
|
+
{
|
|
166
|
+
name: "target",
|
|
167
|
+
type: "address",
|
|
168
|
+
internalType: "address"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
name: "callData",
|
|
172
|
+
type: "bytes",
|
|
173
|
+
internalType: "bytes"
|
|
174
|
+
}
|
|
175
|
+
]
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
name: "extraOpeningCalls",
|
|
179
|
+
type: "tuple[]",
|
|
180
|
+
internalType: "struct MultiCall[]",
|
|
181
|
+
components: [
|
|
182
|
+
{
|
|
183
|
+
name: "target",
|
|
184
|
+
type: "address",
|
|
185
|
+
internalType: "address"
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
name: "callData",
|
|
189
|
+
type: "bytes",
|
|
190
|
+
internalType: "bytes"
|
|
191
|
+
}
|
|
192
|
+
]
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
name: "uniqueTransferredTokens",
|
|
196
|
+
type: "address[]",
|
|
197
|
+
internalType: "address[]"
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
name: "numAddCollateralCalls",
|
|
201
|
+
type: "uint256",
|
|
202
|
+
internalType: "uint256"
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
name: "numRemoveQuotasCalls",
|
|
206
|
+
type: "uint256",
|
|
207
|
+
internalType: "uint256"
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
name: "numIncreaseQuotaCalls",
|
|
211
|
+
type: "uint256",
|
|
212
|
+
internalType: "uint256"
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
name: "numPhantomTokenCalls",
|
|
216
|
+
type: "uint256",
|
|
217
|
+
internalType: "uint256"
|
|
218
|
+
}
|
|
219
|
+
]
|
|
220
|
+
}
|
|
221
|
+
],
|
|
222
|
+
outputs: [
|
|
223
|
+
{
|
|
224
|
+
name: "",
|
|
225
|
+
type: "bool",
|
|
226
|
+
internalType: "bool"
|
|
227
|
+
}
|
|
228
|
+
],
|
|
229
|
+
stateMutability: "nonpayable"
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
type: "function",
|
|
233
|
+
name: "serialize",
|
|
234
|
+
inputs: [],
|
|
235
|
+
outputs: [
|
|
236
|
+
{
|
|
237
|
+
name: "serializedData",
|
|
238
|
+
type: "bytes",
|
|
239
|
+
internalType: "bytes"
|
|
240
|
+
}
|
|
241
|
+
],
|
|
242
|
+
stateMutability: "view"
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
type: "function",
|
|
246
|
+
name: "targetContract",
|
|
247
|
+
inputs: [],
|
|
248
|
+
outputs: [
|
|
249
|
+
{
|
|
250
|
+
name: "",
|
|
251
|
+
type: "address",
|
|
252
|
+
internalType: "address"
|
|
253
|
+
}
|
|
254
|
+
],
|
|
255
|
+
stateMutability: "view"
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
type: "function",
|
|
259
|
+
name: "unlock",
|
|
260
|
+
inputs: [],
|
|
261
|
+
outputs: [],
|
|
262
|
+
stateMutability: "nonpayable"
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
type: "function",
|
|
266
|
+
name: "version",
|
|
267
|
+
inputs: [],
|
|
268
|
+
outputs: [
|
|
269
|
+
{
|
|
270
|
+
name: "",
|
|
271
|
+
type: "uint256",
|
|
272
|
+
internalType: "uint256"
|
|
273
|
+
}
|
|
274
|
+
],
|
|
275
|
+
stateMutability: "view"
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
type: "error",
|
|
279
|
+
name: "AddressIsNotContractException",
|
|
280
|
+
inputs: [
|
|
281
|
+
{
|
|
282
|
+
name: "",
|
|
283
|
+
type: "address",
|
|
284
|
+
internalType: "address"
|
|
285
|
+
}
|
|
286
|
+
]
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
type: "error",
|
|
290
|
+
name: "CallerNotCreditFacadeException",
|
|
291
|
+
inputs: []
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
type: "error",
|
|
295
|
+
name: "ZeroAddressException",
|
|
296
|
+
inputs: []
|
|
297
|
+
}
|
|
298
|
+
];
|
|
299
|
+
export {
|
|
300
|
+
accountMigratorAbi
|
|
301
|
+
};
|
|
@@ -34,11 +34,22 @@ class BytecodeRepositoryContract extends BaseContract {
|
|
|
34
34
|
stringToHex(type_, { size: 32 })
|
|
35
35
|
]);
|
|
36
36
|
}
|
|
37
|
+
async getAllowedBytecodeHash(type_, version) {
|
|
38
|
+
return await this.contract.read.getAllowedBytecodeHash([
|
|
39
|
+
stringToHex(type_, { size: 32 }),
|
|
40
|
+
BigInt(version)
|
|
41
|
+
]);
|
|
42
|
+
}
|
|
37
43
|
async isPublicDomain(domain) {
|
|
38
44
|
return await this.contract.read.isPublicDomain([
|
|
39
45
|
stringToHex(domain, { size: 32 })
|
|
40
46
|
]);
|
|
41
47
|
}
|
|
48
|
+
async isSystemDomain(domain) {
|
|
49
|
+
return await this.contract.read.isSystemDomain([
|
|
50
|
+
stringToHex(domain, { size: 32 })
|
|
51
|
+
]);
|
|
52
|
+
}
|
|
42
53
|
// // Write functions
|
|
43
54
|
// async uploadBytecode(bytecode: Bytecode) {
|
|
44
55
|
// return await this.contract.write.uploadBytecode([bytecode]);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BasePlugin, bytes32ToString } from "../../sdk/index.js";
|
|
2
|
+
import { AccountMigratorAdapterContract } from "./contracts/AccountMigratorAdapterContract.js";
|
|
2
3
|
import {
|
|
3
4
|
BalancerV2VaultAdapterContract,
|
|
4
5
|
BalancerV3RouterAdapterContract,
|
|
@@ -47,6 +48,8 @@ class AdaptersPlugin extends BasePlugin {
|
|
|
47
48
|
args.baseParams.contractType
|
|
48
49
|
);
|
|
49
50
|
switch (adapterType) {
|
|
51
|
+
case "ADAPTER::ACCOUNT_MIGRATOR":
|
|
52
|
+
return new AccountMigratorAdapterContract(this.sdk, args);
|
|
50
53
|
case "ADAPTER::BALANCER_V3_ROUTER":
|
|
51
54
|
return new BalancerV3RouterAdapterContract(this.sdk, args);
|
|
52
55
|
case "ADAPTER::BALANCER_V3_WRAPPER":
|
|
@@ -14,6 +14,9 @@ import {
|
|
|
14
14
|
} from "./conctructorAbiPatterns.js";
|
|
15
15
|
const adapterConstructorAbi = {
|
|
16
16
|
// DEX and protocol adapters - basic pattern [creditManager, target]
|
|
17
|
+
[AdapterType.ACCOUNT_MIGRATOR]: {
|
|
18
|
+
310: BASIC_ADAPTER_ABI
|
|
19
|
+
},
|
|
17
20
|
[AdapterType.BALANCER_VAULT]: {
|
|
18
21
|
310: BASIC_ADAPTER_ABI
|
|
19
22
|
},
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { accountMigratorAbi } from "../../../abi/AccountMigrator.js";
|
|
2
|
+
import { AbstractAdapterContract } from "./AbstractAdapter.js";
|
|
3
|
+
const abi = accountMigratorAbi;
|
|
4
|
+
class AccountMigratorAdapterContract extends AbstractAdapterContract {
|
|
5
|
+
constructor(sdk, args) {
|
|
6
|
+
super(sdk, { ...args, abi });
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
AccountMigratorAdapterContract
|
|
11
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
var AdapterType = /* @__PURE__ */ ((AdapterType2) => {
|
|
2
|
+
AdapterType2["ACCOUNT_MIGRATOR"] = "ACCOUNT_MIGRATOR";
|
|
2
3
|
AdapterType2["BALANCER_V3_ROUTER"] = "BALANCER_V3_ROUTER";
|
|
3
4
|
AdapterType2["BALANCER_V3_WRAPPER"] = "BALANCER_V3_WRAPPER";
|
|
4
5
|
AdapterType2["BALANCER_VAULT"] = "BALANCER_VAULT";
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
export declare const accountMigratorAbi: readonly [{
|
|
2
|
+
readonly type: "constructor";
|
|
3
|
+
readonly inputs: readonly [{
|
|
4
|
+
readonly name: "_creditManager";
|
|
5
|
+
readonly type: "address";
|
|
6
|
+
readonly internalType: "address";
|
|
7
|
+
}, {
|
|
8
|
+
readonly name: "_targetContract";
|
|
9
|
+
readonly type: "address";
|
|
10
|
+
readonly internalType: "address";
|
|
11
|
+
}];
|
|
12
|
+
readonly stateMutability: "nonpayable";
|
|
13
|
+
}, {
|
|
14
|
+
readonly type: "function";
|
|
15
|
+
readonly name: "acl";
|
|
16
|
+
readonly inputs: readonly [];
|
|
17
|
+
readonly outputs: readonly [{
|
|
18
|
+
readonly name: "";
|
|
19
|
+
readonly type: "address";
|
|
20
|
+
readonly internalType: "address";
|
|
21
|
+
}];
|
|
22
|
+
readonly stateMutability: "view";
|
|
23
|
+
}, {
|
|
24
|
+
readonly type: "function";
|
|
25
|
+
readonly name: "contractType";
|
|
26
|
+
readonly inputs: readonly [];
|
|
27
|
+
readonly outputs: readonly [{
|
|
28
|
+
readonly name: "";
|
|
29
|
+
readonly type: "bytes32";
|
|
30
|
+
readonly internalType: "bytes32";
|
|
31
|
+
}];
|
|
32
|
+
readonly stateMutability: "view";
|
|
33
|
+
}, {
|
|
34
|
+
readonly type: "function";
|
|
35
|
+
readonly name: "creditManager";
|
|
36
|
+
readonly inputs: readonly [];
|
|
37
|
+
readonly outputs: readonly [{
|
|
38
|
+
readonly name: "";
|
|
39
|
+
readonly type: "address";
|
|
40
|
+
readonly internalType: "address";
|
|
41
|
+
}];
|
|
42
|
+
readonly stateMutability: "view";
|
|
43
|
+
}, {
|
|
44
|
+
readonly type: "function";
|
|
45
|
+
readonly name: "lock";
|
|
46
|
+
readonly inputs: readonly [];
|
|
47
|
+
readonly outputs: readonly [];
|
|
48
|
+
readonly stateMutability: "nonpayable";
|
|
49
|
+
}, {
|
|
50
|
+
readonly type: "function";
|
|
51
|
+
readonly name: "locked";
|
|
52
|
+
readonly inputs: readonly [];
|
|
53
|
+
readonly outputs: readonly [{
|
|
54
|
+
readonly name: "";
|
|
55
|
+
readonly type: "bool";
|
|
56
|
+
readonly internalType: "bool";
|
|
57
|
+
}];
|
|
58
|
+
readonly stateMutability: "view";
|
|
59
|
+
}, {
|
|
60
|
+
readonly type: "function";
|
|
61
|
+
readonly name: "migrate";
|
|
62
|
+
readonly inputs: readonly [{
|
|
63
|
+
readonly name: "params";
|
|
64
|
+
readonly type: "tuple";
|
|
65
|
+
readonly internalType: "struct MigrationParams";
|
|
66
|
+
readonly components: readonly [{
|
|
67
|
+
readonly name: "accountOwner";
|
|
68
|
+
readonly type: "address";
|
|
69
|
+
readonly internalType: "address";
|
|
70
|
+
}, {
|
|
71
|
+
readonly name: "sourceCreditAccount";
|
|
72
|
+
readonly type: "address";
|
|
73
|
+
readonly internalType: "address";
|
|
74
|
+
}, {
|
|
75
|
+
readonly name: "targetCreditManager";
|
|
76
|
+
readonly type: "address";
|
|
77
|
+
readonly internalType: "address";
|
|
78
|
+
}, {
|
|
79
|
+
readonly name: "migratedCollaterals";
|
|
80
|
+
readonly type: "tuple[]";
|
|
81
|
+
readonly internalType: "struct MigratedCollateral[]";
|
|
82
|
+
readonly components: readonly [{
|
|
83
|
+
readonly name: "collateral";
|
|
84
|
+
readonly type: "address";
|
|
85
|
+
readonly internalType: "address";
|
|
86
|
+
}, {
|
|
87
|
+
readonly name: "amount";
|
|
88
|
+
readonly type: "uint256";
|
|
89
|
+
readonly internalType: "uint256";
|
|
90
|
+
}, {
|
|
91
|
+
readonly name: "targetQuotaIncrease";
|
|
92
|
+
readonly type: "uint96";
|
|
93
|
+
readonly internalType: "uint96";
|
|
94
|
+
}, {
|
|
95
|
+
readonly name: "underlyingInSource";
|
|
96
|
+
readonly type: "bool";
|
|
97
|
+
readonly internalType: "bool";
|
|
98
|
+
}, {
|
|
99
|
+
readonly name: "underlyingInTarget";
|
|
100
|
+
readonly type: "bool";
|
|
101
|
+
readonly internalType: "bool";
|
|
102
|
+
}, {
|
|
103
|
+
readonly name: "phantomTokenParams";
|
|
104
|
+
readonly type: "tuple";
|
|
105
|
+
readonly internalType: "struct PhantomTokenParams";
|
|
106
|
+
readonly components: readonly [{
|
|
107
|
+
readonly name: "isPhantomToken";
|
|
108
|
+
readonly type: "bool";
|
|
109
|
+
readonly internalType: "bool";
|
|
110
|
+
}, {
|
|
111
|
+
readonly name: "underlying";
|
|
112
|
+
readonly type: "address";
|
|
113
|
+
readonly internalType: "address";
|
|
114
|
+
}, {
|
|
115
|
+
readonly name: "underlyingAmount";
|
|
116
|
+
readonly type: "uint256";
|
|
117
|
+
readonly internalType: "uint256";
|
|
118
|
+
}];
|
|
119
|
+
}];
|
|
120
|
+
}, {
|
|
121
|
+
readonly name: "targetBorrowAmount";
|
|
122
|
+
readonly type: "uint256";
|
|
123
|
+
readonly internalType: "uint256";
|
|
124
|
+
}, {
|
|
125
|
+
readonly name: "underlyingSwapCalls";
|
|
126
|
+
readonly type: "tuple[]";
|
|
127
|
+
readonly internalType: "struct MultiCall[]";
|
|
128
|
+
readonly components: readonly [{
|
|
129
|
+
readonly name: "target";
|
|
130
|
+
readonly type: "address";
|
|
131
|
+
readonly internalType: "address";
|
|
132
|
+
}, {
|
|
133
|
+
readonly name: "callData";
|
|
134
|
+
readonly type: "bytes";
|
|
135
|
+
readonly internalType: "bytes";
|
|
136
|
+
}];
|
|
137
|
+
}, {
|
|
138
|
+
readonly name: "extraOpeningCalls";
|
|
139
|
+
readonly type: "tuple[]";
|
|
140
|
+
readonly internalType: "struct MultiCall[]";
|
|
141
|
+
readonly components: readonly [{
|
|
142
|
+
readonly name: "target";
|
|
143
|
+
readonly type: "address";
|
|
144
|
+
readonly internalType: "address";
|
|
145
|
+
}, {
|
|
146
|
+
readonly name: "callData";
|
|
147
|
+
readonly type: "bytes";
|
|
148
|
+
readonly internalType: "bytes";
|
|
149
|
+
}];
|
|
150
|
+
}, {
|
|
151
|
+
readonly name: "uniqueTransferredTokens";
|
|
152
|
+
readonly type: "address[]";
|
|
153
|
+
readonly internalType: "address[]";
|
|
154
|
+
}, {
|
|
155
|
+
readonly name: "numAddCollateralCalls";
|
|
156
|
+
readonly type: "uint256";
|
|
157
|
+
readonly internalType: "uint256";
|
|
158
|
+
}, {
|
|
159
|
+
readonly name: "numRemoveQuotasCalls";
|
|
160
|
+
readonly type: "uint256";
|
|
161
|
+
readonly internalType: "uint256";
|
|
162
|
+
}, {
|
|
163
|
+
readonly name: "numIncreaseQuotaCalls";
|
|
164
|
+
readonly type: "uint256";
|
|
165
|
+
readonly internalType: "uint256";
|
|
166
|
+
}, {
|
|
167
|
+
readonly name: "numPhantomTokenCalls";
|
|
168
|
+
readonly type: "uint256";
|
|
169
|
+
readonly internalType: "uint256";
|
|
170
|
+
}];
|
|
171
|
+
}];
|
|
172
|
+
readonly outputs: readonly [{
|
|
173
|
+
readonly name: "";
|
|
174
|
+
readonly type: "bool";
|
|
175
|
+
readonly internalType: "bool";
|
|
176
|
+
}];
|
|
177
|
+
readonly stateMutability: "nonpayable";
|
|
178
|
+
}, {
|
|
179
|
+
readonly type: "function";
|
|
180
|
+
readonly name: "serialize";
|
|
181
|
+
readonly inputs: readonly [];
|
|
182
|
+
readonly outputs: readonly [{
|
|
183
|
+
readonly name: "serializedData";
|
|
184
|
+
readonly type: "bytes";
|
|
185
|
+
readonly internalType: "bytes";
|
|
186
|
+
}];
|
|
187
|
+
readonly stateMutability: "view";
|
|
188
|
+
}, {
|
|
189
|
+
readonly type: "function";
|
|
190
|
+
readonly name: "targetContract";
|
|
191
|
+
readonly inputs: readonly [];
|
|
192
|
+
readonly outputs: readonly [{
|
|
193
|
+
readonly name: "";
|
|
194
|
+
readonly type: "address";
|
|
195
|
+
readonly internalType: "address";
|
|
196
|
+
}];
|
|
197
|
+
readonly stateMutability: "view";
|
|
198
|
+
}, {
|
|
199
|
+
readonly type: "function";
|
|
200
|
+
readonly name: "unlock";
|
|
201
|
+
readonly inputs: readonly [];
|
|
202
|
+
readonly outputs: readonly [];
|
|
203
|
+
readonly stateMutability: "nonpayable";
|
|
204
|
+
}, {
|
|
205
|
+
readonly type: "function";
|
|
206
|
+
readonly name: "version";
|
|
207
|
+
readonly inputs: readonly [];
|
|
208
|
+
readonly outputs: readonly [{
|
|
209
|
+
readonly name: "";
|
|
210
|
+
readonly type: "uint256";
|
|
211
|
+
readonly internalType: "uint256";
|
|
212
|
+
}];
|
|
213
|
+
readonly stateMutability: "view";
|
|
214
|
+
}, {
|
|
215
|
+
readonly type: "error";
|
|
216
|
+
readonly name: "AddressIsNotContractException";
|
|
217
|
+
readonly inputs: readonly [{
|
|
218
|
+
readonly name: "";
|
|
219
|
+
readonly type: "address";
|
|
220
|
+
readonly internalType: "address";
|
|
221
|
+
}];
|
|
222
|
+
}, {
|
|
223
|
+
readonly type: "error";
|
|
224
|
+
readonly name: "CallerNotCreditFacadeException";
|
|
225
|
+
readonly inputs: readonly [];
|
|
226
|
+
}, {
|
|
227
|
+
readonly type: "error";
|
|
228
|
+
readonly name: "ZeroAddressException";
|
|
229
|
+
readonly inputs: readonly [];
|
|
230
|
+
}];
|
|
@@ -1169,7 +1169,9 @@ export declare class BytecodeRepositoryContract extends BaseContract<typeof abi>
|
|
|
1169
1169
|
isBytecodeUploaded(hash: `0x${string}`): Promise<boolean>;
|
|
1170
1170
|
isBytecodeAudited(hash: `0x${string}`): Promise<boolean>;
|
|
1171
1171
|
getLatestVersion(type_: string): Promise<bigint>;
|
|
1172
|
+
getAllowedBytecodeHash(type_: string, version: number): Promise<Hex>;
|
|
1172
1173
|
isPublicDomain(domain: string): Promise<boolean>;
|
|
1174
|
+
isSystemDomain(domain: string): Promise<boolean>;
|
|
1173
1175
|
getUploadBytecodeEvents(fromBlock: bigint, toBlock: bigint, chunkSize?: number): Promise<Omit<Bytecode, "uploadedAt">[]>;
|
|
1174
1176
|
getAddAuditorEvents(fromBlock: bigint, toBlock: bigint): Promise<Auditor[]>;
|
|
1175
1177
|
getDeployContractEvents(fromBlock: bigint, toBlock: bigint): Promise<Omit<DeploymentExtended, "timestamp">[]>;
|
|
@@ -11,21 +11,6 @@ export interface Bytecode {
|
|
|
11
11
|
transactionHash: Hex;
|
|
12
12
|
blockNumber: number;
|
|
13
13
|
}
|
|
14
|
-
export interface BytecodeShort extends Omit<Bytecode, "initCode" | "transactionHash" | "blockNumber" | "source" | "author"> {
|
|
15
|
-
auditorNames: string[];
|
|
16
|
-
}
|
|
17
|
-
export interface BytecodeExtended extends Bytecode {
|
|
18
|
-
verificationData?: unknown;
|
|
19
|
-
deployments: Deployment[];
|
|
20
|
-
audits: Audit[];
|
|
21
|
-
}
|
|
22
|
-
export interface Audit {
|
|
23
|
-
report: string;
|
|
24
|
-
auditor: Address;
|
|
25
|
-
auditorName: string;
|
|
26
|
-
isAuditorRemoved: boolean;
|
|
27
|
-
timestamp: number;
|
|
28
|
-
}
|
|
29
14
|
export interface AuditEvent {
|
|
30
15
|
reportUrl: string;
|
|
31
16
|
auditor: Address;
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import type { GearboxSDK } from "../../../sdk/index.js";
|
|
2
|
+
import type { AbstractAdapterContractOptions } from "./AbstractAdapter.js";
|
|
3
|
+
import { AbstractAdapterContract } from "./AbstractAdapter.js";
|
|
4
|
+
declare const abi: readonly [{
|
|
5
|
+
readonly type: "constructor";
|
|
6
|
+
readonly inputs: readonly [{
|
|
7
|
+
readonly name: "_creditManager";
|
|
8
|
+
readonly type: "address";
|
|
9
|
+
readonly internalType: "address";
|
|
10
|
+
}, {
|
|
11
|
+
readonly name: "_targetContract";
|
|
12
|
+
readonly type: "address";
|
|
13
|
+
readonly internalType: "address";
|
|
14
|
+
}];
|
|
15
|
+
readonly stateMutability: "nonpayable";
|
|
16
|
+
}, {
|
|
17
|
+
readonly type: "function";
|
|
18
|
+
readonly name: "acl";
|
|
19
|
+
readonly inputs: readonly [];
|
|
20
|
+
readonly outputs: readonly [{
|
|
21
|
+
readonly name: "";
|
|
22
|
+
readonly type: "address";
|
|
23
|
+
readonly internalType: "address";
|
|
24
|
+
}];
|
|
25
|
+
readonly stateMutability: "view";
|
|
26
|
+
}, {
|
|
27
|
+
readonly type: "function";
|
|
28
|
+
readonly name: "contractType";
|
|
29
|
+
readonly inputs: readonly [];
|
|
30
|
+
readonly outputs: readonly [{
|
|
31
|
+
readonly name: "";
|
|
32
|
+
readonly type: "bytes32";
|
|
33
|
+
readonly internalType: "bytes32";
|
|
34
|
+
}];
|
|
35
|
+
readonly stateMutability: "view";
|
|
36
|
+
}, {
|
|
37
|
+
readonly type: "function";
|
|
38
|
+
readonly name: "creditManager";
|
|
39
|
+
readonly inputs: readonly [];
|
|
40
|
+
readonly outputs: readonly [{
|
|
41
|
+
readonly name: "";
|
|
42
|
+
readonly type: "address";
|
|
43
|
+
readonly internalType: "address";
|
|
44
|
+
}];
|
|
45
|
+
readonly stateMutability: "view";
|
|
46
|
+
}, {
|
|
47
|
+
readonly type: "function";
|
|
48
|
+
readonly name: "lock";
|
|
49
|
+
readonly inputs: readonly [];
|
|
50
|
+
readonly outputs: readonly [];
|
|
51
|
+
readonly stateMutability: "nonpayable";
|
|
52
|
+
}, {
|
|
53
|
+
readonly type: "function";
|
|
54
|
+
readonly name: "locked";
|
|
55
|
+
readonly inputs: readonly [];
|
|
56
|
+
readonly outputs: readonly [{
|
|
57
|
+
readonly name: "";
|
|
58
|
+
readonly type: "bool";
|
|
59
|
+
readonly internalType: "bool";
|
|
60
|
+
}];
|
|
61
|
+
readonly stateMutability: "view";
|
|
62
|
+
}, {
|
|
63
|
+
readonly type: "function";
|
|
64
|
+
readonly name: "migrate";
|
|
65
|
+
readonly inputs: readonly [{
|
|
66
|
+
readonly name: "params";
|
|
67
|
+
readonly type: "tuple";
|
|
68
|
+
readonly internalType: "struct MigrationParams";
|
|
69
|
+
readonly components: readonly [{
|
|
70
|
+
readonly name: "accountOwner";
|
|
71
|
+
readonly type: "address";
|
|
72
|
+
readonly internalType: "address";
|
|
73
|
+
}, {
|
|
74
|
+
readonly name: "sourceCreditAccount";
|
|
75
|
+
readonly type: "address";
|
|
76
|
+
readonly internalType: "address";
|
|
77
|
+
}, {
|
|
78
|
+
readonly name: "targetCreditManager";
|
|
79
|
+
readonly type: "address";
|
|
80
|
+
readonly internalType: "address";
|
|
81
|
+
}, {
|
|
82
|
+
readonly name: "migratedCollaterals";
|
|
83
|
+
readonly type: "tuple[]";
|
|
84
|
+
readonly internalType: "struct MigratedCollateral[]";
|
|
85
|
+
readonly components: readonly [{
|
|
86
|
+
readonly name: "collateral";
|
|
87
|
+
readonly type: "address";
|
|
88
|
+
readonly internalType: "address";
|
|
89
|
+
}, {
|
|
90
|
+
readonly name: "amount";
|
|
91
|
+
readonly type: "uint256";
|
|
92
|
+
readonly internalType: "uint256";
|
|
93
|
+
}, {
|
|
94
|
+
readonly name: "targetQuotaIncrease";
|
|
95
|
+
readonly type: "uint96";
|
|
96
|
+
readonly internalType: "uint96";
|
|
97
|
+
}, {
|
|
98
|
+
readonly name: "underlyingInSource";
|
|
99
|
+
readonly type: "bool";
|
|
100
|
+
readonly internalType: "bool";
|
|
101
|
+
}, {
|
|
102
|
+
readonly name: "underlyingInTarget";
|
|
103
|
+
readonly type: "bool";
|
|
104
|
+
readonly internalType: "bool";
|
|
105
|
+
}, {
|
|
106
|
+
readonly name: "phantomTokenParams";
|
|
107
|
+
readonly type: "tuple";
|
|
108
|
+
readonly internalType: "struct PhantomTokenParams";
|
|
109
|
+
readonly components: readonly [{
|
|
110
|
+
readonly name: "isPhantomToken";
|
|
111
|
+
readonly type: "bool";
|
|
112
|
+
readonly internalType: "bool";
|
|
113
|
+
}, {
|
|
114
|
+
readonly name: "underlying";
|
|
115
|
+
readonly type: "address";
|
|
116
|
+
readonly internalType: "address";
|
|
117
|
+
}, {
|
|
118
|
+
readonly name: "underlyingAmount";
|
|
119
|
+
readonly type: "uint256";
|
|
120
|
+
readonly internalType: "uint256";
|
|
121
|
+
}];
|
|
122
|
+
}];
|
|
123
|
+
}, {
|
|
124
|
+
readonly name: "targetBorrowAmount";
|
|
125
|
+
readonly type: "uint256";
|
|
126
|
+
readonly internalType: "uint256";
|
|
127
|
+
}, {
|
|
128
|
+
readonly name: "underlyingSwapCalls";
|
|
129
|
+
readonly type: "tuple[]";
|
|
130
|
+
readonly internalType: "struct MultiCall[]";
|
|
131
|
+
readonly components: readonly [{
|
|
132
|
+
readonly name: "target";
|
|
133
|
+
readonly type: "address";
|
|
134
|
+
readonly internalType: "address";
|
|
135
|
+
}, {
|
|
136
|
+
readonly name: "callData";
|
|
137
|
+
readonly type: "bytes";
|
|
138
|
+
readonly internalType: "bytes";
|
|
139
|
+
}];
|
|
140
|
+
}, {
|
|
141
|
+
readonly name: "extraOpeningCalls";
|
|
142
|
+
readonly type: "tuple[]";
|
|
143
|
+
readonly internalType: "struct MultiCall[]";
|
|
144
|
+
readonly components: readonly [{
|
|
145
|
+
readonly name: "target";
|
|
146
|
+
readonly type: "address";
|
|
147
|
+
readonly internalType: "address";
|
|
148
|
+
}, {
|
|
149
|
+
readonly name: "callData";
|
|
150
|
+
readonly type: "bytes";
|
|
151
|
+
readonly internalType: "bytes";
|
|
152
|
+
}];
|
|
153
|
+
}, {
|
|
154
|
+
readonly name: "uniqueTransferredTokens";
|
|
155
|
+
readonly type: "address[]";
|
|
156
|
+
readonly internalType: "address[]";
|
|
157
|
+
}, {
|
|
158
|
+
readonly name: "numAddCollateralCalls";
|
|
159
|
+
readonly type: "uint256";
|
|
160
|
+
readonly internalType: "uint256";
|
|
161
|
+
}, {
|
|
162
|
+
readonly name: "numRemoveQuotasCalls";
|
|
163
|
+
readonly type: "uint256";
|
|
164
|
+
readonly internalType: "uint256";
|
|
165
|
+
}, {
|
|
166
|
+
readonly name: "numIncreaseQuotaCalls";
|
|
167
|
+
readonly type: "uint256";
|
|
168
|
+
readonly internalType: "uint256";
|
|
169
|
+
}, {
|
|
170
|
+
readonly name: "numPhantomTokenCalls";
|
|
171
|
+
readonly type: "uint256";
|
|
172
|
+
readonly internalType: "uint256";
|
|
173
|
+
}];
|
|
174
|
+
}];
|
|
175
|
+
readonly outputs: readonly [{
|
|
176
|
+
readonly name: "";
|
|
177
|
+
readonly type: "bool";
|
|
178
|
+
readonly internalType: "bool";
|
|
179
|
+
}];
|
|
180
|
+
readonly stateMutability: "nonpayable";
|
|
181
|
+
}, {
|
|
182
|
+
readonly type: "function";
|
|
183
|
+
readonly name: "serialize";
|
|
184
|
+
readonly inputs: readonly [];
|
|
185
|
+
readonly outputs: readonly [{
|
|
186
|
+
readonly name: "serializedData";
|
|
187
|
+
readonly type: "bytes";
|
|
188
|
+
readonly internalType: "bytes";
|
|
189
|
+
}];
|
|
190
|
+
readonly stateMutability: "view";
|
|
191
|
+
}, {
|
|
192
|
+
readonly type: "function";
|
|
193
|
+
readonly name: "targetContract";
|
|
194
|
+
readonly inputs: readonly [];
|
|
195
|
+
readonly outputs: readonly [{
|
|
196
|
+
readonly name: "";
|
|
197
|
+
readonly type: "address";
|
|
198
|
+
readonly internalType: "address";
|
|
199
|
+
}];
|
|
200
|
+
readonly stateMutability: "view";
|
|
201
|
+
}, {
|
|
202
|
+
readonly type: "function";
|
|
203
|
+
readonly name: "unlock";
|
|
204
|
+
readonly inputs: readonly [];
|
|
205
|
+
readonly outputs: readonly [];
|
|
206
|
+
readonly stateMutability: "nonpayable";
|
|
207
|
+
}, {
|
|
208
|
+
readonly type: "function";
|
|
209
|
+
readonly name: "version";
|
|
210
|
+
readonly inputs: readonly [];
|
|
211
|
+
readonly outputs: readonly [{
|
|
212
|
+
readonly name: "";
|
|
213
|
+
readonly type: "uint256";
|
|
214
|
+
readonly internalType: "uint256";
|
|
215
|
+
}];
|
|
216
|
+
readonly stateMutability: "view";
|
|
217
|
+
}, {
|
|
218
|
+
readonly type: "error";
|
|
219
|
+
readonly name: "AddressIsNotContractException";
|
|
220
|
+
readonly inputs: readonly [{
|
|
221
|
+
readonly name: "";
|
|
222
|
+
readonly type: "address";
|
|
223
|
+
readonly internalType: "address";
|
|
224
|
+
}];
|
|
225
|
+
}, {
|
|
226
|
+
readonly type: "error";
|
|
227
|
+
readonly name: "CallerNotCreditFacadeException";
|
|
228
|
+
readonly inputs: readonly [];
|
|
229
|
+
}, {
|
|
230
|
+
readonly type: "error";
|
|
231
|
+
readonly name: "ZeroAddressException";
|
|
232
|
+
readonly inputs: readonly [];
|
|
233
|
+
}];
|
|
234
|
+
type abi = typeof abi;
|
|
235
|
+
export declare class AccountMigratorAdapterContract extends AbstractAdapterContract<abi> {
|
|
236
|
+
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<abi>, "abi">);
|
|
237
|
+
}
|
|
238
|
+
export {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { AbiParameter } from "viem";
|
|
2
2
|
export type VersionedAbi = Record<number, readonly AbiParameter[]>;
|
|
3
3
|
export type AdapterContractTypeLegacy = "AD_AAVE_V3_LENDING_POOL" | "AD_BALANCER_VAULT" | "AD_CAMELOT_V3_ROUTER" | "AD_CONVEX_L2_BOOSTER" | "AD_CONVEX_L2_REWARD_POOL" | "AD_CONVEX_V1_BASE_REWARD_POOL" | "AD_CONVEX_V1_BOOSTER" | "AD_CURVE_STABLE_NG" | "AD_CURVE_V1_2ASSETS" | "AD_CURVE_V1_3ASSETS" | "AD_CURVE_V1_4ASSETS" | "AD_CURVE_V1_EXCHANGE_ONLY" | "AD_CURVE_V1_STECRV_POOL" | "AD_CURVE_V1_WRAPPER" | "AD_DAI_USDS_EXCHANGE" | "AD_EQUALIZER_ROUTER" | "AD_ERC4626_VAULT" | "AD_LIDO_V1" | "AD_LIDO_WSTETH_V1" | "AD_MELLOW_ERC4626_VAULT" | "AD_MELLOW_LRT_VAULT" | "AD_PENDLE_ROUTER" | "AD_STAKING_REWARDS" | "AD_SYMBIOTIC_DEFAULT_COLLATERAL" | "AD_UNISWAP_V2_ROUTER" | "AD_UNISWAP_V3_ROUTER" | "AD_VELODROME_V2_ROUTER" | "AD_YEARN_V2" | "AD_ZIRCUIT_POOL";
|
|
4
|
-
export type AdapterContractType = "ADAPTER::BALANCER_V3_ROUTER" | "ADAPTER::BALANCER_V3_WRAPPER" | "ADAPTER::BALANCER_VAULT" | "ADAPTER::CAMELOT_V3_ROUTER" | "ADAPTER::CURVE_STABLE_NG" | "ADAPTER::CURVE_V1_2ASSETS" | "ADAPTER::CURVE_V1_3ASSETS" | "ADAPTER::CURVE_V1_4ASSETS" | "ADAPTER::CURVE_V1_STECRV_POOL" | "ADAPTER::CURVE_V1_WRAPPER" | "ADAPTER::CVX_V1_BASE_REWARD_POOL" | "ADAPTER::CVX_V1_BOOSTER" | "ADAPTER::DAI_USDS_EXCHANGE" | "ADAPTER::EQUALIZER_ROUTER" | "ADAPTER::ERC4626_VAULT" | "ADAPTER::ERC4626_VAULT_REFERRAL" | "ADAPTER::FLUID_DEX" | "ADAPTER::INFRARED_VAULT" | "ADAPTER::KODIAK_ISLAND_GATEWAY" | "ADAPTER::LIDO_V1" | "ADAPTER::LIDO_WSTETH_V1" | "ADAPTER::MELLOW_CLAIMER" | "ADAPTER::MELLOW_DVV" | "ADAPTER::MELLOW_ERC4626_VAULT" | "ADAPTER::MELLOW_LRT_VAULT" | "ADAPTER::MELLOW_WRAPPER" | "ADAPTER::MIDAS_ISSUANCE_VAULT" | "ADAPTER::MIDAS_REDEMPTION_VAULT" | "ADAPTER::PENDLE_ROUTER" | "ADAPTER::STAKING_REWARDS" | "ADAPTER::TRADERJOE_ROUTER" | "ADAPTER::UNISWAP_V2_ROUTER" | "ADAPTER::UNISWAP_V3_ROUTER" | "ADAPTER::UPSHIFT_VAULT" | "ADAPTER::VELODROME_V2_ROUTER" | "ADAPTER::YEARN_V2";
|
|
4
|
+
export type AdapterContractType = "ADAPTER::ACCOUNT_MIGRATOR" | "ADAPTER::BALANCER_V3_ROUTER" | "ADAPTER::BALANCER_V3_WRAPPER" | "ADAPTER::BALANCER_VAULT" | "ADAPTER::CAMELOT_V3_ROUTER" | "ADAPTER::CURVE_STABLE_NG" | "ADAPTER::CURVE_V1_2ASSETS" | "ADAPTER::CURVE_V1_3ASSETS" | "ADAPTER::CURVE_V1_4ASSETS" | "ADAPTER::CURVE_V1_STECRV_POOL" | "ADAPTER::CURVE_V1_WRAPPER" | "ADAPTER::CVX_V1_BASE_REWARD_POOL" | "ADAPTER::CVX_V1_BOOSTER" | "ADAPTER::DAI_USDS_EXCHANGE" | "ADAPTER::EQUALIZER_ROUTER" | "ADAPTER::ERC4626_VAULT" | "ADAPTER::ERC4626_VAULT_REFERRAL" | "ADAPTER::FLUID_DEX" | "ADAPTER::INFRARED_VAULT" | "ADAPTER::KODIAK_ISLAND_GATEWAY" | "ADAPTER::LIDO_V1" | "ADAPTER::LIDO_WSTETH_V1" | "ADAPTER::MELLOW_CLAIMER" | "ADAPTER::MELLOW_DVV" | "ADAPTER::MELLOW_ERC4626_VAULT" | "ADAPTER::MELLOW_LRT_VAULT" | "ADAPTER::MELLOW_WRAPPER" | "ADAPTER::MIDAS_ISSUANCE_VAULT" | "ADAPTER::MIDAS_REDEMPTION_VAULT" | "ADAPTER::PENDLE_ROUTER" | "ADAPTER::STAKING_REWARDS" | "ADAPTER::TRADERJOE_ROUTER" | "ADAPTER::UNISWAP_V2_ROUTER" | "ADAPTER::UNISWAP_V3_ROUTER" | "ADAPTER::UPSHIFT_VAULT" | "ADAPTER::VELODROME_V2_ROUTER" | "ADAPTER::YEARN_V2";
|
|
5
5
|
export declare enum AdapterType {
|
|
6
|
+
ACCOUNT_MIGRATOR = "ACCOUNT_MIGRATOR",
|
|
6
7
|
BALANCER_V3_ROUTER = "BALANCER_V3_ROUTER",
|
|
7
8
|
BALANCER_V3_WRAPPER = "BALANCER_V3_WRAPPER",
|
|
8
9
|
BALANCER_VAULT = "BALANCER_VAULT",
|