@gearbox-protocol/deploy-tools 5.36.16 → 5.36.17

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 +4 -107
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -381352,11 +381352,6 @@ function formatDuration2(seconds, raw = true) {
381352
381352
  return `${formatDuration(duration)}` + (raw ? `[${seconds.toString()}]` : "");
381353
381353
  }
381354
381354
 
381355
- // ../../node_modules/@gearbox-protocol/sdk/dist/esm/sdk/utils/hex.js
381356
- function hexEq(a, b) {
381357
- return !!a && !!b && a.toLowerCase() === b.toLowerCase();
381358
- }
381359
-
381360
381355
  // ../../node_modules/@gearbox-protocol/sdk/dist/esm/sdk/utils/retry.js
381361
381356
  async function retry(fn, options = {}) {
381362
381357
  const { attempts = 3, interval = 200, exponent = 1 } = options;
@@ -398536,103 +398531,6 @@ var PluginStateVersionError = class extends Error {
398536
398531
  }
398537
398532
  };
398538
398533
 
398539
- // ../../node_modules/@gearbox-protocol/sdk/dist/esm/sdk/plugins/V300StalenessPeriodPlugin.js
398540
- var V300StalenessPeriodPlugin = class extends BasePlugin {
398541
- #syncedTo = 0n;
398542
- #logger;
398543
- #events = [];
398544
- // eslint-disable-next-line accessor-pairs
398545
- set sdk(sdk) {
398546
- super.sdk = sdk;
398547
- this.#syncedTo = ADDRESS_PROVIDER_BLOCK[sdk.provider.networkType] - 1n;
398548
- }
398549
- get loaded() {
398550
- return !!this.#syncedTo;
398551
- }
398552
- async load(force) {
398553
- if (!force && this.loaded) {
398554
- return this.state;
398555
- }
398556
- const oracles = this.#getOraclesMap();
398557
- const [fromBlock, toBlock] = [this.#syncedTo + 1n, this.sdk.currentBlock];
398558
- if (oracles.size === 0 || fromBlock > toBlock) {
398559
- return this.state;
398560
- }
398561
- const events = await getLogsSafe(this.client, {
398562
- address: oracles.keys(),
398563
- events: [
398564
- getAbiItem({
398565
- abi: iPriceOracleV300Abi,
398566
- name: "SetReservePriceFeed"
398567
- }),
398568
- getAbiItem({
398569
- abi: iPriceOracleV300Abi,
398570
- name: "SetPriceFeed"
398571
- })
398572
- ],
398573
- fromBlock,
398574
- toBlock,
398575
- strict: true
398576
- });
398577
- this.#logger?.info(
398578
- `loaded ${events.length} price feed events in range [${fromBlock}; ${toBlock}]`
398579
- );
398580
- for (const e of events) {
398581
- const oracle = oracles.mustGet(e.address);
398582
- const priceFeed = getAddress(e.args.priceFeed);
398583
- const token = getAddress(e.args.token);
398584
- const stalenessPeriod = e.args.stalenessPeriod;
398585
- const reserve = e.eventName === "SetReservePriceFeed";
398586
- const map = reserve ? oracle.reservePriceFeeds : oracle.mainPriceFeeds;
398587
- const pf = map.get(token);
398588
- if (hexEq(pf?.address, priceFeed)) {
398589
- map.upsert(
398590
- token,
398591
- new PriceFeedRef(this.sdk, priceFeed, stalenessPeriod)
398592
- );
398593
- this.#events.push({
398594
- oracle: oracle.address,
398595
- priceFeed,
398596
- token,
398597
- stalenessPeriod,
398598
- reserve
398599
- });
398600
- this.#logger?.info(
398601
- `updated staleness period for ${this.labelAddress(token)}/${this.labelAddress(priceFeed)} in oracle ${oracle.name} to ${formatDuration2(stalenessPeriod)}`
398602
- );
398603
- }
398604
- }
398605
- this.#syncedTo = toBlock;
398606
- return this.state;
398607
- }
398608
- get state() {
398609
- return {
398610
- events: this.#events
398611
- };
398612
- }
398613
- hydrate(state) {
398614
- this.#events = state.events;
398615
- const oracles = this.#getOraclesMap();
398616
- for (const e of this.#events) {
398617
- const oracle = oracles.mustGet(e.oracle);
398618
- const map = e.reserve ? oracle.reservePriceFeeds : oracle.mainPriceFeeds;
398619
- map.upsert(
398620
- e.token,
398621
- new PriceFeedRef(this.sdk, e.priceFeed, e.stalenessPeriod)
398622
- );
398623
- this.#logger?.info(
398624
- `hydrated staleness period for ${this.labelAddress(e.token)}/${this.labelAddress(e.priceFeed)} in oracle ${oracle.name} to ${formatDuration2(e.stalenessPeriod)}`
398625
- );
398626
- }
398627
- this.#syncedTo = this.sdk.currentBlock;
398628
- }
398629
- #getOraclesMap() {
398630
- return new AddressMap(
398631
- this.sdk.marketRegister.markets.filter((m) => isV300(m.priceOracle.version)).map((m) => [m.priceOracle.address, m.priceOracle])
398632
- );
398633
- }
398634
- };
398635
-
398636
398534
  // ../../node_modules/@gearbox-protocol/sdk/dist/esm/sdk/GearboxSDK.js
398637
398535
  var ERR_NOT_ATTACHED = new Error("Gearbox SDK not attached");
398638
398536
  var STATE_VERSION = 1;
@@ -416951,7 +416849,7 @@ function normalizeTimelockTx2(t) {
416951
416849
  }
416952
416850
 
416953
416851
  // ../../packages/shared/dist/hex.js
416954
- function hexEq2(a, b) {
416852
+ function hexEq(a, b) {
416955
416853
  const [aa, bb] = [a, b].map((s) => s.replace(/^0x/, "").toLowerCase());
416956
416854
  return aa === bb;
416957
416855
  }
@@ -420760,7 +420658,7 @@ ${errors.join("\n")}`
420760
420658
  }
420761
420659
  if (match2) {
420762
420660
  const abiEncodedConstructorArguments = extractAbiEncodedConstructorArguments(creatorTxData, recompiledCreationBytecode) ?? "";
420763
- if (!hexEq2(abiEncodedConstructorArguments, meta.encodedConstructorArgs)) {
420661
+ if (!hexEq(abiEncodedConstructorArguments, meta.encodedConstructorArgs)) {
420764
420662
  return {
420765
420663
  ...result,
420766
420664
  error: `Encoded constructor arguments mismatch: meta ${meta.encodedConstructorArgs} tx ${abiEncodedConstructorArguments}`
@@ -431405,7 +431303,7 @@ function getRenderer(opts) {
431405
431303
  var package_default = {
431406
431304
  name: "@gearbox-protocol/deploy-tools",
431407
431305
  description: "Gearbox deploy tools",
431408
- version: "5.36.16",
431306
+ version: "5.36.17",
431409
431307
  homepage: "https://gearbox.fi",
431410
431308
  keywords: [
431411
431309
  "gearbox"
@@ -432267,8 +432165,7 @@ function stateSnapshot() {
432267
432165
  plugins: {
432268
432166
  adapters: new AdaptersPlugin(true),
432269
432167
  zappers: new ZappersPlugin(true),
432270
- bots: new BotsPlugin(true),
432271
- stalenessV300: new V300StalenessPeriodPlugin(true)
432168
+ bots: new BotsPlugin(true)
432272
432169
  }
432273
432170
  });
432274
432171
  await writeFile7(outputJson, json_stringify(sdk.state), "utf-8");
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.36.16",
4
+ "version": "5.36.17",
5
5
  "homepage": "https://gearbox.fi",
6
6
  "keywords": [
7
7
  "gearbox"