@gearbox-protocol/deploy-tools 5.10.7 → 5.10.9

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 +209 -47
  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 = {
@@ -405525,6 +405585,7 @@ var AccountOpener = class extends SDKConstruct {
405525
405585
  transport: service.sdk.provider.transport
405526
405586
  });
405527
405587
  this.#faucet = options.faucet ?? service.sdk.addressProvider.getAddress("FAUCET");
405588
+ this.#borrower = options.borrower;
405528
405589
  }
405529
405590
  get borrower() {
405530
405591
  if (!this.#borrower) {
@@ -405550,19 +405611,26 @@ var AccountOpener = class extends SDKConstruct {
405550
405611
  await this.#approve(token, cm);
405551
405612
  }
405552
405613
  }
405614
+ const results = [];
405615
+ let success = 0;
405553
405616
  for (let i = 0; i < targets.length; i++) {
405554
405617
  const target = targets[i];
405555
405618
  try {
405556
- await this.#openAccount(target, i + 1, targets.length);
405619
+ const result = await this.#openAccount(target, i + 1, targets.length);
405620
+ results.push(result);
405621
+ success += result.account ? 1 : 0;
405557
405622
  } catch (e) {
405558
- this.#logger?.error(e);
405623
+ results.push({
405624
+ input: target,
405625
+ error: `${e}`
405626
+ });
405559
405627
  }
405560
405628
  }
405561
- const accounts = await this.getOpenedAccounts();
405562
- this.#logger?.info(`opened ${accounts.length} accounts`);
405563
- return accounts;
405629
+ this.#logger?.info(`opened ${success}/${targets.length} accounts`);
405630
+ return results;
405564
405631
  }
405565
- async #openAccount({ creditManager, collateral, leverage = 4, slippage = 50 }, index2, total) {
405632
+ async #openAccount(input, index2, total) {
405633
+ const { creditManager, collateral, leverage = 4, slippage = 50 } = input;
405566
405634
  const borrower = await this.#getBorrower();
405567
405635
  const cm = this.sdk.marketRegister.findCreditManager(creditManager);
405568
405636
  const symbol = this.sdk.tokensMeta.symbol(collateral);
@@ -405627,16 +405695,55 @@ var AccountOpener = class extends SDKConstruct {
405627
405695
  );
405628
405696
  }
405629
405697
  logger2?.debug("prepared open account transaction");
405630
- const hash2 = await sendRawTx(this.#anvil, {
405631
- tx,
405632
- account: borrower
405633
- });
405634
- logger2?.debug(`send transaction ${hash2}`);
405698
+ let hash2;
405699
+ try {
405700
+ hash2 = await sendRawTx(this.#anvil, {
405701
+ tx,
405702
+ account: borrower
405703
+ });
405704
+ logger2?.debug(`send transaction ${hash2}`);
405705
+ } catch (e) {
405706
+ return {
405707
+ input,
405708
+ error: `${e}`,
405709
+ rawTx: tx
405710
+ };
405711
+ }
405635
405712
  const receipt = await this.#anvil.waitForTransactionReceipt({ hash: hash2 });
405636
405713
  if (receipt.status === "reverted") {
405637
- throw new Error(`open credit account tx ${hash2} reverted`);
405714
+ return {
405715
+ input,
405716
+ error: `open credit account tx reverted`,
405717
+ txHash: hash2,
405718
+ rawTx: tx
405719
+ };
405638
405720
  }
405639
405721
  logger2?.info(`opened credit account ${index2}/${total}`);
405722
+ const logs = parseEventLogs({
405723
+ abi: iCreditFacadeV300Abi,
405724
+ logs: receipt.logs,
405725
+ eventName: "OpenCreditAccount"
405726
+ });
405727
+ logger2?.info(`found ${logs.length} logs`);
405728
+ let account;
405729
+ if (logs.length > 0) {
405730
+ try {
405731
+ logger2?.debug(
405732
+ `getting credit account data for ${logs[0].args.creditAccount}`
405733
+ );
405734
+ account = await this.#service.getCreditAccountData(
405735
+ logs[0].args.creditAccount
405736
+ );
405737
+ } catch (e) {
405738
+ logger2?.error(`failed to get credit account data: ${e}`);
405739
+ }
405740
+ }
405741
+ return {
405742
+ input,
405743
+ txHash: hash2,
405744
+ rawTx: tx,
405745
+ account
405746
+ };
405640
405747
  }
405641
405748
  async getOpenedAccounts() {
405642
405749
  return await this.#service.getCreditAccounts({
@@ -413787,6 +413894,7 @@ function executeJson() {
413787
413894
  }
413788
413895
 
413789
413896
  // src/commands/open-accounts.ts
413897
+ import { spawnSync as spawnSync3 } from "node:child_process";
413790
413898
  import { mkdir as mkdir2, writeFile as writeFile6 } from "node:fs/promises";
413791
413899
  import path9 from "node:path";
413792
413900
  function openAccounts() {
@@ -413850,9 +413958,17 @@ function openAccounts() {
413850
413958
  }
413851
413959
  }
413852
413960
  );
413961
+ const borrowerKey = generatePrivateKey();
413962
+ const borrower = privateKeyToAccount(borrowerKey);
413963
+ await anvil.setBalance({
413964
+ address: borrower.address,
413965
+ value: parseEther("100")
413966
+ });
413967
+ log_default.debug(`borrower address: ${borrower.address}`);
413853
413968
  const accService = new CreditAccountsService(sdkExample2.sdk);
413854
413969
  const accountOpener = new AccountOpener(accService, {
413855
- faucet: faucetAddr
413970
+ faucet: faucetAddr,
413971
+ borrower
413856
413972
  });
413857
413973
  try {
413858
413974
  let accounts = [
@@ -413900,19 +414016,65 @@ function openAccounts() {
413900
414016
  collateral
413901
414017
  }));
413902
414018
  }
414019
+ accounts.push({
414020
+ creditManager: "0x3EB95430FdB99439A86d3c6D7D01C3c561393556",
414021
+ // [Trade USDC Tier 1]
414022
+ collateral: "0x6B175474E89094C44Da98b954EedeAC495271d0F"
414023
+ // DAI
414024
+ });
413903
414025
  }
413904
- const opened = await accountOpener.openCreditAccounts(accounts);
414026
+ const results = await accountOpener.openCreditAccounts(accounts);
414027
+ const destDir = path9.resolve(sharedDir, "open-accounts");
414028
+ await mkdir2(destDir, { recursive: true });
413905
414029
  await writeFile6(
413906
- path9.resolve(sharedDir, "opened-accounts.json"),
413907
- json_stringify(opened),
414030
+ path9.resolve(destDir, "results.json"),
414031
+ json_stringify(results),
413908
414032
  "utf-8"
413909
414033
  );
414034
+ for (let i = 0; i < results.length; i++) {
414035
+ const r = results[i];
414036
+ if (!!r.txHash && !r.account) {
414037
+ await runCast(r, i + 1, {
414038
+ anvilUrl,
414039
+ destDir,
414040
+ privateKey: borrowerKey
414041
+ });
414042
+ }
414043
+ }
413910
414044
  } catch (e) {
413911
414045
  log_default.error(`failed to open accounts: ${e}`);
413912
414046
  }
413913
414047
  log_default.info("done");
413914
414048
  });
413915
414049
  }
414050
+ async function runCast(result, index2, opts) {
414051
+ const { txHash, rawTx } = result;
414052
+ const { anvilUrl, destDir, privateKey } = opts;
414053
+ if (!txHash || !rawTx) {
414054
+ return;
414055
+ }
414056
+ const id = txHash ? txHash : `account_${index2}`;
414057
+ const args = txHash ? ["run", "--rpc-url", anvilUrl, txHash] : [
414058
+ "call",
414059
+ "--trace",
414060
+ "--rpc-url",
414061
+ anvilUrl,
414062
+ "--private-key",
414063
+ privateKey,
414064
+ rawTx.to,
414065
+ rawTx.callData
414066
+ ];
414067
+ const argsStr = args.join(" ").replace(privateKey, "<pk>");
414068
+ log_default.debug(`running cast ${argsStr}`);
414069
+ try {
414070
+ const traceFile = path9.resolve(destDir, `${id}.trace`);
414071
+ const cast = spawnSync3("cast", args, { encoding: "utf-8" });
414072
+ await writeFile6(traceFile, cast.output.join(""), "utf-8");
414073
+ log_default.debug(`saved trace file: ${traceFile}`);
414074
+ } catch (e) {
414075
+ log_default.warn(`failed to save trace: ${e}`);
414076
+ }
414077
+ }
413916
414078
 
413917
414079
  // src/commands/parse.ts
413918
414080
  import { writeFile as writeFile7 } from "node:fs/promises";
@@ -413961,7 +414123,7 @@ function getRenderer(opts) {
413961
414123
  var package_default = {
413962
414124
  name: "@gearbox-protocol/deploy-tools",
413963
414125
  description: "Gearbox deploy tools",
413964
- version: "5.10.7",
414126
+ version: "5.10.9",
413965
414127
  homepage: "https://gearbox.fi",
413966
414128
  keywords: [
413967
414129
  "gearbox"
@@ -414004,7 +414166,7 @@ var package_default = {
414004
414166
  "@gearbox-protocol/deploy-tools-node": "0.0.0",
414005
414167
  "@gearbox-protocol/deploy-tools-shared": "0.0.0",
414006
414168
  "@gearbox-protocol/deploy-tools-types": "0.0.0",
414007
- "@gearbox-protocol/sdk": "3.0.0-vfour.237",
414169
+ "@gearbox-protocol/sdk": "3.0.0-vfour.242",
414008
414170
  "@gearbox-protocol/sdk-gov": "^2.34.1",
414009
414171
  "@types/lodash-es": "^4.17.12",
414010
414172
  "@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.7",
4
+ "version": "5.10.9",
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.242",
48
48
  "@gearbox-protocol/sdk-gov": "^2.34.1",
49
49
  "@types/lodash-es": "^4.17.12",
50
50
  "@types/node": "^22.13.1",