@gearbox-protocol/deploy-tools 5.11.10 → 5.11.12
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 +22 -41
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -407458,30 +407458,15 @@ var SDKExample = class {
|
|
|
407458
407458
|
timeout: 48e4,
|
|
407459
407459
|
addressProvider,
|
|
407460
407460
|
logger: this.#logger,
|
|
407461
|
-
ignoreUpdateablePrices:
|
|
407461
|
+
ignoreUpdateablePrices: false,
|
|
407462
407462
|
marketConfigurators
|
|
407463
407463
|
});
|
|
407464
|
+
this.#logger?.info("attached sdk");
|
|
407464
407465
|
try {
|
|
407465
407466
|
await this.#sdk.marketRegister.loadZappers();
|
|
407466
407467
|
} catch (e) {
|
|
407467
407468
|
this.#logger?.error(`failed to load zappers: ${e}`);
|
|
407468
407469
|
}
|
|
407469
|
-
await this.#safeMigrateFaucet(addressProvider);
|
|
407470
|
-
const puTx = await this.#sdk.priceFeeds.getUpdatePriceFeedsTx(marketConfigurators);
|
|
407471
|
-
const updater = createWalletClient({
|
|
407472
|
-
account: privateKeyToAccount(
|
|
407473
|
-
"0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
|
|
407474
|
-
// well-known anvil private key
|
|
407475
|
-
),
|
|
407476
|
-
transport: http(anvilUrl)
|
|
407477
|
-
});
|
|
407478
|
-
const publicClient = createPublicClient({
|
|
407479
|
-
transport: http(anvilUrl)
|
|
407480
|
-
});
|
|
407481
|
-
const hash2 = await sendRawTx(updater, { tx: puTx });
|
|
407482
|
-
await publicClient.waitForTransactionReceipt({ hash: hash2 });
|
|
407483
|
-
await this.#sdk.marketRegister.loadMarkets(marketConfigurators, true);
|
|
407484
|
-
this.#logger?.info("attached sdk");
|
|
407485
407470
|
await Promise.allSettled(
|
|
407486
407471
|
this.#sdk.marketRegister.marketConfigurators.map(
|
|
407487
407472
|
(m) => m.loadCuratorName()
|
|
@@ -407500,6 +407485,14 @@ var SDKExample = class {
|
|
|
407500
407485
|
}
|
|
407501
407486
|
}
|
|
407502
407487
|
}
|
|
407488
|
+
async migrateFaucet(addressProvider) {
|
|
407489
|
+
try {
|
|
407490
|
+
await this.#migrateFaucet(addressProvider);
|
|
407491
|
+
this.#logger?.info("faucet migrated successfully");
|
|
407492
|
+
} catch (e) {
|
|
407493
|
+
this.#logger?.error(`faucet migration failed: ${e}`);
|
|
407494
|
+
}
|
|
407495
|
+
}
|
|
407503
407496
|
async #readConfigAddress(name, value, file) {
|
|
407504
407497
|
let result = value;
|
|
407505
407498
|
if (!result) {
|
|
@@ -407519,14 +407512,6 @@ var SDKExample = class {
|
|
|
407519
407512
|
this.#logger?.info(`using ${name} ${result}`);
|
|
407520
407513
|
return result;
|
|
407521
407514
|
}
|
|
407522
|
-
async #safeMigrateFaucet(addressProvider) {
|
|
407523
|
-
try {
|
|
407524
|
-
await this.#migrateFaucet(addressProvider);
|
|
407525
|
-
this.#logger?.info("faucet migrated successfully");
|
|
407526
|
-
} catch (e) {
|
|
407527
|
-
this.#logger?.error(`faucet migration failed: ${e}`);
|
|
407528
|
-
}
|
|
407529
|
-
}
|
|
407530
407515
|
/**
|
|
407531
407516
|
* Migrates faucet from address provider v3 to v3.1
|
|
407532
407517
|
* @param addressProvider 3.1 address provider
|
|
@@ -414010,10 +413995,7 @@ import { mkdir as mkdir2, writeFile as writeFile6 } from "node:fs/promises";
|
|
|
414010
413995
|
import path9 from "node:path";
|
|
414011
413996
|
function openAccounts() {
|
|
414012
413997
|
return newCommand().name("open-accounts").description("Script to open accounts in v3.1").addOption(
|
|
414013
|
-
new Option(
|
|
414014
|
-
"--address-provider <address>",
|
|
414015
|
-
"new address provider address"
|
|
414016
|
-
).env("ADDRESS_PROVIDER")
|
|
413998
|
+
new Option("--address-provider <address>", "new address provider address").env("ADDRESS_PROVIDER").makeOptionMandatory(true)
|
|
414017
413999
|
).addOption(
|
|
414018
414000
|
new Option("--cast-bin <path>", "cast binary path").env("CAST_BIN")
|
|
414019
414001
|
).addOption(
|
|
@@ -414028,26 +414010,17 @@ function openAccounts() {
|
|
|
414028
414010
|
log_default.info("starting sdk v3.1 example");
|
|
414029
414011
|
let {
|
|
414030
414012
|
addressProvider,
|
|
414031
|
-
addressProviderJson,
|
|
414032
414013
|
marketConfigurators,
|
|
414033
414014
|
anvilUrl = "http://127.0.0.1:8545",
|
|
414034
414015
|
sharedDir = ".",
|
|
414035
414016
|
nexo,
|
|
414036
414017
|
castBin = "cast",
|
|
414037
|
-
automine: automineIntervalS = "
|
|
414018
|
+
automine: automineIntervalS = "0"
|
|
414038
414019
|
} = opts;
|
|
414039
414020
|
await mkdir2(path9.resolve(sharedDir, "deploy-state"), { recursive: true });
|
|
414040
|
-
const anvil = createAnvilClient({ transport: http(anvilUrl) });
|
|
414041
|
-
const automineInterval = parseInt(automineIntervalS, 10);
|
|
414042
|
-
const automine = await anvil.getAutomine();
|
|
414043
|
-
await anvil.setBlockTimestampInterval({ interval: automineInterval });
|
|
414044
|
-
log_default.debug(
|
|
414045
|
-
`setting block timestamp interval, automine: ${automine}, interval ${automineInterval}`
|
|
414046
|
-
);
|
|
414047
414021
|
const sdkExample2 = new SDKExample(log_default);
|
|
414048
414022
|
await sdkExample2.run({
|
|
414049
414023
|
addressProvider,
|
|
414050
|
-
addressProviderJson,
|
|
414051
414024
|
marketConfigurators: marketConfigurators ?? [],
|
|
414052
414025
|
anvilUrl,
|
|
414053
414026
|
outFile: path9.resolve(
|
|
@@ -414061,6 +414034,7 @@ function openAccounts() {
|
|
|
414061
414034
|
json_stringify(sdkExample2.sdk.state),
|
|
414062
414035
|
"utf-8"
|
|
414063
414036
|
);
|
|
414037
|
+
await sdkExample2.migrateFaucet(addressProvider);
|
|
414064
414038
|
const faucetAddr = await sdkExample2.sdk.provider.publicClient.readContract({
|
|
414065
414039
|
address: ADDRESS_PROVIDER[sdkExample2.sdk.provider.networkType],
|
|
414066
414040
|
abi: iAddressProviderV310Abi,
|
|
@@ -414068,6 +414042,13 @@ function openAccounts() {
|
|
|
414068
414042
|
args: [stringToHex("FAUCET", { size: 32 }), 0n]
|
|
414069
414043
|
});
|
|
414070
414044
|
log_default.debug(`faucet address: ${faucetAddr}`);
|
|
414045
|
+
const anvil = createAnvilClient({ transport: http(anvilUrl) });
|
|
414046
|
+
const automineInterval = parseInt(automineIntervalS, 10);
|
|
414047
|
+
const automine = await anvil.getAutomine();
|
|
414048
|
+
await anvil.setBlockTimestampInterval({ interval: automineInterval });
|
|
414049
|
+
log_default.debug(
|
|
414050
|
+
`setting block timestamp interval, automine: ${automine}, interval ${automineInterval}`
|
|
414051
|
+
);
|
|
414071
414052
|
const borrowerKey = generatePrivateKey();
|
|
414072
414053
|
const borrower = privateKeyToAccount(borrowerKey);
|
|
414073
414054
|
await anvil.setBalance({
|
|
@@ -414242,7 +414223,7 @@ function getRenderer(opts) {
|
|
|
414242
414223
|
var package_default = {
|
|
414243
414224
|
name: "@gearbox-protocol/deploy-tools",
|
|
414244
414225
|
description: "Gearbox deploy tools",
|
|
414245
|
-
version: "5.11.
|
|
414226
|
+
version: "5.11.12",
|
|
414246
414227
|
homepage: "https://gearbox.fi",
|
|
414247
414228
|
keywords: [
|
|
414248
414229
|
"gearbox"
|
|
@@ -414285,7 +414266,7 @@ var package_default = {
|
|
|
414285
414266
|
"@gearbox-protocol/deploy-tools-node": "0.0.0",
|
|
414286
414267
|
"@gearbox-protocol/deploy-tools-shared": "0.0.0",
|
|
414287
414268
|
"@gearbox-protocol/deploy-tools-types": "0.0.0",
|
|
414288
|
-
"@gearbox-protocol/sdk": "3.0.0-vfour.
|
|
414269
|
+
"@gearbox-protocol/sdk": "3.0.0-vfour.248",
|
|
414289
414270
|
"@gearbox-protocol/sdk-gov": "^2.34.1",
|
|
414290
414271
|
"@types/lodash-es": "^4.17.12",
|
|
414291
414272
|
"@types/node": "^22.13.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.11.
|
|
4
|
+
"version": "5.11.12",
|
|
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.248",
|
|
48
48
|
"@gearbox-protocol/sdk-gov": "^2.34.1",
|
|
49
49
|
"@types/lodash-es": "^4.17.12",
|
|
50
50
|
"@types/node": "^22.13.1",
|