@bgd-labs/toolbox 0.0.11 → 0.0.13

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 CHANGED
@@ -4655,60 +4655,6 @@ async function tenderly_sim({ accountSlug, projectSlug, accessToken }, body) {
4655
4655
  return response.json();
4656
4656
  }
4657
4657
 
4658
- // src/ecosystem/foundry.ts
4659
- import { execSync } from "node:child_process";
4660
- import { createPatch } from "diff";
4661
- function foundry_getStandardJsonInput(input) {
4662
- const output = JSON.parse(
4663
- execSync(
4664
- `forge verify-contract --show-standard-json-input --verifier etherscan 0x0000000000000000000000000000000000000000 ${input}`
4665
- ).toString()
4666
- );
4667
- return output;
4668
- }
4669
- function foundry_getStorageLayout(input) {
4670
- const output = JSON.parse(
4671
- execSync(`forge inspect ${input} storage --json`).toString()
4672
- );
4673
- return output;
4674
- }
4675
- function cleanupFoundryStorageForDiffing(layout) {
4676
- const cleanTypes = { ...layout.types };
4677
- for (const key of Object.keys(cleanTypes)) {
4678
- if (cleanTypes[key].members)
4679
- cleanTypes[key].members = cleanTypes[key].members.map((member) => ({
4680
- label: member.label,
4681
- contract: member.contract.split(":")[1],
4682
- offset: member.offset,
4683
- slot: member.slot,
4684
- type: member.type
4685
- }));
4686
- if (cleanTypes[key].value)
4687
- cleanTypes[key].value = cleanTypes[cleanTypes[key].value];
4688
- }
4689
- const cleanStorage = layout.storage.map((storage) => ({
4690
- label: storage.label,
4691
- slot: storage.slot,
4692
- offset: storage.offset,
4693
- type: cleanTypes[storage.type],
4694
- contract: storage.contract.split(":")[1]
4695
- }));
4696
- return cleanStorage;
4697
- }
4698
- function diffFoundryStorageLayout(layoutBefore, layoutAfter) {
4699
- const beforeString = JSON.stringify(
4700
- cleanupFoundryStorageForDiffing(layoutBefore),
4701
- null,
4702
- 2
4703
- );
4704
- const afterString = JSON.stringify(
4705
- cleanupFoundryStorageForDiffing(layoutAfter),
4706
- null,
4707
- 2
4708
- );
4709
- return createPatch("storage", beforeString, afterString);
4710
- }
4711
-
4712
4658
  // src/ecosystem/event-db.ts
4713
4659
  var EVENT_DB = [];
4714
4660
 
@@ -16258,7 +16204,7 @@ var chainlinkFeeds = {
16258
16204
  };
16259
16205
 
16260
16206
  // src/operations/diffCode.ts
16261
- import { createPatch as createPatch2, createTwoFilesPatch } from "diff";
16207
+ import { createPatch, createTwoFilesPatch } from "diff";
16262
16208
  import { format } from "prettier/standalone";
16263
16209
  import solidityPlugin from "prettier-plugin-solidity/standalone";
16264
16210
  var prettierOptions = { parser: "solidity-parse", plugins: [solidityPlugin] };
@@ -16267,7 +16213,7 @@ async function diffCode(before, after) {
16267
16213
  const settingsBefore = JSON.stringify(before.settings, null, 2);
16268
16214
  const settingsAfter = JSON.stringify(after.settings, null, 2);
16269
16215
  if (settingsBefore !== settingsAfter)
16270
- changes.settings = createPatch2("settings", settingsBefore, settingsAfter);
16216
+ changes.settings = createPatch("settings", settingsBefore, settingsAfter);
16271
16217
  const contractsBefore = await Promise.all(
16272
16218
  Object.entries(before.sources).map(async ([path, source]) => [
16273
16219
  path.replace(/^.*[\\/]/, ""),
@@ -16285,7 +16231,7 @@ async function diffCode(before, after) {
16285
16231
  for (const [name, path, source] of contractsBefore) {
16286
16232
  const indexAfter = contractsAfter.findIndex(([_name]) => _name === name);
16287
16233
  if (indexAfter === -1) {
16288
- changes[name] = createPatch2(path, source, "");
16234
+ changes[name] = createPatch(path, source, "");
16289
16235
  } else {
16290
16236
  if (source !== contractsAfter[indexAfter][2])
16291
16237
  changes[name] = createTwoFilesPatch(
@@ -16299,7 +16245,7 @@ async function diffCode(before, after) {
16299
16245
  for (const [name, path, source] of contractsAfter) {
16300
16246
  const indexAfter = contractsBefore.findIndex(([_name]) => _name === name);
16301
16247
  if (indexAfter === -1) {
16302
- changes[name] = createPatch2(path, "", source);
16248
+ changes[name] = createPatch(path, "", source);
16303
16249
  }
16304
16250
  }
16305
16251
  return changes;
@@ -24277,15 +24223,12 @@ export {
24277
24223
  decodeReserveConfigurationV2,
24278
24224
  decodeUserConfiguration,
24279
24225
  diffCode,
24280
- diffFoundryStorageLayout,
24281
24226
  erc1967_AdminSlot,
24282
24227
  erc1967_ImplementationSlot,
24283
24228
  etherscanExplorers,
24284
24229
  fetchPoolAddresses,
24285
24230
  flashbotsClientExtension,
24286
24231
  flashbotsOnFetchRequest,
24287
- foundry_getStandardJsonInput,
24288
- foundry_getStorageLayout,
24289
24232
  getAlchemyRPC,
24290
24233
  getBits,
24291
24234
  getClient,