A TypeScript utility for parsing Medusa and Echidna fuzzing logs.
Used in:
https://www.npmjs.com/package/@recon-fuzz/log-parser
yarn add @recon-fuzz/log-parser
import { processLogs, Fuzzer } from '@recon-fuzz/log-parser';
// Process Medusa logs
const medusaResults = processLogs(medusaLogContent, Fuzzer.MEDUSA);
// Process Echidna logs
const echidnaResults = processLogs(echidnaLogContent, Fuzzer.ECHIDNA);
Processes fuzzing logs and returns structured results.
logs: string
- The raw log content as a stringtool: Fuzzer
- The fuzzer tool used (Fuzzer.MEDUSA or Fuzzer.ECHIDNA)
interface FuzzingResults {
duration: string;
coverage: number;
failed: number;
passed: number;
results: any[];
traces: any[];
brokenProperties: any[];
numberOfTests: number;
}
Both Medusa and Echidna logs can be converted into Foundry test cases using the provided utility functions:
// For Echidna logs
import { echidnaLogsToFunctions } from '@recon-fuzz/log-parser';
const foundryTest = echidnaLogsToFunctions(
echidnaLogs,
"test_identifier",
"brokenProperty",
{ roll: true, time: true, prank: true }
);
// For Medusa logs
import { medusaLogsToFunctions } from '@recon-fuzz/log-parser';
const foundryTest = medusaLogsToFunctions(
medusaLogs,
"test_identifier",
{ roll: true, time: true, prank: true }
);
The conversion handles:
- VM state manipulation (block numbers, timestamps)
- Actor simulation (pranks for different senders)
- Function call sequences
- Special data types (addresses, bytes)
Generated tests will include the exact sequence of calls that triggered the property violation, making it easy to reproduce and debug issues found during fuzzing.
- Node.js (>= 14.x)
- yarn or npm
- Clone the repository
- Install dependencies:
yarn install
yarn build
- Build the packageyarn test
- Run testsyarn lint
- Run linting