From fab8727844ff6a7d791580b72c0a7aeb92696d11 Mon Sep 17 00:00:00 2001 From: Gernot Salzer Date: Tue, 7 Jan 2025 18:49:16 +0100 Subject: [PATCH] Fix: search solc version in comments if regular pragma is missing --- mythril/ethereum/util.py | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/mythril/ethereum/util.py b/mythril/ethereum/util.py index 39038e660..5548b047f 100644 --- a/mythril/ethereum/util.py +++ b/mythril/ethereum/util.py @@ -168,18 +168,15 @@ def parse_pragma(solidity_code): all_versions = solcx.get_installed_solc_versions() -# remove_comments_strings(prg): -# Return Solidity program prg without comments and strings -# [SmartBugs, https://github.com/smartbugs/smartbugs/blob/master/sb/solidity.py] +# remove_comments_strings(str): +# Return str without Solidity comments and strings import re VOID_START = re.compile("//|/\\*|\"|'") QUOTE_END = re.compile("(?