From dded959beb7d3e1ed3ebd54d78252f139a0173f6 Mon Sep 17 00:00:00 2001 From: alpharush <0xalpharush@protonmail.com> Date: Wed, 18 Oct 2023 09:18:57 -0500 Subject: [PATCH] revert https://github.com/crytic/slither/pull/2105 (#2185) --- slither/printers/guidance/echidna.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/slither/printers/guidance/echidna.py b/slither/printers/guidance/echidna.py index c729779ce..0c47fa0f9 100644 --- a/slither/printers/guidance/echidna.py +++ b/slither/printers/guidance/echidna.py @@ -138,12 +138,17 @@ def _extract_assert(contracts: List[Contract]) -> Dict[str, Dict[str, List[Dict] """ ret: Dict[str, Dict[str, List[Dict]]] = {} for contract in contracts: - functions_using_assert: Dict[str, List[Dict]] = defaultdict(list) + functions_using_assert = [] # Dict[str, List[Dict]] = defaultdict(list) for f in contract.functions_entry_points: - for node in f.all_nodes(): - if SolidityFunction("assert(bool)") in node.solidity_calls and node.source_mapping: - func_name = _get_name(f) - functions_using_assert[func_name].append(node.source_mapping.to_json()) + for v in f.all_solidity_calls(): + if v == SolidityFunction("assert(bool)"): + functions_using_assert.append(_get_name(f)) + break + # Revert https://github.com/crytic/slither/pull/2105 until format is supported by echidna. + # for node in f.all_nodes(): + # if SolidityFunction("assert(bool)") in node.solidity_calls and node.source_mapping: + # func_name = _get_name(f) + # functions_using_assert[func_name].append(node.source_mapping.to_json()) if functions_using_assert: ret[contract.name] = functions_using_assert return ret