recon-generate 0.0.15 → 0.0.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.
- package/dist/index.js +18 -0
- package/dist/info.d.ts +40 -0
- package/dist/info.js +1017 -0
- package/dist/z3Solver.d.ts +11 -0
- package/dist/z3Solver.js +425 -0
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -41,6 +41,7 @@ const generator_1 = require("./generator");
|
|
|
41
41
|
const wakeGenerator_1 = require("./wakeGenerator");
|
|
42
42
|
const coverage_1 = require("./coverage");
|
|
43
43
|
const pathsGenerator_1 = require("./pathsGenerator");
|
|
44
|
+
const info_1 = require("./info");
|
|
44
45
|
const utils_1 = require("./utils");
|
|
45
46
|
const link_1 = require("./link");
|
|
46
47
|
function parseFilter(input) {
|
|
@@ -192,6 +193,23 @@ async function main() {
|
|
|
192
193
|
: path.join(foundryRoot, medusaConfigOpt);
|
|
193
194
|
await (0, link_1.runLink)(foundryRoot, echidnaConfigPath, medusaConfigPath, !!opts.verbose);
|
|
194
195
|
});
|
|
196
|
+
program
|
|
197
|
+
.command('info <contractName>')
|
|
198
|
+
.description('Generate contract info JSON (payable, constants, function relations, etc.)')
|
|
199
|
+
.option('-o, --output <path>', 'Custom output path for the info JSON file')
|
|
200
|
+
.option('--json', 'Output JSON to terminal (also saves to file if -o is specified)')
|
|
201
|
+
.option('--foundry-config <path>', 'Path to foundry.toml (defaults to ./foundry.toml)')
|
|
202
|
+
.action(async function (contractName) {
|
|
203
|
+
// @ts-ignore - Commander types are complex
|
|
204
|
+
const opts = this.opts();
|
|
205
|
+
const workspaceRoot = process.cwd();
|
|
206
|
+
const foundryConfig = (0, utils_1.getFoundryConfigPath)(workspaceRoot, opts.foundryConfig);
|
|
207
|
+
const foundryRoot = path.dirname(foundryConfig);
|
|
208
|
+
const outputPath = opts.output
|
|
209
|
+
? (path.isAbsolute(opts.output) ? opts.output : path.join(foundryRoot, opts.output))
|
|
210
|
+
: undefined;
|
|
211
|
+
await (0, info_1.runInfo)(foundryRoot, contractName, { outputPath, json: !!opts.json });
|
|
212
|
+
});
|
|
195
213
|
program
|
|
196
214
|
.command('wake')
|
|
197
215
|
.description('Generate Python fuzzing suite using Wake framework')
|
package/dist/info.d.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
interface AssertInfo {
|
|
2
|
+
start: number;
|
|
3
|
+
length: number;
|
|
4
|
+
filename_relative: string;
|
|
5
|
+
filename_absolute: string;
|
|
6
|
+
filename_short: string;
|
|
7
|
+
is_dependency: boolean;
|
|
8
|
+
lines: number[];
|
|
9
|
+
starting_column: number;
|
|
10
|
+
ending_column: number;
|
|
11
|
+
}
|
|
12
|
+
interface ConstantValue {
|
|
13
|
+
value: string;
|
|
14
|
+
type: string;
|
|
15
|
+
}
|
|
16
|
+
interface CoverageBlock {
|
|
17
|
+
lines: string[];
|
|
18
|
+
absolutePath: string;
|
|
19
|
+
children: CoverageBlock[];
|
|
20
|
+
}
|
|
21
|
+
interface InfoOutput {
|
|
22
|
+
payable: Record<string, string[]>;
|
|
23
|
+
assert: Record<string, Record<string, AssertInfo[]>>;
|
|
24
|
+
constant_functions: Record<string, string[]>;
|
|
25
|
+
constants_used: Record<string, Record<string, ConstantValue[][]>>;
|
|
26
|
+
inheritances: Record<string, string[]>;
|
|
27
|
+
functions_relations: Record<string, Record<string, {
|
|
28
|
+
impacts: string[];
|
|
29
|
+
is_impacted_by: string[];
|
|
30
|
+
external?: string;
|
|
31
|
+
}>>;
|
|
32
|
+
with_fallback: string[];
|
|
33
|
+
with_receive: string[];
|
|
34
|
+
coverage_map: Record<string, Record<string, CoverageBlock>>;
|
|
35
|
+
}
|
|
36
|
+
export declare const runInfo: (foundryRoot: string, contractName: string, options?: {
|
|
37
|
+
outputPath?: string;
|
|
38
|
+
json?: boolean;
|
|
39
|
+
}) => Promise<InfoOutput>;
|
|
40
|
+
export {};
|