You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "/home/internos/.local/lib/python3.10/site-packages/slither/__main__.py", line 826, in main_impl
) = process_all(filename, args, detector_classes, printer_classes)
File "/home/internos/.local/lib/python3.10/site-packages/slither/__main__.py", line 97, in process_all
) = process_single(compilation, args, detector_classes, printer_classes)
File "/home/internos/.local/lib/python3.10/site-packages/slither/__main__.py", line 77, in process_single
return _process(slither, detector_classes, printer_classes)
File "/home/internos/.local/lib/python3.10/site-packages/slither/__main__.py", line 133, in _process
printer_results = slither.run_printers()
File "/home/internos/.local/lib/python3.10/site-packages/slither/slither.py", line 218, in run_printers
return [p.output(self._crytic_compile.target).data for p in self._printers]
File "/home/internos/.local/lib/python3.10/site-packages/slither/slither.py", line 218, in <listcomp>
return [p.output(self._crytic_compile.target).data for p in self._printers]
File "/home/internos/.local/lib/python3.10/site-packages/slither/printers/call/call_graph.py", line 244, in output
["strict digraph {"] + [_process_functions(all_functions_as_dict.values())] + ["}"]
File "/home/internos/.local/lib/python3.10/site-packages/slither/printers/call/call_graph.py", line 180, in _process_functions
all_contracts.add(function.contract_declarer)
AttributeError: 'FunctionTopLevel' object has no attribute 'contract_declarer'
Error in .
Traceback (most recent call last):
File "/home/internos/.local/lib/python3.10/site-packages/slither/__main__.py", line 826, in main_impl
) = process_all(filename, args, detector_classes, printer_classes)
File "/home/internos/.local/lib/python3.10/site-packages/slither/__main__.py", line 97, in process_all
) = process_single(compilation, args, detector_classes, printer_classes)
File "/home/internos/.local/lib/python3.10/site-packages/slither/__main__.py", line 77, in process_single
return _process(slither, detector_classes, printer_classes)
File "/home/internos/.local/lib/python3.10/site-packages/slither/__main__.py", line 133, in _process
printer_results = slither.run_printers()
File "/home/internos/.local/lib/python3.10/site-packages/slither/slither.py", line 218, in run_printers
return [p.output(self._crytic_compile.target).data for p in self._printers]
File "/home/internos/.local/lib/python3.10/site-packages/slither/slither.py", line 218, in <listcomp>
return [p.output(self._crytic_compile.target).data for p in self._printers]
File "/home/internos/.local/lib/python3.10/site-packages/slither/printers/call/call_graph.py", line 244, in output
["strict digraph {"] + [_process_functions(all_functions_as_dict.values())] + ["}"]
File "/home/internos/.local/lib/python3.10/site-packages/slither/printers/call/call_graph.py", line 180, in _process_functions
all_contracts.add(function.contract_declarer)
AttributeError: 'FunctionTopLevel' object has no attribute 'contract_declarer'
When I try execute following command: slither . --print call-graph
Does anyone have any idea what it could be?
Or where I need to dig to solve this problem?
The text was updated successfully, but these errors were encountered:
This printer doesn't seem to support functions declared outside of contracts. Until it's fixed the only work around is to move the function into the contract:
Change
function toplevel(uint a, uint b) pure returns(uint) {
return a + b;
}
contract BaseContract{
address a;
function callgaph() external {
toplevel(1, 2);
}
}
to this
contract BaseContract{
address a;
function toplevel(uint a, uint b) internal returns(uint) {
return a + b;
}
function callgaph() external {
toplevel(1, 2);
}
}
0xalpharush
changed the title
When I run slither . --print call-graph I get: AttributeError: 'FunctionTopLevel' object has no attribute 'contract_declarer'
call graph printer does not support top level functions
Oct 19, 2022
Compiled with hardhat.
I faced an issue(log):
When I try execute following command: slither . --print call-graph
Does anyone have any idea what it could be?
Or where I need to dig to solve this problem?
The text was updated successfully, but these errors were encountered: