@gearbox-protocol/deploy-tools 6.5.7 → 6.5.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.
Files changed (2) hide show
  1. package/dist/index.mjs +23 -35
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -136346,34 +136346,8 @@ function getRPCUrls(opts) {
136346
136346
 
136347
136347
  // src/commands/new-command.ts
136348
136348
  function newCommand() {
136349
- return new Command().addOption(
136350
- new Option(
136351
- "--cache-policy <policy>",
136352
- "never use cache or use cache only"
136353
- ).choices(["never", "only"])
136354
- ).addOption(
136355
- new Option(
136356
- "--sandbox-dir <dir>",
136357
- "directory for intermediate results and cache"
136358
- ).default("./sandbox")
136359
- ).addOption(new Option("--log-level <info>", "log level")).addOption(
136349
+ return new Command().addOption(new Option("--log-level <info>", "log level")).addOption(
136360
136350
  new Option("--out-file <json>", "save output as json").env("OUT_FILE")
136361
- ).addOption(
136362
- new Option("--pretty", "pretty-print output event when saving to json")
136363
- ).addOption(
136364
- new Option("--etherscan-api-key <key>", "etherscan api key").env(
136365
- "ETHERSCAN_API_KEY"
136366
- )
136367
- ).addOption(
136368
- new Option(
136369
- "--governance-json <file>",
136370
- "file with addresses for governance contract overrides"
136371
- )
136372
- ).addOption(
136373
- new Option(
136374
- "--address-provider-json <file>",
136375
- "file with address provider address override"
136376
- )
136377
136351
  ).addOption(
136378
136352
  new Option("--address-provider <address>", "new address provider address").argParser(parseAddress).env("ADDRESS_PROVIDER")
136379
136353
  ).addOption(
@@ -136381,10 +136355,6 @@ function newCommand() {
136381
136355
  "--market-configurators <comma-separated-addresses>",
136382
136356
  "Market configurators addresses to use in sdk"
136383
136357
  ).argParser(parseAddressList).env("MARKET_CONFIGURATORS")
136384
- ).addOption(
136385
- new Option("--safe-api <api>", "Which safe api to use").choices(["classic", "fallback", "alternative"]).env("SAFE_API")
136386
- ).addOption(
136387
- new Option("--safe-api-key <key>", "Safe api key").env("SAFE_API_KEY")
136388
136358
  ).addOption(new Option("--rpc-url <url>", "rpc url").env("RPC_URL")).addOption(
136389
136359
  new Option("--anvil-url <url>", "anvil rpc url").env("ANVIL_URL")
136390
136360
  ).addOption(
@@ -136394,14 +136364,20 @@ function newCommand() {
136394
136364
 
136395
136365
  // src/commands/zero-lt.ts
136396
136366
  function zeroLt() {
136397
- return newCommand().name("zero-lt").description("Sets LT to zero for all markets").action(async (opts) => {
136398
- console.info("starting state snapshot script");
136367
+ return newCommand().name("zero-lt").description("Sets LT to zero for all markets").addOption(
136368
+ new Option(
136369
+ "--credit-manager <address>",
136370
+ "only set LT for this credit manager"
136371
+ ).argParser(parseAddress).env("CREDIT_MANAGER")
136372
+ ).action(async (opts) => {
136373
+ console.info("starting zero-lt script");
136399
136374
  const {
136400
136375
  addressProvider,
136401
- marketConfigurators,
136402
136376
  networkType,
136403
- anvilUrl = "http://127.0.0.1:8545"
136377
+ anvilUrl = "http://127.0.0.1:8545",
136378
+ creditManager
136404
136379
  } = opts;
136380
+ const marketConfigurators = opts.marketConfigurators?.length ? opts.marketConfigurators : void 0;
136405
136381
  const rpcURLs = getRPCUrls({ ...opts, anvilUrl });
136406
136382
  const rpcUrl = rpcURLs[0];
136407
136383
  if (!rpcUrl) {
@@ -136426,6 +136402,18 @@ function zeroLt() {
136426
136402
  chain: sdk.chain,
136427
136403
  transport: http(rpcUrl, { timeout: 24e4 })
136428
136404
  });
136405
+ if (creditManager) {
136406
+ const cm = sdk.marketRegister.findCreditManager(creditManager);
136407
+ try {
136408
+ await setLTZero(anvil, cm.state, console);
136409
+ console.info("done");
136410
+ } catch (e) {
136411
+ console.error(
136412
+ `error setting LT to zero for ${cm.name} (${cm.creditManager.address}): ${e}`
136413
+ );
136414
+ }
136415
+ return;
136416
+ }
136429
136417
  for (const m of sdk.marketRegister.markets) {
136430
136418
  for (const cm of m.creditManagers) {
136431
136419
  if (cm.isExpired) {
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": "6.5.7",
4
+ "version": "6.5.8",
5
5
  "homepage": "https://gearbox.fi",
6
6
  "keywords": [
7
7
  "gearbox"