@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-m0rinBbj.d.mts +22352 -0
- package/dist/index-m0rinBbj.d.ts +22352 -0
- package/dist/index.d.mts +6 -22388
- package/dist/index.d.ts +6 -22388
- package/dist/index.js +5 -65
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -61
- package/dist/index.mjs.map +1 -1
- package/dist/node.d.mts +45 -0
- package/dist/node.d.ts +45 -0
- package/dist/node.js +24406 -0
- package/dist/node.js.map +1 -0
- package/dist/node.mjs +24334 -0
- package/dist/node.mjs.map +1 -0
- package/package.json +5 -4
package/dist/index.js
CHANGED
|
@@ -76,15 +76,12 @@ __export(index_exports, {
|
|
|
76
76
|
decodeReserveConfigurationV2: () => decodeReserveConfigurationV2,
|
|
77
77
|
decodeUserConfiguration: () => decodeUserConfiguration,
|
|
78
78
|
diffCode: () => diffCode,
|
|
79
|
-
diffFoundryStorageLayout: () => diffFoundryStorageLayout,
|
|
80
79
|
erc1967_AdminSlot: () => erc1967_AdminSlot,
|
|
81
80
|
erc1967_ImplementationSlot: () => erc1967_ImplementationSlot,
|
|
82
81
|
etherscanExplorers: () => etherscanExplorers,
|
|
83
82
|
fetchPoolAddresses: () => fetchPoolAddresses,
|
|
84
83
|
flashbotsClientExtension: () => flashbotsClientExtension,
|
|
85
84
|
flashbotsOnFetchRequest: () => flashbotsOnFetchRequest,
|
|
86
|
-
foundry_getStandardJsonInput: () => foundry_getStandardJsonInput,
|
|
87
|
-
foundry_getStorageLayout: () => foundry_getStorageLayout,
|
|
88
85
|
getAlchemyRPC: () => getAlchemyRPC,
|
|
89
86
|
getBits: () => getBits,
|
|
90
87
|
getClient: () => getClient,
|
|
@@ -4766,60 +4763,6 @@ async function tenderly_sim({ accountSlug, projectSlug, accessToken }, body) {
|
|
|
4766
4763
|
return response.json();
|
|
4767
4764
|
}
|
|
4768
4765
|
|
|
4769
|
-
// src/ecosystem/foundry.ts
|
|
4770
|
-
var import_node_child_process = require("child_process");
|
|
4771
|
-
var import_diff = require("diff");
|
|
4772
|
-
function foundry_getStandardJsonInput(input) {
|
|
4773
|
-
const output = JSON.parse(
|
|
4774
|
-
(0, import_node_child_process.execSync)(
|
|
4775
|
-
`forge verify-contract --show-standard-json-input --verifier etherscan 0x0000000000000000000000000000000000000000 ${input}`
|
|
4776
|
-
).toString()
|
|
4777
|
-
);
|
|
4778
|
-
return output;
|
|
4779
|
-
}
|
|
4780
|
-
function foundry_getStorageLayout(input) {
|
|
4781
|
-
const output = JSON.parse(
|
|
4782
|
-
(0, import_node_child_process.execSync)(`forge inspect ${input} storage --json`).toString()
|
|
4783
|
-
);
|
|
4784
|
-
return output;
|
|
4785
|
-
}
|
|
4786
|
-
function cleanupFoundryStorageForDiffing(layout) {
|
|
4787
|
-
const cleanTypes = { ...layout.types };
|
|
4788
|
-
for (const key of Object.keys(cleanTypes)) {
|
|
4789
|
-
if (cleanTypes[key].members)
|
|
4790
|
-
cleanTypes[key].members = cleanTypes[key].members.map((member) => ({
|
|
4791
|
-
label: member.label,
|
|
4792
|
-
contract: member.contract.split(":")[1],
|
|
4793
|
-
offset: member.offset,
|
|
4794
|
-
slot: member.slot,
|
|
4795
|
-
type: member.type
|
|
4796
|
-
}));
|
|
4797
|
-
if (cleanTypes[key].value)
|
|
4798
|
-
cleanTypes[key].value = cleanTypes[cleanTypes[key].value];
|
|
4799
|
-
}
|
|
4800
|
-
const cleanStorage = layout.storage.map((storage) => ({
|
|
4801
|
-
label: storage.label,
|
|
4802
|
-
slot: storage.slot,
|
|
4803
|
-
offset: storage.offset,
|
|
4804
|
-
type: cleanTypes[storage.type],
|
|
4805
|
-
contract: storage.contract.split(":")[1]
|
|
4806
|
-
}));
|
|
4807
|
-
return cleanStorage;
|
|
4808
|
-
}
|
|
4809
|
-
function diffFoundryStorageLayout(layoutBefore, layoutAfter) {
|
|
4810
|
-
const beforeString = JSON.stringify(
|
|
4811
|
-
cleanupFoundryStorageForDiffing(layoutBefore),
|
|
4812
|
-
null,
|
|
4813
|
-
2
|
|
4814
|
-
);
|
|
4815
|
-
const afterString = JSON.stringify(
|
|
4816
|
-
cleanupFoundryStorageForDiffing(layoutAfter),
|
|
4817
|
-
null,
|
|
4818
|
-
2
|
|
4819
|
-
);
|
|
4820
|
-
return (0, import_diff.createPatch)("storage", beforeString, afterString);
|
|
4821
|
-
}
|
|
4822
|
-
|
|
4823
4766
|
// src/ecosystem/event-db.ts
|
|
4824
4767
|
var EVENT_DB = [];
|
|
4825
4768
|
|
|
@@ -16331,7 +16274,7 @@ var chainlinkFeeds = {
|
|
|
16331
16274
|
};
|
|
16332
16275
|
|
|
16333
16276
|
// src/operations/diffCode.ts
|
|
16334
|
-
var
|
|
16277
|
+
var import_diff = require("diff");
|
|
16335
16278
|
var import_standalone = require("prettier/standalone");
|
|
16336
16279
|
var import_standalone2 = __toESM(require("prettier-plugin-solidity/standalone"));
|
|
16337
16280
|
var prettierOptions = { parser: "solidity-parse", plugins: [import_standalone2.default] };
|
|
@@ -16340,7 +16283,7 @@ async function diffCode(before, after) {
|
|
|
16340
16283
|
const settingsBefore = JSON.stringify(before.settings, null, 2);
|
|
16341
16284
|
const settingsAfter = JSON.stringify(after.settings, null, 2);
|
|
16342
16285
|
if (settingsBefore !== settingsAfter)
|
|
16343
|
-
changes.settings = (0,
|
|
16286
|
+
changes.settings = (0, import_diff.createPatch)("settings", settingsBefore, settingsAfter);
|
|
16344
16287
|
const contractsBefore = await Promise.all(
|
|
16345
16288
|
Object.entries(before.sources).map(async ([path, source]) => [
|
|
16346
16289
|
path.replace(/^.*[\\/]/, ""),
|
|
@@ -16358,10 +16301,10 @@ async function diffCode(before, after) {
|
|
|
16358
16301
|
for (const [name, path, source] of contractsBefore) {
|
|
16359
16302
|
const indexAfter = contractsAfter.findIndex(([_name]) => _name === name);
|
|
16360
16303
|
if (indexAfter === -1) {
|
|
16361
|
-
changes[name] = (0,
|
|
16304
|
+
changes[name] = (0, import_diff.createPatch)(path, source, "");
|
|
16362
16305
|
} else {
|
|
16363
16306
|
if (source !== contractsAfter[indexAfter][2])
|
|
16364
|
-
changes[name] = (0,
|
|
16307
|
+
changes[name] = (0, import_diff.createTwoFilesPatch)(
|
|
16365
16308
|
path,
|
|
16366
16309
|
contractsAfter[indexAfter][1],
|
|
16367
16310
|
source,
|
|
@@ -16372,7 +16315,7 @@ async function diffCode(before, after) {
|
|
|
16372
16315
|
for (const [name, path, source] of contractsAfter) {
|
|
16373
16316
|
const indexAfter = contractsBefore.findIndex(([_name]) => _name === name);
|
|
16374
16317
|
if (indexAfter === -1) {
|
|
16375
|
-
changes[name] = (0,
|
|
16318
|
+
changes[name] = (0, import_diff.createPatch)(path, "", source);
|
|
16376
16319
|
}
|
|
16377
16320
|
}
|
|
16378
16321
|
return changes;
|
|
@@ -24349,15 +24292,12 @@ var IAuthorizedForwarder_ABI = [
|
|
|
24349
24292
|
decodeReserveConfigurationV2,
|
|
24350
24293
|
decodeUserConfiguration,
|
|
24351
24294
|
diffCode,
|
|
24352
|
-
diffFoundryStorageLayout,
|
|
24353
24295
|
erc1967_AdminSlot,
|
|
24354
24296
|
erc1967_ImplementationSlot,
|
|
24355
24297
|
etherscanExplorers,
|
|
24356
24298
|
fetchPoolAddresses,
|
|
24357
24299
|
flashbotsClientExtension,
|
|
24358
24300
|
flashbotsOnFetchRequest,
|
|
24359
|
-
foundry_getStandardJsonInput,
|
|
24360
|
-
foundry_getStorageLayout,
|
|
24361
24301
|
getAlchemyRPC,
|
|
24362
24302
|
getBits,
|
|
24363
24303
|
getClient,
|