From fa4ca2c454da4500ecf9ce4d0c1f38185a1552f4 Mon Sep 17 00:00:00 2001 From: aga7hokakological Date: Thu, 6 Apr 2023 00:22:43 +0530 Subject: [PATCH 1/2] fixed: changed name of the printer pausable -> not-pausable --- slither/printers/summary/when_not_paused.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slither/printers/summary/when_not_paused.py b/slither/printers/summary/when_not_paused.py index d8a57b6c79..c45f32d5ba 100644 --- a/slither/printers/summary/when_not_paused.py +++ b/slither/printers/summary/when_not_paused.py @@ -23,7 +23,7 @@ def _use_modifier(function: Function, modifier_name: str = "whenNotPaused") -> b class PrinterWhenNotPaused(AbstractPrinter): - ARGUMENT = "pausable" + ARGUMENT = "not-pausable" HELP = "Print functions that do not use whenNotPaused" WIKI = "https://github.com/trailofbits/slither/wiki/Printer-documentation#when-not-paused" From 82960f387c0216b94e2ee404e882a2da30c88e08 Mon Sep 17 00:00:00 2001 From: aga7hokakological Date: Thu, 6 Apr 2023 00:25:52 +0530 Subject: [PATCH 2/2] fixed: pausable printer includes checks on constructor() --- slither/printers/summary/when_not_paused.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/slither/printers/summary/when_not_paused.py b/slither/printers/summary/when_not_paused.py index c45f32d5ba..aaeeeacec2 100644 --- a/slither/printers/summary/when_not_paused.py +++ b/slither/printers/summary/when_not_paused.py @@ -10,8 +10,6 @@ def _use_modifier(function: Function, modifier_name: str = "whenNotPaused") -> bool: - if function.is_constructor or function.view or function.pure: - return False for internal_call in function.all_internal_calls(): if isinstance(internal_call, SolidityFunction): @@ -46,6 +44,8 @@ def output(self, _filename: str) -> output.Output: table = MyPrettyTable(["Name", "Use whenNotPaused"]) for function in contract.functions_entry_points: + if function.is_constructor or function.view or function.pure: + continue status = "X" if _use_modifier(function, modifier_name) else "" table.add_row([function.solidity_signature, status])