Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions slither/printers/call/call_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,9 @@ def output(self, filename: str) -> Output:
]
all_functions = [item for sublist in all_functionss for item in sublist]
all_functions_as_dict = {
function.canonical_name: function for function in all_functions
function.canonical_name: function
for function in all_functions
if not function.is_constructor_variables
}
content = "\n".join(
["strict digraph {"]
Expand All @@ -352,7 +354,15 @@ def output(self, filename: str) -> Output:
["strict digraph {"]
+ ['rankdir="LR"']
+ ["node [shape=box]"]
+ [_process_functions(derived_contract.functions)]
+ [
_process_functions(
[
f
for f in derived_contract.functions
if not f.is_constructor_variables
]
)
]
+ ["}"]
)
f.write(content)
Expand Down
2 changes: 2 additions & 0 deletions slither/printers/functions/authorization.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ def output(self, _filename: str) -> Output:
["Function", "State variables written", "Conditions on msg.sender"]
)
for function in contract.functions:
if function.is_constructor_variables:
continue
state_variables_written = [
v.name for v in function.all_state_variables_written() if v.name
]
Expand Down
2 changes: 2 additions & 0 deletions slither/printers/functions/cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ def output(self, filename: str) -> Output:
all_files = []
for contract in self.contracts: # type: ignore
for function in contract.functions + list(contract.modifiers):
if function.is_constructor_variables:
continue
if filename:
new_filename = f"{filename}-{contract.name}-{function.full_name}.dot"
else:
Expand Down
2 changes: 2 additions & 0 deletions slither/printers/functions/dominator.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ def output(self, filename: str) -> Output:
all_files = []
for contract in self.contracts:
for function in contract.functions + contract.modifiers:
if function.is_constructor_variables:
continue
if filename:
new_filename = f"{filename}-{contract.name}-{function.full_name}.dot"
else:
Expand Down
2 changes: 2 additions & 0 deletions slither/printers/summary/evm.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ def output(self, _filename):
continue

for function in contract.functions:
if function.is_constructor_variables:
continue
txt += blue(f"\tFunction {function.canonical_name}\n")

txt += self.build_element_node_str(
Expand Down
2 changes: 2 additions & 0 deletions slither/printers/summary/modifier_calls.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ def output(self, _filename):
txt = f"\nContract {contract.name}"
table = MyPrettyTable(["Function", "Modifiers"])
for function in contract.functions:
if function.is_constructor_variables:
continue
modifiers = function.modifiers
for ir in function.all_internal_calls():
if isinstance(ir.function, Function):
Expand Down
2 changes: 2 additions & 0 deletions slither/printers/summary/require_calls.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ def output(self, _filename):
txt = f"\nContract {contract.name}"
table = MyPrettyTable(["Function", "require or assert"])
for function in contract.functions:
if function.is_constructor_variables:
continue
require = function.all_slithir_operations()
require = [
ir
Expand Down
2 changes: 2 additions & 0 deletions slither/printers/summary/slithir.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ def output(self, _filename):
for contract in compilation_unit.contracts:
txt += f"Contract {contract.name}\n"
for function in contract.functions:
if function.is_constructor_variables:
continue
txt += f"\tFunction {function.canonical_name} {'' if function.is_shadowed else '(*)'}\n"
txt += _print_function(function)
for modifier in contract.modifiers:
Expand Down
2 changes: 2 additions & 0 deletions slither/printers/summary/slithir_ssa.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ def output(self, _filename):
for contract in self.contracts:
txt += f"Contract {contract.name}" + "\n"
for function in contract.functions:
if function.is_constructor_variables:
continue
txt += f"\tFunction {function.canonical_name}" + "\n"
for node in function.nodes:
if node.expression:
Expand Down