From cf981c7018fafa3ee89e6604f4afa6109adbb8b6 Mon Sep 17 00:00:00 2001 From: Gustavo Grieco <31542053+ggrieco-tob@users.noreply.github.com> Date: Wed, 7 Feb 2024 13:30:20 +0100 Subject: [PATCH 1/3] Improve handling of "version" string from Etherscan --- crytic_compile/platform/etherscan.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crytic_compile/platform/etherscan.py b/crytic_compile/platform/etherscan.py index a8f54b43..ddb1bb07 100644 --- a/crytic_compile/platform/etherscan.py +++ b/crytic_compile/platform/etherscan.py @@ -474,7 +474,9 @@ def _convert_version(version: str) -> str: Returns: str: converted version """ - return version[1 : version.find("+")] + if "+" in version: + return version[1 : version.find("+")] + return version def _sanitize_remappings( From 1bc8da8cef922ef52cc3e71f16b3567675e3da56 Mon Sep 17 00:00:00 2001 From: Gustavo Grieco <31542053+ggrieco-tob@users.noreply.github.com> Date: Wed, 7 Feb 2024 13:51:23 +0100 Subject: [PATCH 2/3] Update etherscan.py --- crytic_compile/platform/etherscan.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crytic_compile/platform/etherscan.py b/crytic_compile/platform/etherscan.py index ddb1bb07..b16f4b5a 100644 --- a/crytic_compile/platform/etherscan.py +++ b/crytic_compile/platform/etherscan.py @@ -476,7 +476,7 @@ def _convert_version(version: str) -> str: """ if "+" in version: return version[1 : version.find("+")] - return version + return version[1 : ] def _sanitize_remappings( From ad9bf301e5bf12f241fed5fe0cedfda704c2fab2 Mon Sep 17 00:00:00 2001 From: Gustavo Grieco <31542053+ggrieco-tob@users.noreply.github.com> Date: Wed, 7 Feb 2024 14:09:22 +0100 Subject: [PATCH 3/3] fixed lint --- crytic_compile/platform/etherscan.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crytic_compile/platform/etherscan.py b/crytic_compile/platform/etherscan.py index b16f4b5a..da53c0aa 100644 --- a/crytic_compile/platform/etherscan.py +++ b/crytic_compile/platform/etherscan.py @@ -476,7 +476,7 @@ def _convert_version(version: str) -> str: """ if "+" in version: return version[1 : version.find("+")] - return version[1 : ] + return version[1:] def _sanitize_remappings(