Skip to content

Commit

Permalink
Merge pull request #29 from crytic/fix-medusa-parsing-issue
Browse files Browse the repository at this point in the history
Fix parsing issue when using Medusa 0.1.3
  • Loading branch information
tuturu-tech authored Mar 25, 2024
2 parents 0566b9d + 713a261 commit d2e9c8b
Showing 1 changed file with 9 additions and 2 deletions.
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

0 comments on commit d2e9c8b

Please sign in to comment.