@gearbox-protocol/deploy-tools 5.25.3 → 5.26.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/index.mjs +118 -30
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -164936,7 +164936,7 @@ var require_request = __commonJS({
|
|
|
164936
164936
|
}
|
|
164937
164937
|
};
|
|
164938
164938
|
exports2.HttpRequestError = HttpRequestError2;
|
|
164939
|
-
var
|
|
164939
|
+
var WebSocketRequestError2 = class extends base_js_1.BaseError {
|
|
164940
164940
|
constructor({ body, cause, details, url }) {
|
|
164941
164941
|
super("WebSocket request failed.", {
|
|
164942
164942
|
cause,
|
|
@@ -164949,7 +164949,7 @@ var require_request = __commonJS({
|
|
|
164949
164949
|
});
|
|
164950
164950
|
}
|
|
164951
164951
|
};
|
|
164952
|
-
exports2.WebSocketRequestError =
|
|
164952
|
+
exports2.WebSocketRequestError = WebSocketRequestError2;
|
|
164953
164953
|
var RpcRequestError2 = class extends base_js_1.BaseError {
|
|
164954
164954
|
constructor({ body, error, url }) {
|
|
164955
164955
|
super("RPC Request failed.", {
|
|
@@ -164975,7 +164975,7 @@ var require_request = __commonJS({
|
|
|
164975
164975
|
}
|
|
164976
164976
|
};
|
|
164977
164977
|
exports2.RpcRequestError = RpcRequestError2;
|
|
164978
|
-
var
|
|
164978
|
+
var SocketClosedError2 = class extends base_js_1.BaseError {
|
|
164979
164979
|
constructor({ url } = {}) {
|
|
164980
164980
|
super("The socket has been closed.", {
|
|
164981
164981
|
metaMessages: [url && `URL: ${(0, utils_js_1.getUrl)(url)}`].filter(Boolean),
|
|
@@ -164983,7 +164983,7 @@ var require_request = __commonJS({
|
|
|
164983
164983
|
});
|
|
164984
164984
|
}
|
|
164985
164985
|
};
|
|
164986
|
-
exports2.SocketClosedError =
|
|
164986
|
+
exports2.SocketClosedError = SocketClosedError2;
|
|
164987
164987
|
var TimeoutError2 = class extends base_js_1.BaseError {
|
|
164988
164988
|
constructor({ body, url }) {
|
|
164989
164989
|
super("The request took too long to respond.", {
|
|
@@ -360228,6 +360228,7 @@ init_abis();
|
|
|
360228
360228
|
init_abi();
|
|
360229
360229
|
init_base();
|
|
360230
360230
|
init_contract();
|
|
360231
|
+
init_request();
|
|
360231
360232
|
init_decodeAbiParameters();
|
|
360232
360233
|
init_decodeFunctionData();
|
|
360233
360234
|
init_decodeFunctionResult();
|
|
@@ -376680,7 +376681,9 @@ var chains = {
|
|
|
376680
376681
|
{
|
|
376681
376682
|
...bsc,
|
|
376682
376683
|
network: "BNB",
|
|
376683
|
-
defaultMarketConfigurators: {
|
|
376684
|
+
defaultMarketConfigurators: {
|
|
376685
|
+
"0xc94add35a09a239d0f5d1c04e793459dd19a0793": "Chaos Labs"
|
|
376686
|
+
},
|
|
376684
376687
|
isPublic: false,
|
|
376685
376688
|
wellKnownToken: {
|
|
376686
376689
|
address: "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d",
|
|
@@ -392465,6 +392468,65 @@ function generateCastTraceCall(params) {
|
|
|
392465
392468
|
// ../../node_modules/viem/_esm/actions/index.js
|
|
392466
392469
|
init_call();
|
|
392467
392470
|
|
|
392471
|
+
// ../../node_modules/@gearbox-protocol/sdk/dist/esm/sdk/utils/viem/getLogsSafe.js
|
|
392472
|
+
async function getLogsSafe(client, params = {}) {
|
|
392473
|
+
try {
|
|
392474
|
+
const events = await getLogs(client, params);
|
|
392475
|
+
return events;
|
|
392476
|
+
} catch (e) {
|
|
392477
|
+
const fromBlock = params.fromBlock;
|
|
392478
|
+
const toBlock = params.toBlock;
|
|
392479
|
+
const bisected = tryBisectBlockRange({ fromBlock, toBlock }, e);
|
|
392480
|
+
if (!bisected) {
|
|
392481
|
+
throw e;
|
|
392482
|
+
}
|
|
392483
|
+
const [left, right] = await Promise.all([
|
|
392484
|
+
getLogsSafe(client, { ...params, ...bisected[0] }),
|
|
392485
|
+
getLogsSafe(client, { ...params, ...bisected[1] })
|
|
392486
|
+
]);
|
|
392487
|
+
return [...left, ...right];
|
|
392488
|
+
}
|
|
392489
|
+
}
|
|
392490
|
+
function tryBisectBlockRange({ fromBlock, toBlock }, e) {
|
|
392491
|
+
const alchemyMid = checkForAlchemyBlockRange(e);
|
|
392492
|
+
if (alchemyMid && alchemyMid > fromBlock && alchemyMid < toBlock) {
|
|
392493
|
+
return [
|
|
392494
|
+
{ fromBlock, toBlock: alchemyMid },
|
|
392495
|
+
{ fromBlock: alchemyMid + 1n, toBlock }
|
|
392496
|
+
];
|
|
392497
|
+
}
|
|
392498
|
+
const blockRangeErrors = [
|
|
392499
|
+
"query exceeds max block",
|
|
392500
|
+
"range is too large",
|
|
392501
|
+
"eth_getLogs is limited to",
|
|
392502
|
+
"eth_getLogs requests with up to"
|
|
392503
|
+
];
|
|
392504
|
+
if (e instanceof Error && blockRangeErrors.some((errorText) => e.message.includes(errorText))) {
|
|
392505
|
+
const middle = (fromBlock + toBlock) / 2n;
|
|
392506
|
+
return [
|
|
392507
|
+
{ fromBlock, toBlock: middle },
|
|
392508
|
+
{ fromBlock: middle + 1n, toBlock }
|
|
392509
|
+
];
|
|
392510
|
+
}
|
|
392511
|
+
return void 0;
|
|
392512
|
+
}
|
|
392513
|
+
var ALCHEMY_BLOCK_RANGE_REGEX = /this block range should work: \[(0x[0-9a-fA-F]+),\s*(0x[0-9a-fA-F]+)\]/;
|
|
392514
|
+
function checkForAlchemyBlockRange(e) {
|
|
392515
|
+
if (e instanceof HttpRequestError) {
|
|
392516
|
+
try {
|
|
392517
|
+
const err = JSON.parse(e.details);
|
|
392518
|
+
if (typeof err.message === "string") {
|
|
392519
|
+
const match2 = err.message.match(ALCHEMY_BLOCK_RANGE_REGEX);
|
|
392520
|
+
if (match2) {
|
|
392521
|
+
return BigInt(match2[2]);
|
|
392522
|
+
}
|
|
392523
|
+
}
|
|
392524
|
+
} catch {
|
|
392525
|
+
}
|
|
392526
|
+
}
|
|
392527
|
+
return void 0;
|
|
392528
|
+
}
|
|
392529
|
+
|
|
392468
392530
|
// ../../node_modules/@gearbox-protocol/sdk/dist/esm/sdk/utils/viem/sendRawTx.js
|
|
392469
392531
|
async function sendRawTx(client, params) {
|
|
392470
392532
|
const { account, tx } = params;
|
|
@@ -394142,7 +394204,7 @@ var AddressProviderContractV3 = class extends AbstractAddressProviderContract {
|
|
|
394142
394204
|
this.logger?.debug(
|
|
394143
394205
|
`loading events from block ${fromBlock} to ${blockNumber}`
|
|
394144
394206
|
);
|
|
394145
|
-
const events = await this.sdk.provider.publicClient
|
|
394207
|
+
const events = await getLogsSafe(this.sdk.provider.publicClient, {
|
|
394146
394208
|
address: this.address,
|
|
394147
394209
|
event: getAbiItem({ abi: this.abi, name: "SetAddress" }),
|
|
394148
394210
|
fromBlock,
|
|
@@ -400848,6 +400910,17 @@ var PriceOracleBaseContract = class extends BaseContract {
|
|
|
400848
400910
|
const scale = 10n ** BigInt(this.sdk.tokensMeta.decimals(from5));
|
|
400849
400911
|
return amount * price / scale;
|
|
400850
400912
|
}
|
|
400913
|
+
/**
|
|
400914
|
+
* Tries to convert amount of USD to token, using latest known prices
|
|
400915
|
+
* @param to
|
|
400916
|
+
* @param amount
|
|
400917
|
+
* @param reserve
|
|
400918
|
+
*/
|
|
400919
|
+
convertFromUSD(to, amount, reserve = false) {
|
|
400920
|
+
const price = reserve ? this.reservePrice(to) : this.mainPrice(to);
|
|
400921
|
+
const scale = 10n ** BigInt(this.sdk.tokensMeta.decimals(to));
|
|
400922
|
+
return amount * scale / price;
|
|
400923
|
+
}
|
|
400851
400924
|
/**
|
|
400852
400925
|
* Loads new prices for this oracle from PriceFeedCompressor
|
|
400853
400926
|
* Does not update price feeds, only updates prices
|
|
@@ -402049,7 +402122,7 @@ var V300StalenessPeriodPlugin = class extends SDKConstruct {
|
|
|
402049
402122
|
if (addresses.length === 0 || fromBlock > toBlock) {
|
|
402050
402123
|
return;
|
|
402051
402124
|
}
|
|
402052
|
-
const events = await this.client
|
|
402125
|
+
const events = await getLogsSafe(this.client, {
|
|
402053
402126
|
address: addresses,
|
|
402054
402127
|
events: [
|
|
402055
402128
|
getAbiItem({
|
|
@@ -402414,7 +402487,7 @@ var GearboxSDK = class _GearboxSDK {
|
|
|
402414
402487
|
this.logger?.debug(
|
|
402415
402488
|
`getting logs from ${watchAddresses.length} addresses in [${this.currentBlock}:${blockNumber}]`
|
|
402416
402489
|
);
|
|
402417
|
-
const logs = await this.provider.publicClient
|
|
402490
|
+
const logs = await getLogsSafe(this.provider.publicClient, {
|
|
402418
402491
|
fromBlock: this.currentBlock,
|
|
402419
402492
|
toBlock: blockNumber,
|
|
402420
402493
|
address: watchAddresses
|
|
@@ -423377,6 +423450,9 @@ var TaskDefinition = z.object({
|
|
|
423377
423450
|
*/
|
|
423378
423451
|
schemaVersion: z.number().int().optional()
|
|
423379
423452
|
});
|
|
423453
|
+
var TaskDefinitionOverride = TaskDefinition.extend({
|
|
423454
|
+
image: z.string().optional()
|
|
423455
|
+
});
|
|
423380
423456
|
|
|
423381
423457
|
// ../../packages/shared/dist/utilityContracts.js
|
|
423382
423458
|
var ADDRESS_PROVIDER2 = {
|
|
@@ -424340,28 +424416,40 @@ async function detectChain(transportOrRPC) {
|
|
|
424340
424416
|
}
|
|
424341
424417
|
|
|
424342
424418
|
// ../../node_modules/@gearbox-protocol/sdk/dist/esm/dev/migrateFaucet.js
|
|
424343
|
-
async function unsafeMigrateFaucet(sdk) {
|
|
424419
|
+
async function unsafeMigrateFaucet(sdk, faucet) {
|
|
424344
424420
|
const anvil = createAnvilClient({
|
|
424345
424421
|
chain: sdk.provider.chain,
|
|
424346
424422
|
transport: sdk.provider.transport
|
|
424347
424423
|
});
|
|
424348
|
-
|
|
424349
|
-
|
|
424350
|
-
|
|
424351
|
-
|
|
424352
|
-
|
|
424353
|
-
|
|
424354
|
-
|
|
424355
|
-
|
|
424356
|
-
|
|
424357
|
-
|
|
424358
|
-
|
|
424359
|
-
|
|
424360
|
-
|
|
424361
|
-
|
|
424362
|
-
|
|
424363
|
-
|
|
424364
|
-
|
|
424424
|
+
let faucetAddr;
|
|
424425
|
+
let owner;
|
|
424426
|
+
if (faucet) {
|
|
424427
|
+
faucetAddr = faucet;
|
|
424428
|
+
owner = await anvil.readContract({
|
|
424429
|
+
abi: iAddressProviderV310Abi,
|
|
424430
|
+
address: sdk.addressProvider.address,
|
|
424431
|
+
functionName: "owner",
|
|
424432
|
+
args: []
|
|
424433
|
+
});
|
|
424434
|
+
} else {
|
|
424435
|
+
[faucetAddr, owner] = await anvil.multicall({
|
|
424436
|
+
contracts: [
|
|
424437
|
+
{
|
|
424438
|
+
abi: iAddressProviderV300Abi,
|
|
424439
|
+
address: ADDRESS_PROVIDER[sdk.provider.networkType],
|
|
424440
|
+
functionName: "getAddressOrRevert",
|
|
424441
|
+
args: [stringToHex("FAUCET", { size: 32 }), 0n]
|
|
424442
|
+
},
|
|
424443
|
+
{
|
|
424444
|
+
abi: iAddressProviderV310Abi,
|
|
424445
|
+
address: sdk.addressProvider.address,
|
|
424446
|
+
functionName: "owner",
|
|
424447
|
+
args: []
|
|
424448
|
+
}
|
|
424449
|
+
],
|
|
424450
|
+
allowFailure: false
|
|
424451
|
+
});
|
|
424452
|
+
}
|
|
424365
424453
|
sdk.logger?.debug(`faucet address: ${faucetAddr}, owner: ${owner}`);
|
|
424366
424454
|
await anvil.impersonateAccount({ address: owner });
|
|
424367
424455
|
await anvil.setBalance({
|
|
@@ -424394,9 +424482,9 @@ async function unsafeMigrateFaucet(sdk) {
|
|
|
424394
424482
|
throw new Error("faucet migration reverted");
|
|
424395
424483
|
}
|
|
424396
424484
|
}
|
|
424397
|
-
async function migrateFaucet(sdk) {
|
|
424485
|
+
async function migrateFaucet(sdk, faucet) {
|
|
424398
424486
|
try {
|
|
424399
|
-
await unsafeMigrateFaucet(sdk);
|
|
424487
|
+
await unsafeMigrateFaucet(sdk, faucet);
|
|
424400
424488
|
sdk.logger?.info("faucet migrated successfully");
|
|
424401
424489
|
} catch (e) {
|
|
424402
424490
|
sdk.logger?.error(`faucet migration failed: ${e}`);
|
|
@@ -431833,7 +431921,7 @@ function getRenderer(opts) {
|
|
|
431833
431921
|
var package_default = {
|
|
431834
431922
|
name: "@gearbox-protocol/deploy-tools",
|
|
431835
431923
|
description: "Gearbox deploy tools",
|
|
431836
|
-
version: "5.
|
|
431924
|
+
version: "5.26.0",
|
|
431837
431925
|
homepage: "https://gearbox.fi",
|
|
431838
431926
|
keywords: [
|
|
431839
431927
|
"gearbox"
|
|
@@ -431876,7 +431964,7 @@ var package_default = {
|
|
|
431876
431964
|
"@gearbox-protocol/deploy-tools-node": "0.0.0",
|
|
431877
431965
|
"@gearbox-protocol/deploy-tools-shared": "0.0.0",
|
|
431878
431966
|
"@gearbox-protocol/deploy-tools-types": "0.0.0",
|
|
431879
|
-
"@gearbox-protocol/sdk": "^3.
|
|
431967
|
+
"@gearbox-protocol/sdk": "^3.1.2",
|
|
431880
431968
|
"@gearbox-protocol/sdk-gov": "^2.37.0",
|
|
431881
431969
|
"@types/lodash-es": "^4.17.12",
|
|
431882
431970
|
"@types/node": "^22.14.1",
|
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.
|
|
4
|
+
"version": "5.26.0",
|
|
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.
|
|
47
|
+
"@gearbox-protocol/sdk": "^3.1.2",
|
|
48
48
|
"@gearbox-protocol/sdk-gov": "^2.37.0",
|
|
49
49
|
"@types/lodash-es": "^4.17.12",
|
|
50
50
|
"@types/node": "^22.14.1",
|