@gearbox-protocol/deploy-tools 5.9.8 → 5.9.10
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 +218 -24
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -340123,6 +340123,149 @@ var iCreditAccountCompressorAbi = [
|
|
|
340123
340123
|
stateMutability: "view"
|
|
340124
340124
|
}
|
|
340125
340125
|
];
|
|
340126
|
+
var iGaugeCompressorAbi = [
|
|
340127
|
+
{
|
|
340128
|
+
type: "function",
|
|
340129
|
+
inputs: [],
|
|
340130
|
+
name: "contractType",
|
|
340131
|
+
outputs: [{ name: "", internalType: "bytes32", type: "bytes32" }],
|
|
340132
|
+
stateMutability: "view"
|
|
340133
|
+
},
|
|
340134
|
+
{
|
|
340135
|
+
type: "function",
|
|
340136
|
+
inputs: [
|
|
340137
|
+
{ name: "gauge", internalType: "address", type: "address" },
|
|
340138
|
+
{ name: "staker", internalType: "address", type: "address" }
|
|
340139
|
+
],
|
|
340140
|
+
name: "getGauge",
|
|
340141
|
+
outputs: [
|
|
340142
|
+
{
|
|
340143
|
+
name: "result",
|
|
340144
|
+
internalType: "struct GaugeInfo",
|
|
340145
|
+
type: "tuple",
|
|
340146
|
+
components: [
|
|
340147
|
+
{ name: "addr", internalType: "address", type: "address" },
|
|
340148
|
+
{ name: "pool", internalType: "address", type: "address" },
|
|
340149
|
+
{ name: "symbol", internalType: "string", type: "string" },
|
|
340150
|
+
{ name: "name", internalType: "string", type: "string" },
|
|
340151
|
+
{ name: "voter", internalType: "address", type: "address" },
|
|
340152
|
+
{ name: "underlying", internalType: "address", type: "address" },
|
|
340153
|
+
{ name: "currentEpoch", internalType: "uint16", type: "uint16" },
|
|
340154
|
+
{ name: "epochLastUpdate", internalType: "uint16", type: "uint16" },
|
|
340155
|
+
{ name: "epochFrozen", internalType: "bool", type: "bool" },
|
|
340156
|
+
{
|
|
340157
|
+
name: "quotaParams",
|
|
340158
|
+
internalType: "struct GaugeQuotaParams[]",
|
|
340159
|
+
type: "tuple[]",
|
|
340160
|
+
components: [
|
|
340161
|
+
{ name: "token", internalType: "address", type: "address" },
|
|
340162
|
+
{ name: "minRate", internalType: "uint16", type: "uint16" },
|
|
340163
|
+
{ name: "maxRate", internalType: "uint16", type: "uint16" },
|
|
340164
|
+
{
|
|
340165
|
+
name: "totalVotesLpSide",
|
|
340166
|
+
internalType: "uint96",
|
|
340167
|
+
type: "uint96"
|
|
340168
|
+
},
|
|
340169
|
+
{
|
|
340170
|
+
name: "totalVotesCaSide",
|
|
340171
|
+
internalType: "uint96",
|
|
340172
|
+
type: "uint96"
|
|
340173
|
+
},
|
|
340174
|
+
{
|
|
340175
|
+
name: "stakerVotesLpSide",
|
|
340176
|
+
internalType: "uint96",
|
|
340177
|
+
type: "uint96"
|
|
340178
|
+
},
|
|
340179
|
+
{
|
|
340180
|
+
name: "stakerVotesCaSide",
|
|
340181
|
+
internalType: "uint96",
|
|
340182
|
+
type: "uint96"
|
|
340183
|
+
}
|
|
340184
|
+
]
|
|
340185
|
+
}
|
|
340186
|
+
]
|
|
340187
|
+
}
|
|
340188
|
+
],
|
|
340189
|
+
stateMutability: "view"
|
|
340190
|
+
},
|
|
340191
|
+
{
|
|
340192
|
+
type: "function",
|
|
340193
|
+
inputs: [
|
|
340194
|
+
{
|
|
340195
|
+
name: "filter",
|
|
340196
|
+
internalType: "struct MarketFilter",
|
|
340197
|
+
type: "tuple",
|
|
340198
|
+
components: [
|
|
340199
|
+
{
|
|
340200
|
+
name: "configurators",
|
|
340201
|
+
internalType: "address[]",
|
|
340202
|
+
type: "address[]"
|
|
340203
|
+
},
|
|
340204
|
+
{ name: "pools", internalType: "address[]", type: "address[]" },
|
|
340205
|
+
{ name: "underlying", internalType: "address", type: "address" }
|
|
340206
|
+
]
|
|
340207
|
+
},
|
|
340208
|
+
{ name: "staker", internalType: "address", type: "address" }
|
|
340209
|
+
],
|
|
340210
|
+
name: "getGauges",
|
|
340211
|
+
outputs: [
|
|
340212
|
+
{
|
|
340213
|
+
name: "result",
|
|
340214
|
+
internalType: "struct GaugeInfo[]",
|
|
340215
|
+
type: "tuple[]",
|
|
340216
|
+
components: [
|
|
340217
|
+
{ name: "addr", internalType: "address", type: "address" },
|
|
340218
|
+
{ name: "pool", internalType: "address", type: "address" },
|
|
340219
|
+
{ name: "symbol", internalType: "string", type: "string" },
|
|
340220
|
+
{ name: "name", internalType: "string", type: "string" },
|
|
340221
|
+
{ name: "voter", internalType: "address", type: "address" },
|
|
340222
|
+
{ name: "underlying", internalType: "address", type: "address" },
|
|
340223
|
+
{ name: "currentEpoch", internalType: "uint16", type: "uint16" },
|
|
340224
|
+
{ name: "epochLastUpdate", internalType: "uint16", type: "uint16" },
|
|
340225
|
+
{ name: "epochFrozen", internalType: "bool", type: "bool" },
|
|
340226
|
+
{
|
|
340227
|
+
name: "quotaParams",
|
|
340228
|
+
internalType: "struct GaugeQuotaParams[]",
|
|
340229
|
+
type: "tuple[]",
|
|
340230
|
+
components: [
|
|
340231
|
+
{ name: "token", internalType: "address", type: "address" },
|
|
340232
|
+
{ name: "minRate", internalType: "uint16", type: "uint16" },
|
|
340233
|
+
{ name: "maxRate", internalType: "uint16", type: "uint16" },
|
|
340234
|
+
{
|
|
340235
|
+
name: "totalVotesLpSide",
|
|
340236
|
+
internalType: "uint96",
|
|
340237
|
+
type: "uint96"
|
|
340238
|
+
},
|
|
340239
|
+
{
|
|
340240
|
+
name: "totalVotesCaSide",
|
|
340241
|
+
internalType: "uint96",
|
|
340242
|
+
type: "uint96"
|
|
340243
|
+
},
|
|
340244
|
+
{
|
|
340245
|
+
name: "stakerVotesLpSide",
|
|
340246
|
+
internalType: "uint96",
|
|
340247
|
+
type: "uint96"
|
|
340248
|
+
},
|
|
340249
|
+
{
|
|
340250
|
+
name: "stakerVotesCaSide",
|
|
340251
|
+
internalType: "uint96",
|
|
340252
|
+
type: "uint96"
|
|
340253
|
+
}
|
|
340254
|
+
]
|
|
340255
|
+
}
|
|
340256
|
+
]
|
|
340257
|
+
}
|
|
340258
|
+
],
|
|
340259
|
+
stateMutability: "view"
|
|
340260
|
+
},
|
|
340261
|
+
{
|
|
340262
|
+
type: "function",
|
|
340263
|
+
inputs: [],
|
|
340264
|
+
name: "version",
|
|
340265
|
+
outputs: [{ name: "", internalType: "uint256", type: "uint256" }],
|
|
340266
|
+
stateMutability: "view"
|
|
340267
|
+
}
|
|
340268
|
+
];
|
|
340126
340269
|
var iMarketCompressorAbi = [
|
|
340127
340270
|
{
|
|
340128
340271
|
type: "function",
|
|
@@ -364490,6 +364633,7 @@ var DEPRECIATED_POOLS = {
|
|
|
364490
364633
|
var NO_VERSION = 0;
|
|
364491
364634
|
var AP_BOT_LIST = "BOT_LIST";
|
|
364492
364635
|
var AP_CREDIT_ACCOUNT_COMPRESSOR = "CREDIT_ACCOUNT_COMPRESSOR";
|
|
364636
|
+
var AP_GAUGE_COMPRESSOR = "GAUGE_COMPRESSOR";
|
|
364493
364637
|
var AP_GEAR_STAKING = "GEAR_STAKING";
|
|
364494
364638
|
var AP_GEAR_TOKEN = "GEAR_TOKEN";
|
|
364495
364639
|
var AP_MARKET_COMPRESSOR = "MARKET_COMPRESSOR";
|
|
@@ -375173,6 +375317,7 @@ var MarketRegister = class extends SDKConstruct {
|
|
|
375173
375317
|
*/
|
|
375174
375318
|
#markets = new AddressMap();
|
|
375175
375319
|
#zappers = [];
|
|
375320
|
+
#marketFilter;
|
|
375176
375321
|
constructor(sdk, markets) {
|
|
375177
375322
|
super(sdk);
|
|
375178
375323
|
this.#logger = childLogger("MarketRegister", sdk.logger);
|
|
@@ -375214,6 +375359,32 @@ var MarketRegister = class extends SDKConstruct {
|
|
|
375214
375359
|
this.sdk.provider.addressLabels.set(t.addr, t.symbol);
|
|
375215
375360
|
}
|
|
375216
375361
|
}
|
|
375362
|
+
async getGauges(staker) {
|
|
375363
|
+
const gcAddr = this.sdk.addressProvider.getLatestVersion(AP_GAUGE_COMPRESSOR);
|
|
375364
|
+
if (!this.#marketFilter) {
|
|
375365
|
+
throw new Error("market filter is not set");
|
|
375366
|
+
}
|
|
375367
|
+
const resp = await this.provider.publicClient.readContract({
|
|
375368
|
+
abi: iGaugeCompressorAbi,
|
|
375369
|
+
address: gcAddr,
|
|
375370
|
+
functionName: "getGauges",
|
|
375371
|
+
args: [this.#marketFilter, staker]
|
|
375372
|
+
});
|
|
375373
|
+
return [...resp];
|
|
375374
|
+
}
|
|
375375
|
+
async getGauge(gauge, staker) {
|
|
375376
|
+
const gcAddr = this.sdk.addressProvider.getLatestVersion(AP_GAUGE_COMPRESSOR);
|
|
375377
|
+
if (!this.#marketFilter) {
|
|
375378
|
+
throw new Error("market filter is not set");
|
|
375379
|
+
}
|
|
375380
|
+
const resp = await this.provider.publicClient.readContract({
|
|
375381
|
+
abi: iGaugeCompressorAbi,
|
|
375382
|
+
address: gcAddr,
|
|
375383
|
+
functionName: "getGauge",
|
|
375384
|
+
args: [gauge, staker]
|
|
375385
|
+
});
|
|
375386
|
+
return resp;
|
|
375387
|
+
}
|
|
375217
375388
|
async syncState() {
|
|
375218
375389
|
const pools = this.markets.filter((m) => m.dirty).map((m) => m.pool.pool.address);
|
|
375219
375390
|
if (pools.length) {
|
|
@@ -375222,6 +375393,11 @@ var MarketRegister = class extends SDKConstruct {
|
|
|
375222
375393
|
}
|
|
375223
375394
|
}
|
|
375224
375395
|
async #loadMarkets(configurators, pools, ignoreUpdateablePrices) {
|
|
375396
|
+
this.#marketFilter = {
|
|
375397
|
+
configurators,
|
|
375398
|
+
pools,
|
|
375399
|
+
underlying: ADDRESS_0X0
|
|
375400
|
+
};
|
|
375225
375401
|
const marketCompressorAddress = this.sdk.addressProvider.getAddress(
|
|
375226
375402
|
AP_MARKET_COMPRESSOR,
|
|
375227
375403
|
310
|
|
@@ -375239,28 +375415,34 @@ var MarketRegister = class extends SDKConstruct {
|
|
|
375239
375415
|
{ configurators, pools },
|
|
375240
375416
|
`calling getMarkets with ${txs.length} price updates`
|
|
375241
375417
|
);
|
|
375242
|
-
|
|
375243
|
-
|
|
375244
|
-
|
|
375245
|
-
|
|
375246
|
-
|
|
375247
|
-
|
|
375248
|
-
|
|
375249
|
-
|
|
375250
|
-
|
|
375251
|
-
|
|
375252
|
-
|
|
375253
|
-
|
|
375254
|
-
|
|
375255
|
-
|
|
375256
|
-
|
|
375257
|
-
|
|
375258
|
-
|
|
375259
|
-
|
|
375260
|
-
|
|
375261
|
-
|
|
375262
|
-
|
|
375263
|
-
|
|
375418
|
+
let markets = [];
|
|
375419
|
+
if (txs.length) {
|
|
375420
|
+
const resp = await simulateMulticall(this.provider.publicClient, {
|
|
375421
|
+
contracts: [
|
|
375422
|
+
...txs.map(rawTxToMulticallPriceUpdate),
|
|
375423
|
+
{
|
|
375424
|
+
abi: iMarketCompressorAbi,
|
|
375425
|
+
address: marketCompressorAddress,
|
|
375426
|
+
functionName: "getMarkets",
|
|
375427
|
+
args: [this.#marketFilter]
|
|
375428
|
+
}
|
|
375429
|
+
],
|
|
375430
|
+
allowFailure: false,
|
|
375431
|
+
gas: 550000000n,
|
|
375432
|
+
batchSize: 0
|
|
375433
|
+
// we cannot have price updates and compressor request in different batches
|
|
375434
|
+
});
|
|
375435
|
+
markets = resp.pop();
|
|
375436
|
+
} else {
|
|
375437
|
+
markets = await this.provider.publicClient.readContract({
|
|
375438
|
+
abi: iMarketCompressorAbi,
|
|
375439
|
+
address: marketCompressorAddress,
|
|
375440
|
+
functionName: "getMarkets",
|
|
375441
|
+
args: [this.#marketFilter],
|
|
375442
|
+
// @ts-ignore
|
|
375443
|
+
gas: 550000000n
|
|
375444
|
+
});
|
|
375445
|
+
}
|
|
375264
375446
|
for (const data of markets) {
|
|
375265
375447
|
this.#markets.upsert(
|
|
375266
375448
|
data.pool.baseParams.addr,
|
|
@@ -375947,6 +376129,15 @@ var CreditAccountsService = class extends SDKConstruct {
|
|
|
375947
376129
|
});
|
|
375948
376130
|
return [...rewards];
|
|
375949
376131
|
}
|
|
376132
|
+
async getActiveBots(marketConfigurator, account) {
|
|
376133
|
+
const botsData = await this.provider.publicClient.readContract({
|
|
376134
|
+
abi: iPeripheryCompressorAbi,
|
|
376135
|
+
address: this.peripheryCompressor,
|
|
376136
|
+
functionName: "getActiveBots",
|
|
376137
|
+
args: [marketConfigurator, account]
|
|
376138
|
+
});
|
|
376139
|
+
return [...botsData];
|
|
376140
|
+
}
|
|
375950
376141
|
/**
|
|
375951
376142
|
* Generates transaction to liquidate credit account
|
|
375952
376143
|
* @param account
|
|
@@ -376536,6 +376727,9 @@ var CreditAccountsService = class extends SDKConstruct {
|
|
|
376536
376727
|
get rewardCompressor() {
|
|
376537
376728
|
return this.sdk.addressProvider.getLatestVersion(AP_REWARDS_COMPRESSOR);
|
|
376538
376729
|
}
|
|
376730
|
+
get peripheryCompressor() {
|
|
376731
|
+
return this.sdk.addressProvider.getLatestVersion(AP_PERIPHERY_COMPRESSOR);
|
|
376732
|
+
}
|
|
376539
376733
|
};
|
|
376540
376734
|
var AbstractAddressProviderContract = class extends BaseContract {
|
|
376541
376735
|
#addresses = {};
|
|
@@ -409418,7 +409612,7 @@ function getRenderer(opts) {
|
|
|
409418
409612
|
var package_default = {
|
|
409419
409613
|
name: "@gearbox-protocol/deploy-tools",
|
|
409420
409614
|
description: "Gearbox deploy tools",
|
|
409421
|
-
version: "5.9.
|
|
409615
|
+
version: "5.9.10",
|
|
409422
409616
|
homepage: "https://gearbox.fi",
|
|
409423
409617
|
keywords: [
|
|
409424
409618
|
"gearbox"
|
|
@@ -409461,7 +409655,7 @@ var package_default = {
|
|
|
409461
409655
|
"@gearbox-protocol/deploy-tools-node": "0.0.0",
|
|
409462
409656
|
"@gearbox-protocol/deploy-tools-shared": "0.0.0",
|
|
409463
409657
|
"@gearbox-protocol/deploy-tools-types": "0.0.0",
|
|
409464
|
-
"@gearbox-protocol/sdk": "3.0.0-vfour.
|
|
409658
|
+
"@gearbox-protocol/sdk": "3.0.0-vfour.213",
|
|
409465
409659
|
"@gearbox-protocol/sdk-gov": "^2.34.0",
|
|
409466
409660
|
"@types/lodash-es": "^4.17.12",
|
|
409467
409661
|
"@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.10",
|
|
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.213",
|
|
48
48
|
"@gearbox-protocol/sdk-gov": "^2.34.0",
|
|
49
49
|
"@types/lodash-es": "^4.17.12",
|
|
50
50
|
"@types/node": "^22.12.0",
|