@gearbox-protocol/deploy-tools 5.9.6 → 5.9.8
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/index.mjs +167 -24
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -342231,6 +342231,120 @@ var iMarketCompressorAbi = [
|
|
|
342231
342231
|
stateMutability: "view"
|
|
342232
342232
|
}
|
|
342233
342233
|
];
|
|
342234
|
+
var iPeripheryCompressorAbi = [
|
|
342235
|
+
{
|
|
342236
|
+
type: "function",
|
|
342237
|
+
inputs: [],
|
|
342238
|
+
name: "contractType",
|
|
342239
|
+
outputs: [{ name: "", internalType: "bytes32", type: "bytes32" }],
|
|
342240
|
+
stateMutability: "view"
|
|
342241
|
+
},
|
|
342242
|
+
{
|
|
342243
|
+
type: "function",
|
|
342244
|
+
inputs: [
|
|
342245
|
+
{ name: "marketConfigurator", internalType: "address", type: "address" },
|
|
342246
|
+
{ name: "creditAccount", internalType: "address", type: "address" }
|
|
342247
|
+
],
|
|
342248
|
+
name: "getActiveBots",
|
|
342249
|
+
outputs: [
|
|
342250
|
+
{
|
|
342251
|
+
name: "",
|
|
342252
|
+
internalType: "struct BotState[]",
|
|
342253
|
+
type: "tuple[]",
|
|
342254
|
+
components: [
|
|
342255
|
+
{
|
|
342256
|
+
name: "baseParams",
|
|
342257
|
+
internalType: "struct BaseParams",
|
|
342258
|
+
type: "tuple",
|
|
342259
|
+
components: [
|
|
342260
|
+
{ name: "addr", internalType: "address", type: "address" },
|
|
342261
|
+
{ name: "version", internalType: "uint256", type: "uint256" },
|
|
342262
|
+
{
|
|
342263
|
+
name: "contractType",
|
|
342264
|
+
internalType: "bytes32",
|
|
342265
|
+
type: "bytes32"
|
|
342266
|
+
},
|
|
342267
|
+
{
|
|
342268
|
+
name: "serializedParams",
|
|
342269
|
+
internalType: "bytes",
|
|
342270
|
+
type: "bytes"
|
|
342271
|
+
}
|
|
342272
|
+
]
|
|
342273
|
+
},
|
|
342274
|
+
{ name: "permissions", internalType: "uint192", type: "uint192" },
|
|
342275
|
+
{ name: "forbidden", internalType: "bool", type: "bool" }
|
|
342276
|
+
]
|
|
342277
|
+
}
|
|
342278
|
+
],
|
|
342279
|
+
stateMutability: "view"
|
|
342280
|
+
},
|
|
342281
|
+
{
|
|
342282
|
+
type: "function",
|
|
342283
|
+
inputs: [
|
|
342284
|
+
{ name: "marketConfigurator", internalType: "address", type: "address" },
|
|
342285
|
+
{ name: "pool", internalType: "address", type: "address" }
|
|
342286
|
+
],
|
|
342287
|
+
name: "getZappers",
|
|
342288
|
+
outputs: [
|
|
342289
|
+
{
|
|
342290
|
+
name: "",
|
|
342291
|
+
internalType: "struct ZapperState[]",
|
|
342292
|
+
type: "tuple[]",
|
|
342293
|
+
components: [
|
|
342294
|
+
{
|
|
342295
|
+
name: "baseParams",
|
|
342296
|
+
internalType: "struct BaseParams",
|
|
342297
|
+
type: "tuple",
|
|
342298
|
+
components: [
|
|
342299
|
+
{ name: "addr", internalType: "address", type: "address" },
|
|
342300
|
+
{ name: "version", internalType: "uint256", type: "uint256" },
|
|
342301
|
+
{
|
|
342302
|
+
name: "contractType",
|
|
342303
|
+
internalType: "bytes32",
|
|
342304
|
+
type: "bytes32"
|
|
342305
|
+
},
|
|
342306
|
+
{
|
|
342307
|
+
name: "serializedParams",
|
|
342308
|
+
internalType: "bytes",
|
|
342309
|
+
type: "bytes"
|
|
342310
|
+
}
|
|
342311
|
+
]
|
|
342312
|
+
},
|
|
342313
|
+
{
|
|
342314
|
+
name: "tokenIn",
|
|
342315
|
+
internalType: "struct TokenData",
|
|
342316
|
+
type: "tuple",
|
|
342317
|
+
components: [
|
|
342318
|
+
{ name: "addr", internalType: "address", type: "address" },
|
|
342319
|
+
{ name: "symbol", internalType: "string", type: "string" },
|
|
342320
|
+
{ name: "name", internalType: "string", type: "string" },
|
|
342321
|
+
{ name: "decimals", internalType: "uint8", type: "uint8" }
|
|
342322
|
+
]
|
|
342323
|
+
},
|
|
342324
|
+
{
|
|
342325
|
+
name: "tokenOut",
|
|
342326
|
+
internalType: "struct TokenData",
|
|
342327
|
+
type: "tuple",
|
|
342328
|
+
components: [
|
|
342329
|
+
{ name: "addr", internalType: "address", type: "address" },
|
|
342330
|
+
{ name: "symbol", internalType: "string", type: "string" },
|
|
342331
|
+
{ name: "name", internalType: "string", type: "string" },
|
|
342332
|
+
{ name: "decimals", internalType: "uint8", type: "uint8" }
|
|
342333
|
+
]
|
|
342334
|
+
}
|
|
342335
|
+
]
|
|
342336
|
+
}
|
|
342337
|
+
],
|
|
342338
|
+
stateMutability: "view"
|
|
342339
|
+
},
|
|
342340
|
+
{
|
|
342341
|
+
type: "function",
|
|
342342
|
+
inputs: [],
|
|
342343
|
+
name: "version",
|
|
342344
|
+
outputs: [{ name: "", internalType: "uint256", type: "uint256" }],
|
|
342345
|
+
stateMutability: "view"
|
|
342346
|
+
}
|
|
342347
|
+
];
|
|
342234
342348
|
var iPriceFeedCompressorAbi = [
|
|
342235
342349
|
{
|
|
342236
342350
|
type: "function",
|
|
@@ -364380,6 +364494,7 @@ var AP_GEAR_STAKING = "GEAR_STAKING";
|
|
|
364380
364494
|
var AP_GEAR_TOKEN = "GEAR_TOKEN";
|
|
364381
364495
|
var AP_MARKET_COMPRESSOR = "MARKET_COMPRESSOR";
|
|
364382
364496
|
var AP_MARKET_CONFIGURATOR = "MARKET_CONFIGURATOR";
|
|
364497
|
+
var AP_PERIPHERY_COMPRESSOR = "PERIPHERY_COMPRESSOR";
|
|
364383
364498
|
var AP_PRICE_FEED_COMPRESSOR = "PRICE_FEED_COMPRESSOR";
|
|
364384
364499
|
var AP_REWARDS_COMPRESSOR = "REWARDS_COMPRESSOR";
|
|
364385
364500
|
var AP_ROUTER = "ROUTER";
|
|
@@ -374997,7 +375112,6 @@ var MarketSuite = class extends SDKConstruct {
|
|
|
374997
375112
|
* Original data received from compressor
|
|
374998
375113
|
*/
|
|
374999
375114
|
state;
|
|
375000
|
-
zappers = [];
|
|
375001
375115
|
constructor(sdk, marketData) {
|
|
375002
375116
|
super(sdk);
|
|
375003
375117
|
this.state = marketData;
|
|
@@ -375012,11 +375126,7 @@ var MarketSuite = class extends SDKConstruct {
|
|
|
375012
375126
|
}
|
|
375013
375127
|
this.configurator = configurator;
|
|
375014
375128
|
this.acl = marketData.acl;
|
|
375015
|
-
const
|
|
375016
|
-
...marketData.tokens
|
|
375017
|
-
// ...marketData.zappers.flatMap(z => [z.tokenIn, z.tokenOut]),
|
|
375018
|
-
];
|
|
375019
|
-
for (const t of allTokens) {
|
|
375129
|
+
for (const t of marketData.tokens) {
|
|
375020
375130
|
sdk.tokensMeta.upsert(t.addr, t);
|
|
375021
375131
|
sdk.provider.addressLabels.set(t.addr, t.symbol);
|
|
375022
375132
|
}
|
|
@@ -375052,14 +375162,7 @@ var MarketSuite = class extends SDKConstruct {
|
|
|
375052
375162
|
),
|
|
375053
375163
|
emergencyLiquidators: this.state.emergencyLiquidators.map(
|
|
375054
375164
|
(a) => this.labelAddress(a)
|
|
375055
|
-
)
|
|
375056
|
-
zappers: this.zappers.map((z2) => ({
|
|
375057
|
-
address: z2.baseParams.addr,
|
|
375058
|
-
contractType: z2.baseParams.contractType,
|
|
375059
|
-
version: Number(z2.baseParams.version),
|
|
375060
|
-
tokenIn: this.labelAddress(z2.tokenIn.addr),
|
|
375061
|
-
tokenOut: this.labelAddress(z2.tokenOut.addr)
|
|
375062
|
-
}))
|
|
375165
|
+
)
|
|
375063
375166
|
};
|
|
375064
375167
|
}
|
|
375065
375168
|
};
|
|
@@ -375069,6 +375172,7 @@ var MarketRegister = class extends SDKConstruct {
|
|
|
375069
375172
|
* Mapping pool.address -> MarketSuite
|
|
375070
375173
|
*/
|
|
375071
375174
|
#markets = new AddressMap();
|
|
375175
|
+
#zappers = [];
|
|
375072
375176
|
constructor(sdk, markets) {
|
|
375073
375177
|
super(sdk);
|
|
375074
375178
|
this.#logger = childLogger("MarketRegister", sdk.logger);
|
|
@@ -375088,6 +375192,28 @@ var MarketRegister = class extends SDKConstruct {
|
|
|
375088
375192
|
}
|
|
375089
375193
|
await this.#loadMarkets(marketConfigurators, [], ignoreUpdateablePrices);
|
|
375090
375194
|
}
|
|
375195
|
+
async loadZappers() {
|
|
375196
|
+
const pcAddr = this.sdk.addressProvider.getAddress(
|
|
375197
|
+
AP_PERIPHERY_COMPRESSOR,
|
|
375198
|
+
310
|
|
375199
|
+
);
|
|
375200
|
+
this.#logger?.debug(`loading zappers with periphery compressor ${pcAddr}`);
|
|
375201
|
+
const resp = await this.provider.publicClient.multicall({
|
|
375202
|
+
contracts: this.markets.map((m) => ({
|
|
375203
|
+
abi: iPeripheryCompressorAbi,
|
|
375204
|
+
address: pcAddr,
|
|
375205
|
+
functionName: "getZappers",
|
|
375206
|
+
args: [m.configurator, m.pool.pool.address]
|
|
375207
|
+
})),
|
|
375208
|
+
allowFailure: false
|
|
375209
|
+
});
|
|
375210
|
+
this.#zappers = resp.flat();
|
|
375211
|
+
const zappersTokens = this.#zappers.flatMap((z2) => [z2.tokenIn, z2.tokenOut]);
|
|
375212
|
+
for (const t of zappersTokens) {
|
|
375213
|
+
this.sdk.tokensMeta.upsert(t.addr, t);
|
|
375214
|
+
this.sdk.provider.addressLabels.set(t.addr, t.symbol);
|
|
375215
|
+
}
|
|
375216
|
+
}
|
|
375091
375217
|
async syncState() {
|
|
375092
375218
|
const pools = this.markets.filter((m) => m.dirty).map((m) => m.pool.pool.address);
|
|
375093
375219
|
if (pools.length) {
|
|
@@ -375109,7 +375235,10 @@ var MarketRegister = class extends SDKConstruct {
|
|
|
375109
375235
|
const updates = await this.sdk.priceFeeds.generatePriceFeedsUpdateTxs();
|
|
375110
375236
|
txs = updates.txs;
|
|
375111
375237
|
}
|
|
375112
|
-
this.#logger?.debug(
|
|
375238
|
+
this.#logger?.debug(
|
|
375239
|
+
{ configurators, pools },
|
|
375240
|
+
`calling getMarkets with ${txs.length} price updates`
|
|
375241
|
+
);
|
|
375113
375242
|
const resp = await simulateMulticall(this.provider.publicClient, {
|
|
375114
375243
|
contracts: [
|
|
375115
375244
|
...txs.map(rawTxToMulticallPriceUpdate),
|
|
@@ -375171,7 +375300,16 @@ var MarketRegister = class extends SDKConstruct {
|
|
|
375171
375300
|
return this.markets.map((market) => market.state);
|
|
375172
375301
|
}
|
|
375173
375302
|
stateHuman(raw = true) {
|
|
375174
|
-
return
|
|
375303
|
+
return {
|
|
375304
|
+
markets: this.markets.map((market) => market.stateHuman(raw)),
|
|
375305
|
+
zappers: this.zappers.map((z2) => ({
|
|
375306
|
+
address: z2.baseParams.addr,
|
|
375307
|
+
contractType: z2.baseParams.contractType,
|
|
375308
|
+
version: Number(z2.baseParams.version),
|
|
375309
|
+
tokenIn: this.labelAddress(z2.tokenIn.addr),
|
|
375310
|
+
tokenOut: this.labelAddress(z2.tokenOut.addr)
|
|
375311
|
+
}))
|
|
375312
|
+
};
|
|
375175
375313
|
}
|
|
375176
375314
|
get pools() {
|
|
375177
375315
|
return this.markets.map((market) => market.pool);
|
|
@@ -375230,6 +375368,9 @@ var MarketRegister = class extends SDKConstruct {
|
|
|
375230
375368
|
get marketsMap() {
|
|
375231
375369
|
return this.#markets;
|
|
375232
375370
|
}
|
|
375371
|
+
get zappers() {
|
|
375372
|
+
return this.#zappers;
|
|
375373
|
+
}
|
|
375233
375374
|
get markets() {
|
|
375234
375375
|
return this.#markets.values();
|
|
375235
375376
|
}
|
|
@@ -376944,13 +377085,10 @@ var GearboxSDK = class _GearboxSDK {
|
|
|
376944
377085
|
`address provider version: ${this.#addressProvider.version}`
|
|
376945
377086
|
);
|
|
376946
377087
|
await this.#addressProvider.syncState(this.currentBlock);
|
|
376947
|
-
const botListAddress = this.#addressProvider.
|
|
377088
|
+
const botListAddress = this.#addressProvider.getLatestVersion(AP_BOT_LIST);
|
|
376948
377089
|
this.#botListContract = new BotListContract(this, botListAddress);
|
|
376949
377090
|
this.#gear = this.#addressProvider.getAddress(AP_GEAR_TOKEN);
|
|
376950
|
-
const gearStakingAddress = this.#addressProvider.
|
|
376951
|
-
AP_GEAR_STAKING,
|
|
376952
|
-
300
|
|
376953
|
-
);
|
|
377091
|
+
const gearStakingAddress = this.#addressProvider.getLatestVersion(AP_GEAR_STAKING);
|
|
376954
377092
|
this.#gearStakingContract = new GearStakingContract(
|
|
376955
377093
|
this,
|
|
376956
377094
|
gearStakingAddress
|
|
@@ -377024,7 +377162,7 @@ var GearboxSDK = class _GearboxSDK {
|
|
|
377024
377162
|
botList: this.botListContract.stateHuman(raw),
|
|
377025
377163
|
gearStakingV3: this.gearStakingContract.stateHuman(raw)
|
|
377026
377164
|
},
|
|
377027
|
-
|
|
377165
|
+
...this.marketRegister.stateHuman(raw)
|
|
377028
377166
|
};
|
|
377029
377167
|
}
|
|
377030
377168
|
get state() {
|
|
@@ -402714,6 +402852,11 @@ var SDKExample = class {
|
|
|
402714
402852
|
const hash2 = await sendRawTx(updater, { tx: puTx });
|
|
402715
402853
|
await publicClient.waitForTransactionReceipt({ hash: hash2 });
|
|
402716
402854
|
await this.#sdk.marketRegister.loadMarkets(marketConfigurators, true);
|
|
402855
|
+
try {
|
|
402856
|
+
await this.#sdk.marketRegister.loadZappers();
|
|
402857
|
+
} catch (e) {
|
|
402858
|
+
this.#logger?.error(`failed to load zappers: ${e}`);
|
|
402859
|
+
}
|
|
402717
402860
|
this.#logger?.info("attached sdk");
|
|
402718
402861
|
if (outFile) {
|
|
402719
402862
|
try {
|
|
@@ -409275,7 +409418,7 @@ function getRenderer(opts) {
|
|
|
409275
409418
|
var package_default = {
|
|
409276
409419
|
name: "@gearbox-protocol/deploy-tools",
|
|
409277
409420
|
description: "Gearbox deploy tools",
|
|
409278
|
-
version: "5.9.
|
|
409421
|
+
version: "5.9.8",
|
|
409279
409422
|
homepage: "https://gearbox.fi",
|
|
409280
409423
|
keywords: [
|
|
409281
409424
|
"gearbox"
|
|
@@ -409318,7 +409461,7 @@ var package_default = {
|
|
|
409318
409461
|
"@gearbox-protocol/deploy-tools-node": "0.0.0",
|
|
409319
409462
|
"@gearbox-protocol/deploy-tools-shared": "0.0.0",
|
|
409320
409463
|
"@gearbox-protocol/deploy-tools-types": "0.0.0",
|
|
409321
|
-
"@gearbox-protocol/sdk": "3.0.0-vfour.
|
|
409464
|
+
"@gearbox-protocol/sdk": "3.0.0-vfour.211",
|
|
409322
409465
|
"@gearbox-protocol/sdk-gov": "^2.34.0",
|
|
409323
409466
|
"@types/lodash-es": "^4.17.12",
|
|
409324
409467
|
"@types/node": "^22.12.0",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gearbox-protocol/deploy-tools",
|
|
3
3
|
"description": "Gearbox deploy tools",
|
|
4
|
-
"version": "5.9.
|
|
4
|
+
"version": "5.9.8",
|
|
5
5
|
"homepage": "https://gearbox.fi",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"gearbox"
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@gearbox-protocol/deploy-tools-node": "0.0.0",
|
|
45
45
|
"@gearbox-protocol/deploy-tools-shared": "0.0.0",
|
|
46
46
|
"@gearbox-protocol/deploy-tools-types": "0.0.0",
|
|
47
|
-
"@gearbox-protocol/sdk": "3.0.0-vfour.
|
|
47
|
+
"@gearbox-protocol/sdk": "3.0.0-vfour.211",
|
|
48
48
|
"@gearbox-protocol/sdk-gov": "^2.34.0",
|
|
49
49
|
"@types/lodash-es": "^4.17.12",
|
|
50
50
|
"@types/node": "^22.12.0",
|