Skip to content

Commit dded959

Browse files
authored
revert #2105 (#2185)
1 parent c04e860 commit dded959

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

slither/printers/guidance/echidna.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,17 @@ def _extract_assert(contracts: List[Contract]) -> Dict[str, Dict[str, List[Dict]
138138
"""
139139
ret: Dict[str, Dict[str, List[Dict]]] = {}
140140
for contract in contracts:
141-
functions_using_assert: Dict[str, List[Dict]] = defaultdict(list)
141+
functions_using_assert = [] # Dict[str, List[Dict]] = defaultdict(list)
142142
for f in contract.functions_entry_points:
143-
for node in f.all_nodes():
144-
if SolidityFunction("assert(bool)") in node.solidity_calls and node.source_mapping:
145-
func_name = _get_name(f)
146-
functions_using_assert[func_name].append(node.source_mapping.to_json())
143+
for v in f.all_solidity_calls():
144+
if v == SolidityFunction("assert(bool)"):
145+
functions_using_assert.append(_get_name(f))
146+
break
147+
# Revert https://github.com/crytic/slither/pull/2105 until format is supported by echidna.
148+
# for node in f.all_nodes():
149+
# if SolidityFunction("assert(bool)") in node.solidity_calls and node.source_mapping:
150+
# func_name = _get_name(f)
151+
# functions_using_assert[func_name].append(node.source_mapping.to_json())
147152
if functions_using_assert:
148153
ret[contract.name] = functions_using_assert
149154
return ret

0 commit comments

Comments
 (0)