From a25cb21adc955dd2240a78612288f62bdd0ea821 Mon Sep 17 00:00:00 2001 From: Sidarth S <38394431+sidarth16@users.noreply.github.com> Date: Wed, 9 Jul 2025 12:14:25 +0530 Subject: [PATCH] Fix #2747: Deduplicate functions in get_msg_sender_checks to avoid repeated msg.sender conditions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix: Deduplicate functions in get_msg_sender_checks to avoid repeated msg.sender conditions (#2747) This resolves an issue where the `authorization` printer would output duplicate msg.sender checks due to modifiers being included both in `function.all_internal_calls()` and explicitly in `function.modifiers`. ✅ Applied Fix (safe): - Wraps the combined function list in a `set()` to deduplicate `Function` instances. - Ensures complete analysis while avoiding repeated conditions in output. --- slither/printers/functions/authorization.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slither/printers/functions/authorization.py b/slither/printers/functions/authorization.py index 288392a468..9d10a7d05f 100644 --- a/slither/printers/functions/authorization.py +++ b/slither/printers/functions/authorization.py @@ -18,7 +18,7 @@ class PrinterWrittenVariablesAndAuthorization(AbstractPrinter): @staticmethod def get_msg_sender_checks(function: Function) -> List[str]: - all_functions = ( + all_functions = set( [ ir.function for ir in function.all_internal_calls()