Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix parsing issue when using Medusa 0.1.3 #29

Merged
merged 3 commits into from
Mar 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions fuzz_utils/fuzzers/Medusa.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,17 @@ def _parse_call_object(self, call_dict: dict) -> tuple[str, str]:
time_delay = int(call_dict["blockTimestampDelay"])
block_delay = int(call_dict["blockNumberDelay"])
has_delay = time_delay > 0 or block_delay > 0
function_name: str = ""

# TODO check how Medusa handles empty calls

function_name = call_dict["call"]["dataAbiValues"]["methodName"]
if "methodName" in call_dict["call"]["dataAbiValues"]:
function_name = call_dict["call"]["dataAbiValues"]["methodName"]
elif "methodSignature" in call_dict["call"]["dataAbiValues"]:
function_name = call_dict["call"]["dataAbiValues"]["methodSignature"].split("(")[0]
else:
handle_exit(
"There was an issue parsing the Medusa call sequences. This indicates a breaking change in the call sequence format, please open an issue at https://github.com/crytic/fuzz-utils/issues"
)
function_parameters = call_dict["call"]["dataAbiValues"]["inputValues"]
if len(function_parameters) == 0:
function_parameters = ""
Expand Down
Loading