@gearbox-protocol/deploy-tools 5.10.6 → 5.10.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 +183 -44
  2. package/package.json +2 -2
package/dist/index.mjs CHANGED
@@ -372330,16 +372330,6 @@ var balancerLpTokens = {
372330
372330
  underlying: ["amphrETH", "rstETH", "wstETH", "Re7LRT", "steakLRT"],
372331
372331
  poolId: "0x4216d5900a6109bba48418b5e2ab6cc4e61cf4770000000000000000000006a1"
372332
372332
  },
372333
- DVstETH_wstETH_BPT: {
372334
- name: "Balancer DVstETH/wstETH ",
372335
- symbol: "DVstETH_wstETH_BPT",
372336
- type: {
372337
- AllNetworks: 10
372338
- /* BALANCER_LP_TOKEN */
372339
- },
372340
- underlying: ["DVstETH", "wstETH"],
372341
- poolId: "0x632aafc2d3d2ca1764e702aa25c065c273cd08ed0000000000000000000006d6"
372342
- },
372343
372333
  weETH_ezETH_rswETH: {
372344
372334
  name: "Balancer ezETH/weETH/rswETH",
372345
372335
  symbol: "weETH_ezETH_rswETH",
@@ -373749,7 +373739,6 @@ var decimals = {
373749
373739
  rETH_WETH_BPT_deprecated: 18,
373750
373740
  rETH_wETH_BPT: 18,
373751
373741
  trenSTETH: 18,
373752
- DVstETH_wstETH_BPT: 18,
373753
373742
  ezETH_WETH_BPT: 18,
373754
373743
  weETH_ezETH_rswETH: 18,
373755
373744
  "33AURA_33ARB_33BAL": 18,
@@ -373810,6 +373799,7 @@ var decimals = {
373810
373799
  sDAI: 18,
373811
373800
  sUSDe: 18,
373812
373801
  sUSDS: 18,
373802
+ waEthLidowstETH: 18,
373813
373803
  YieldETH: 18,
373814
373804
  scrvUSD: 18,
373815
373805
  tETH: 18,
@@ -373828,7 +373818,10 @@ var decimals = {
373828
373818
  PT_LBTC_27MAR2025: 8,
373829
373819
  PT_corn_eBTC_27MAR2025: 8,
373830
373820
  PT_sUSDe_27MAR2025: 18,
373831
- PT_sUSDe_29MAY2025: 18
373821
+ PT_sUSDe_29MAY2025: 18,
373822
+ PT_beraSTONE_10APR2025: 18,
373823
+ rstETH_Lido_wstETH: 18,
373824
+ DVstETH_Prime_wstETH: 18
373832
373825
  };
373833
373826
  var erc4626Tokens = {
373834
373827
  // YEARN TOKENS
@@ -374643,6 +374636,14 @@ var normalTokens = {
374643
374636
  /* NORMAL_TOKEN */
374644
374637
  }
374645
374638
  },
374639
+ waEthLidowstETH: {
374640
+ name: "Wrapped Aave Ethereum Lido wstETH",
374641
+ symbol: "waEthLidowstETH",
374642
+ type: {
374643
+ AllNetworks: 1
374644
+ /* NORMAL_TOKEN */
374645
+ }
374646
+ },
374646
374647
  PT_rsETH_26SEP2024: {
374647
374648
  name: "Pendle PT rsETH 26 Sep 2024 expiry",
374648
374649
  symbol: "PT_rsETH_26SEP2024",
@@ -374762,6 +374763,30 @@ var normalTokens = {
374762
374763
  AllNetworks: 1
374763
374764
  /* NORMAL_TOKEN */
374764
374765
  }
374766
+ },
374767
+ PT_beraSTONE_10APR2025: {
374768
+ name: "Pendle PT Berachain STONE 10 April 2025 expiry",
374769
+ symbol: "PT_beraSTONE_10APR2025",
374770
+ type: {
374771
+ AllNetworks: 1
374772
+ /* NORMAL_TOKEN */
374773
+ }
374774
+ },
374775
+ rstETH_Lido_wstETH: {
374776
+ name: "Balancer V3 rstETH-Lido wstETH",
374777
+ symbol: "rstETH_Lido_wstETH",
374778
+ type: {
374779
+ AllNetworks: 1
374780
+ /* NORMAL_TOKEN */
374781
+ }
374782
+ },
374783
+ DVstETH_Prime_wstETH: {
374784
+ name: "Balancer V3 DVstETH-Prime wstETH",
374785
+ symbol: "DVstETH_Prime_wstETH",
374786
+ type: {
374787
+ AllNetworks: 1
374788
+ /* NORMAL_TOKEN */
374789
+ }
374765
374790
  }
374766
374791
  };
374767
374792
  var stakingRewardsPhantomTokens = {
@@ -374989,6 +375014,7 @@ var tokenDataByNetwork = {
374989
375014
  stS: NOT_DEPLOYED,
374990
375015
  scUSD: NOT_DEPLOYED,
374991
375016
  T: "0xCdF7028ceAB81fA0C6971208e83fa7872994beE5",
375017
+ tETH: "0xD11c452fc99cF405034ee446803b6F6c1F6d5ED8",
374992
375018
  // CURVE LP TOKENS
374993
375019
  "3Crv": "0x6c3F90f043a72FA612cbac8115EE7e52BDe6E490",
374994
375020
  crvFRAX: "0x3175Df0976dFA876431C2E9eE6Bc45b65d3473CC",
@@ -375096,7 +375122,6 @@ var tokenDataByNetwork = {
375096
375122
  ezETH_WETH_BPT: "0x596192bB6e41802428Ac943D2f1476C1Af25CC0E",
375097
375123
  sUSDe_USDC_BPT: "0xb819feeF8F0fcDC268AfE14162983A69f6BF179E",
375098
375124
  trenSTETH: "0x4216d5900a6109bba48418b5e2AB6cc4e61Cf477",
375099
- DVstETH_wstETH_BPT: "0x632aafC2D3D2cA1764E702aa25c065c273Cd08eD",
375100
375125
  weETH_ezETH_rswETH: "0x848a5564158d84b8A8fb68ab5D004Fae11619A54",
375101
375126
  GHO_USDT_USDC: "0x8353157092ED8Be69a9DF8F95af097bbF33Cb2aF",
375102
375127
  rsETH_WETH: "0x58AAdFB1Afac0ad7fca1148f3cdE6aEDF5236B6D",
@@ -375154,6 +375179,10 @@ var tokenDataByNetwork = {
375154
375179
  PT_corn_eBTC_27MAR2025: "0x44A7876cA99460ef3218bf08b5f52E2dbE199566",
375155
375180
  PT_sUSDe_27MAR2025: "0xE00bd3Df25fb187d6ABBB620b3dfd19839947b81",
375156
375181
  PT_sUSDe_29MAY2025: "0xb7de5dFCb74d25c2f21841fbd6230355C50d9308",
375182
+ PT_beraSTONE_10APR2025: "0x40b7B4aB1E95e28DF06971581276966FDF95688E",
375183
+ // Balancer V3
375184
+ rstETH_Lido_wstETH: "0x121edB0bADc036F5FC610D015EE14093C142313B",
375185
+ DVstETH_Prime_wstETH: "0xeb95d6BD67f613E7918A031d9F4a9a92766659aC",
375157
375186
  // GEARBOX
375158
375187
  dDAI: "0x6CFaF95457d7688022FC53e7AbE052ef8DFBbdBA",
375159
375188
  dUSDC: "0xc411dB5f5Eb3f7d552F9B8454B2D74097ccdE6E3",
@@ -375178,7 +375207,7 @@ var tokenDataByNetwork = {
375178
375207
  sdcrvUSDV3: "0xfBCA378AeA93EADD6882299A3d74D8641Cc0C4BC",
375179
375208
  dDOLAV3: "0x31426271449F60d37Cc5C9AEf7bD12aF3BdC7A94",
375180
375209
  dtBTCV3: "0x7354EC6E852108411e681D13E11185c3a2567981",
375181
- dwstETHV3: "0xCad5edc9360825C4Ec36660dC1a6E61c74696c7B",
375210
+ dwstETHV3: "0xff94993fa7ea27efc943645f95adb36c1b81244b",
375182
375211
  dUSDC_eV3: NOT_DEPLOYED,
375183
375212
  sdUSDC_eV3: NOT_DEPLOYED,
375184
375213
  GEAR: "0xBa3335588D9403515223F109EdC4eB7269a9Ab5D",
@@ -375188,7 +375217,6 @@ var tokenDataByNetwork = {
375188
375217
  sUSDe: "0x9D39A5DE30e57443BfF2A8307A4256c8797A3497",
375189
375218
  sUSDS: "0xa3931d71877C0E7a3148CB7Eb4463524FEc27fbD",
375190
375219
  scrvUSD: "0x0655977FEb2f289A4aB78af67BAB0d17aAb84367",
375191
- tETH: "0xD11c452fc99cF405034ee446803b6F6c1F6d5ED8",
375192
375220
  beraSTONE: "0x97Ad75064b20fb2B2447feD4fa953bF7F007a706",
375193
375221
  // AAVE
375194
375222
  aUSDC: "0xBcca60bB61934080951369a648Fb03DF4F96263C",
@@ -375216,7 +375244,8 @@ var tokenDataByNetwork = {
375216
375244
  amphrETH: "0x5fD13359Ba15A84B76f7F87568309040176167cd",
375217
375245
  rstETH: "0x7a4EffD87C2f3C55CA251080b1343b605f327E3a",
375218
375246
  pzETH: "0x8c9532a60E0E7C6BbD2B2c1303F63aCE1c3E9811",
375219
- DVstETH: "0x5E362eb2c0706Bd1d134689eC75176018385430B"
375247
+ DVstETH: "0x5E362eb2c0706Bd1d134689eC75176018385430B",
375248
+ waEthLidowstETH: "0x775F661b0bD1739349b9A2A3EF60be277c5d2D29"
375220
375249
  },
375221
375250
  ///
375222
375251
  ///
@@ -375283,6 +375312,7 @@ var tokenDataByNetwork = {
375283
375312
  pufETH: NOT_DEPLOYED,
375284
375313
  USDS: NOT_DEPLOYED,
375285
375314
  T: NOT_DEPLOYED,
375315
+ tETH: NOT_DEPLOYED,
375286
375316
  // REDSTONE
375287
375317
  SHIB: NOT_DEPLOYED,
375288
375318
  // YEARN TOKENS
@@ -375396,7 +375426,6 @@ var tokenDataByNetwork = {
375396
375426
  ezETH_WETH_BPT: NOT_DEPLOYED,
375397
375427
  sUSDe_USDC_BPT: NOT_DEPLOYED,
375398
375428
  trenSTETH: NOT_DEPLOYED,
375399
- DVstETH_wstETH_BPT: NOT_DEPLOYED,
375400
375429
  weETH_ezETH_rswETH: NOT_DEPLOYED,
375401
375430
  GHO_USDT_USDC: NOT_DEPLOYED,
375402
375431
  rsETH_WETH: NOT_DEPLOYED,
@@ -375450,6 +375479,10 @@ var tokenDataByNetwork = {
375450
375479
  PT_corn_eBTC_27MAR2025: NOT_DEPLOYED,
375451
375480
  PT_sUSDe_27MAR2025: NOT_DEPLOYED,
375452
375481
  PT_sUSDe_29MAY2025: NOT_DEPLOYED,
375482
+ PT_beraSTONE_10APR2025: NOT_DEPLOYED,
375483
+ // Balancer V3
375484
+ rstETH_Lido_wstETH: NOT_DEPLOYED,
375485
+ DVstETH_Prime_wstETH: NOT_DEPLOYED,
375453
375486
  // GEARBOX
375454
375487
  dDAI: NOT_DEPLOYED,
375455
375488
  dUSDC: NOT_DEPLOYED,
@@ -375498,7 +375531,6 @@ var tokenDataByNetwork = {
375498
375531
  sUSDe: NOT_DEPLOYED,
375499
375532
  sUSDS: NOT_DEPLOYED,
375500
375533
  scrvUSD: NOT_DEPLOYED,
375501
- tETH: NOT_DEPLOYED,
375502
375534
  beraSTONE: NOT_DEPLOYED,
375503
375535
  // ZIRCUIT
375504
375536
  zpufETH: NOT_DEPLOYED,
@@ -375510,7 +375542,8 @@ var tokenDataByNetwork = {
375510
375542
  amphrETH: NOT_DEPLOYED,
375511
375543
  rstETH: NOT_DEPLOYED,
375512
375544
  pzETH: NOT_DEPLOYED,
375513
- DVstETH: NOT_DEPLOYED
375545
+ DVstETH: NOT_DEPLOYED,
375546
+ waEthLidowstETH: NOT_DEPLOYED
375514
375547
  },
375515
375548
  ///
375516
375549
  ///
@@ -375577,6 +375610,7 @@ var tokenDataByNetwork = {
375577
375610
  stS: NOT_DEPLOYED,
375578
375611
  scUSD: NOT_DEPLOYED,
375579
375612
  T: NOT_DEPLOYED,
375613
+ tETH: NOT_DEPLOYED,
375580
375614
  // REDSTONE
375581
375615
  SHIB: NOT_DEPLOYED,
375582
375616
  // YEARN TOKENS
@@ -375692,7 +375726,6 @@ var tokenDataByNetwork = {
375692
375726
  ezETH_WETH_BPT: NOT_DEPLOYED,
375693
375727
  sUSDe_USDC_BPT: NOT_DEPLOYED,
375694
375728
  trenSTETH: NOT_DEPLOYED,
375695
- DVstETH_wstETH_BPT: NOT_DEPLOYED,
375696
375729
  weETH_ezETH_rswETH: NOT_DEPLOYED,
375697
375730
  "33AURA_33ARB_33BAL": NOT_DEPLOYED,
375698
375731
  ezETH_wstETH: NOT_DEPLOYED,
@@ -375744,6 +375777,10 @@ var tokenDataByNetwork = {
375744
375777
  PT_corn_eBTC_27MAR2025: NOT_DEPLOYED,
375745
375778
  PT_sUSDe_27MAR2025: NOT_DEPLOYED,
375746
375779
  PT_sUSDe_29MAY2025: NOT_DEPLOYED,
375780
+ PT_beraSTONE_10APR2025: NOT_DEPLOYED,
375781
+ // Balancer V3
375782
+ rstETH_Lido_wstETH: NOT_DEPLOYED,
375783
+ DVstETH_Prime_wstETH: NOT_DEPLOYED,
375747
375784
  // GEARBOX
375748
375785
  dDAI: NOT_DEPLOYED,
375749
375786
  dUSDC: NOT_DEPLOYED,
@@ -375792,7 +375829,6 @@ var tokenDataByNetwork = {
375792
375829
  sUSDe: NOT_DEPLOYED,
375793
375830
  sUSDS: NOT_DEPLOYED,
375794
375831
  scrvUSD: NOT_DEPLOYED,
375795
- tETH: NOT_DEPLOYED,
375796
375832
  beraSTONE: NOT_DEPLOYED,
375797
375833
  // ZIRCUIT
375798
375834
  zpufETH: NOT_DEPLOYED,
@@ -375804,13 +375840,19 @@ var tokenDataByNetwork = {
375804
375840
  amphrETH: NOT_DEPLOYED,
375805
375841
  rstETH: NOT_DEPLOYED,
375806
375842
  pzETH: NOT_DEPLOYED,
375807
- DVstETH: NOT_DEPLOYED
375843
+ DVstETH: NOT_DEPLOYED,
375844
+ waEthLidowstETH: NOT_DEPLOYED
375808
375845
  },
375809
375846
  //
375810
375847
  //
375811
375848
  // BASE
375812
375849
  //
375813
375850
  //
375851
+ ///
375852
+ ///
375853
+ /// OPTIMISM
375854
+ ///
375855
+ ///
375814
375856
  Base: {
375815
375857
  "1INCH": NOT_DEPLOYED,
375816
375858
  AAVE: NOT_DEPLOYED,
@@ -375870,6 +375912,7 @@ var tokenDataByNetwork = {
375870
375912
  pufETH: NOT_DEPLOYED,
375871
375913
  USDS: NOT_DEPLOYED,
375872
375914
  T: NOT_DEPLOYED,
375915
+ tETH: NOT_DEPLOYED,
375873
375916
  // REDSTONE
375874
375917
  SHIB: NOT_DEPLOYED,
375875
375918
  // YEARN TOKENS
@@ -375984,7 +376027,6 @@ var tokenDataByNetwork = {
375984
376027
  ezETH_WETH_BPT: NOT_DEPLOYED,
375985
376028
  sUSDe_USDC_BPT: NOT_DEPLOYED,
375986
376029
  trenSTETH: NOT_DEPLOYED,
375987
- DVstETH_wstETH_BPT: NOT_DEPLOYED,
375988
376030
  weETH_ezETH_rswETH: NOT_DEPLOYED,
375989
376031
  rsETH_WETH: NOT_DEPLOYED,
375990
376032
  rsETH_wETH_Arb: NOT_DEPLOYED,
@@ -376035,6 +376077,10 @@ var tokenDataByNetwork = {
376035
376077
  PT_corn_eBTC_27MAR2025: NOT_DEPLOYED,
376036
376078
  PT_sUSDe_27MAR2025: NOT_DEPLOYED,
376037
376079
  PT_sUSDe_29MAY2025: NOT_DEPLOYED,
376080
+ PT_beraSTONE_10APR2025: NOT_DEPLOYED,
376081
+ // Balancer V3
376082
+ rstETH_Lido_wstETH: NOT_DEPLOYED,
376083
+ DVstETH_Prime_wstETH: NOT_DEPLOYED,
376038
376084
  // GEARBOX
376039
376085
  dDAI: NOT_DEPLOYED,
376040
376086
  dUSDC: NOT_DEPLOYED,
@@ -376083,7 +376129,6 @@ var tokenDataByNetwork = {
376083
376129
  sUSDe: NOT_DEPLOYED,
376084
376130
  sUSDS: NOT_DEPLOYED,
376085
376131
  scrvUSD: NOT_DEPLOYED,
376086
- tETH: NOT_DEPLOYED,
376087
376132
  beraSTONE: NOT_DEPLOYED,
376088
376133
  GHO: NOT_DEPLOYED,
376089
376134
  GHOUSDe: NOT_DEPLOYED,
@@ -376097,7 +376142,8 @@ var tokenDataByNetwork = {
376097
376142
  amphrETH: NOT_DEPLOYED,
376098
376143
  rstETH: NOT_DEPLOYED,
376099
376144
  pzETH: NOT_DEPLOYED,
376100
- DVstETH: NOT_DEPLOYED
376145
+ DVstETH: NOT_DEPLOYED,
376146
+ waEthLidowstETH: NOT_DEPLOYED
376101
376147
  },
376102
376148
  //
376103
376149
  //
@@ -376277,7 +376323,6 @@ var tokenDataByNetwork = {
376277
376323
  ezETH_WETH_BPT: NOT_DEPLOYED,
376278
376324
  sUSDe_USDC_BPT: NOT_DEPLOYED,
376279
376325
  trenSTETH: NOT_DEPLOYED,
376280
- DVstETH_wstETH_BPT: NOT_DEPLOYED,
376281
376326
  weETH_ezETH_rswETH: NOT_DEPLOYED,
376282
376327
  rsETH_WETH: NOT_DEPLOYED,
376283
376328
  rsETH_wETH_Arb: NOT_DEPLOYED,
@@ -376328,6 +376373,10 @@ var tokenDataByNetwork = {
376328
376373
  PT_corn_eBTC_27MAR2025: NOT_DEPLOYED,
376329
376374
  PT_sUSDe_27MAR2025: NOT_DEPLOYED,
376330
376375
  PT_sUSDe_29MAY2025: NOT_DEPLOYED,
376376
+ PT_beraSTONE_10APR2025: NOT_DEPLOYED,
376377
+ // Balancer V3
376378
+ rstETH_Lido_wstETH: NOT_DEPLOYED,
376379
+ DVstETH_Prime_wstETH: NOT_DEPLOYED,
376331
376380
  // GEARBOX
376332
376381
  dDAI: NOT_DEPLOYED,
376333
376382
  dUSDC: NOT_DEPLOYED,
@@ -376390,7 +376439,8 @@ var tokenDataByNetwork = {
376390
376439
  amphrETH: NOT_DEPLOYED,
376391
376440
  rstETH: NOT_DEPLOYED,
376392
376441
  pzETH: NOT_DEPLOYED,
376393
- DVstETH: NOT_DEPLOYED
376442
+ DVstETH: NOT_DEPLOYED,
376443
+ waEthLidowstETH: NOT_DEPLOYED
376394
376444
  }
376395
376445
  };
376396
376446
  var tickerInfoTokensByNetwork = {
@@ -376487,7 +376537,7 @@ var tickerInfoTokensByNetwork = {
376487
376537
  {
376488
376538
  symbol: "beraSTONE/ETH",
376489
376539
  dataId: "beraETH_FUNDAMENTAL",
376490
- address: "0x692072eE081c9Ded28d2CfD27513E578d895FD0d",
376540
+ address: tokenDataByNetwork.Mainnet.beraSTONE,
376491
376541
  priceFeed: "0xf12b7879713FA998B39b3C7C9c2631E40a0b9dfB",
376492
376542
  reserve: false
376493
376543
  }
@@ -376712,6 +376762,15 @@ var tickerInfoTokensByNetwork = {
376712
376762
  reserve: true
376713
376763
  }
376714
376764
  ],
376765
+ PT_beraSTONE_10APR2025: [
376766
+ {
376767
+ symbol: "beraSTONE/ETH",
376768
+ dataId: "beraSTONE_FUNDAMENTAL",
376769
+ address: tokenDataByNetwork.Mainnet.beraSTONE,
376770
+ priceFeed: "0xf12b7879713FA998B39b3C7C9c2631E40a0b9dfB",
376771
+ reserve: true
376772
+ }
376773
+ ],
376715
376774
  PT_eETH_26DEC2024: [
376716
376775
  {
376717
376776
  symbol: "ETH",
@@ -379495,7 +379554,8 @@ var EXTRA_FARM_TOKENS = {
379495
379554
  DVstETH: true,
379496
379555
  beraSTONE: true,
379497
379556
  PT_sUSDe_29MAY2025: true,
379498
- tETH: true
379557
+ tETH: true,
379558
+ PT_beraSTONE_10APR2025: true
379499
379559
  };
379500
379560
  var { USDe, ...rest } = EXTRA_FARM_TOKENS;
379501
379561
  var CREDIT_SESSION_STATUS_BY_ID = {
@@ -405550,19 +405610,26 @@ var AccountOpener = class extends SDKConstruct {
405550
405610
  await this.#approve(token, cm);
405551
405611
  }
405552
405612
  }
405613
+ const results = [];
405614
+ let success = 0;
405553
405615
  for (let i = 0; i < targets.length; i++) {
405554
405616
  const target = targets[i];
405555
405617
  try {
405556
- await this.#openAccount(target, i + 1, targets.length);
405618
+ const result = await this.#openAccount(target, i + 1, targets.length);
405619
+ results.push(result);
405620
+ success += result.account ? 1 : 0;
405557
405621
  } catch (e) {
405558
- this.#logger?.error(e);
405622
+ results.push({
405623
+ input: target,
405624
+ error: `${e}`
405625
+ });
405559
405626
  }
405560
405627
  }
405561
- const accounts = await this.getOpenedAccounts();
405562
- this.#logger?.info(`opened ${accounts.length} accounts`);
405563
- return accounts;
405628
+ this.#logger?.info(`opened ${success}/${targets.length} accounts`);
405629
+ return results;
405564
405630
  }
405565
- async #openAccount({ creditManager, collateral, leverage = 4, slippage = 50 }, index2, total) {
405631
+ async #openAccount(input, index2, total) {
405632
+ const { creditManager, collateral, leverage = 4, slippage = 50 } = input;
405566
405633
  const borrower = await this.#getBorrower();
405567
405634
  const cm = this.sdk.marketRegister.findCreditManager(creditManager);
405568
405635
  const symbol = this.sdk.tokensMeta.symbol(collateral);
@@ -405634,9 +405701,37 @@ var AccountOpener = class extends SDKConstruct {
405634
405701
  logger2?.debug(`send transaction ${hash2}`);
405635
405702
  const receipt = await this.#anvil.waitForTransactionReceipt({ hash: hash2 });
405636
405703
  if (receipt.status === "reverted") {
405637
- throw new Error(`open credit account tx ${hash2} reverted`);
405704
+ return {
405705
+ input,
405706
+ error: `open credit account tx reverted`,
405707
+ txHash: hash2
405708
+ };
405638
405709
  }
405639
405710
  logger2?.info(`opened credit account ${index2}/${total}`);
405711
+ const logs = parseEventLogs({
405712
+ abi: iCreditFacadeV300Abi,
405713
+ logs: receipt.logs,
405714
+ eventName: "OpenCreditAccount"
405715
+ });
405716
+ logger2?.info(`found ${logs.length} logs`);
405717
+ let account;
405718
+ if (logs.length > 0) {
405719
+ try {
405720
+ logger2?.debug(
405721
+ `getting credit account data for ${logs[0].args.creditAccount}`
405722
+ );
405723
+ account = await this.#service.getCreditAccountData(
405724
+ logs[0].args.creditAccount
405725
+ );
405726
+ } catch (e) {
405727
+ logger2?.error(`failed to get credit account data: ${e}`);
405728
+ }
405729
+ }
405730
+ return {
405731
+ input,
405732
+ txHash: hash2,
405733
+ account
405734
+ };
405640
405735
  }
405641
405736
  async getOpenedAccounts() {
405642
405737
  return await this.#service.getCreditAccounts({
@@ -413787,6 +413882,7 @@ function executeJson() {
413787
413882
  }
413788
413883
 
413789
413884
  // src/commands/open-accounts.ts
413885
+ import { spawnSync as spawnSync3 } from "node:child_process";
413790
413886
  import { mkdir as mkdir2, writeFile as writeFile6 } from "node:fs/promises";
413791
413887
  import path9 from "node:path";
413792
413888
  function openAccounts() {
@@ -413799,7 +413895,7 @@ function openAccounts() {
413799
413895
  new Option("--shared-dir <dir>", "dir to put output files").env(
413800
413896
  "SHARED_DIR"
413801
413897
  )
413802
- ).addOption(
413898
+ ).addOption(new Option("--nexo", "try to open accounts in Nexo")).addOption(
413803
413899
  new Option("--anvil-url <url>", "anvil rpc url").env("ANVIL_URL")
413804
413900
  ).action(async (opts) => {
413805
413901
  log_default.info("starting sdk v3.1 example");
@@ -413808,7 +413904,8 @@ function openAccounts() {
413808
413904
  addressProviderJson,
413809
413905
  marketConfigurators,
413810
413906
  anvilUrl = "http://127.0.0.1:8545",
413811
- sharedDir = "."
413907
+ sharedDir = ".",
413908
+ nexo
413812
413909
  } = opts;
413813
413910
  await mkdir2(path9.resolve(sharedDir, "deploy-state"), { recursive: true });
413814
413911
  const sdkExample2 = new SDKExample(log_default);
@@ -413854,7 +413951,7 @@ function openAccounts() {
413854
413951
  faucet: faucetAddr
413855
413952
  });
413856
413953
  try {
413857
- const opened = await accountOpener.openCreditAccounts([
413954
+ let accounts = [
413858
413955
  {
413859
413956
  creditManager: "0x50ba483272484fc5eebe8676dc87d814a11faef6",
413860
413957
  // restaking weth
@@ -413885,18 +413982,60 @@ function openAccounts() {
413885
413982
  collateral: "0x9D39A5DE30e57443BfF2A8307A4256c8797A3497"
413886
413983
  // sUSDe
413887
413984
  }
413888
- ]);
413985
+ ];
413986
+ if (nexo) {
413987
+ const nexoCM = sdkExample2.sdk.marketRegister.creditManagers.find(
413988
+ (cm) => cm.name === "NEXO USDT stable S"
413989
+ );
413990
+ const nexoCMAddress = nexoCM?.creditManager.address;
413991
+ log_default.debug(`found nexo credit manager: ${nexoCMAddress}`);
413992
+ if (nexoCMAddress) {
413993
+ const collaterals = ["USDC", "DAI", "sUSDe", "PT-sUSDE-27MAR2025"].map((s) => sdkExample2.sdk.tokensMeta.findBySymbol(s)?.addr).filter(Boolean);
413994
+ accounts = collaterals.map((collateral) => ({
413995
+ creditManager: nexoCMAddress,
413996
+ collateral
413997
+ }));
413998
+ }
413999
+ accounts.push({
414000
+ creditManager: "0x3EB95430FdB99439A86d3c6D7D01C3c561393556",
414001
+ // [Trade USDC Tier 1]
414002
+ collateral: "0x6B175474E89094C44Da98b954EedeAC495271d0F"
414003
+ // DAI
414004
+ });
414005
+ }
414006
+ const results = await accountOpener.openCreditAccounts(accounts);
414007
+ const destDir = path9.resolve(sharedDir, "open-accounts");
414008
+ await mkdir2(destDir, { recursive: true });
413889
414009
  await writeFile6(
413890
- path9.resolve(sharedDir, "opened-accounts.json"),
413891
- json_stringify(opened),
414010
+ path9.resolve(destDir, "results.json"),
414011
+ json_stringify(results),
413892
414012
  "utf-8"
413893
414013
  );
414014
+ for (const r of results) {
414015
+ if (!!r.txHash && !r.account) {
414016
+ await runCast(
414017
+ r.txHash,
414018
+ ["run", "--rpc-url", anvilUrl, r.txHash],
414019
+ destDir
414020
+ );
414021
+ }
414022
+ }
413894
414023
  } catch (e) {
413895
414024
  log_default.error(`failed to open accounts: ${e}`);
413896
414025
  }
413897
414026
  log_default.info("done");
413898
414027
  });
413899
414028
  }
414029
+ async function runCast(hash2, args, destDir) {
414030
+ try {
414031
+ const traceFile = path9.resolve(destDir, `${hash2}.trace`);
414032
+ const cast = spawnSync3("cast", args, { encoding: "utf-8" });
414033
+ await writeFile6(traceFile, cast.output.join(""), "utf-8");
414034
+ log_default.debug(`saved trace file: ${traceFile}`);
414035
+ } catch (e) {
414036
+ log_default.warn(`failed to save trace of cast ${args.join(" ")}: ${e}`);
414037
+ }
414038
+ }
413900
414039
 
413901
414040
  // src/commands/parse.ts
413902
414041
  import { writeFile as writeFile7 } from "node:fs/promises";
@@ -413945,7 +414084,7 @@ function getRenderer(opts) {
413945
414084
  var package_default = {
413946
414085
  name: "@gearbox-protocol/deploy-tools",
413947
414086
  description: "Gearbox deploy tools",
413948
- version: "5.10.6",
414087
+ version: "5.10.8",
413949
414088
  homepage: "https://gearbox.fi",
413950
414089
  keywords: [
413951
414090
  "gearbox"
@@ -413988,7 +414127,7 @@ var package_default = {
413988
414127
  "@gearbox-protocol/deploy-tools-node": "0.0.0",
413989
414128
  "@gearbox-protocol/deploy-tools-shared": "0.0.0",
413990
414129
  "@gearbox-protocol/deploy-tools-types": "0.0.0",
413991
- "@gearbox-protocol/sdk": "3.0.0-vfour.237",
414130
+ "@gearbox-protocol/sdk": "3.0.0-vfour.241",
413992
414131
  "@gearbox-protocol/sdk-gov": "^2.34.1",
413993
414132
  "@types/lodash-es": "^4.17.12",
413994
414133
  "@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.10.6",
4
+ "version": "5.10.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.237",
47
+ "@gearbox-protocol/sdk": "3.0.0-vfour.241",
48
48
  "@gearbox-protocol/sdk-gov": "^2.34.1",
49
49
  "@types/lodash-es": "^4.17.12",
50
50
  "@types/node": "^22.13.1",