From fe6789bdc575cb57c38289db6b5f121d61e15cb5 Mon Sep 17 00:00:00 2001 From: Josselin Date: Mon, 11 Feb 2019 13:53:40 -0500 Subject: [PATCH] Fixed: - node.high_level_call: support call to this Changed: - use 'contracts.dot' as default name for printers exporting a dot file --- slither/core/cfg/node.py | 2 ++ slither/printers/call/call_graph.py | 3 +++ slither/printers/inheritance/inheritance_graph.py | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/slither/core/cfg/node.py b/slither/core/cfg/node.py index 7b15937e7..855871684 100644 --- a/slither/core/cfg/node.py +++ b/slither/core/cfg/node.py @@ -685,6 +685,8 @@ class Node(SourceMapping, ChildFunction): elif isinstance(ir, (HighLevelCall)) and not isinstance(ir, LibraryCall): if isinstance(ir.destination.type, Contract): self._high_level_calls.append((ir.destination.type, ir.function)) + elif ir.destination == SolidityVariable('this'): + self._high_level_calls.append((self.function.contract, ir.function)) else: self._high_level_calls.append((ir.destination.type.type, ir.function)) elif isinstance(ir, LibraryCall): diff --git a/slither/printers/call/call_graph.py b/slither/printers/call/call_graph.py index a68b7de49..ed5efdfae 100644 --- a/slither/printers/call/call_graph.py +++ b/slither/printers/call/call_graph.py @@ -142,6 +142,9 @@ class PrinterCallGraph(AbstractPrinter): Args: filename(string) """ + if not filename: + filename = "contracts.dot" + if not filename.endswith('.dot'): filename += '.dot' diff --git a/slither/printers/inheritance/inheritance_graph.py b/slither/printers/inheritance/inheritance_graph.py index 9897db4b2..468969002 100644 --- a/slither/printers/inheritance/inheritance_graph.py +++ b/slither/printers/inheritance/inheritance_graph.py @@ -171,7 +171,7 @@ class PrinterInheritanceGraph(AbstractPrinter): filename(string) """ if filename == '': - filename = 'export' + filename = 'contracts.dot' if not filename.endswith('.dot'): filename += ".dot" info = 'Inheritance Graph: ' + filename