From e1966fa48a504beaf98f85b938d2686abd948727 Mon Sep 17 00:00:00 2001 From: Jacob Date: Sun, 24 Apr 2022 21:49:14 -0700 Subject: [PATCH 1/2] contracts file path must be first for transform --- 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 e83b206a..4a16efaf 100644 --- a/crytic_compile/platform/etherscan.py +++ b/crytic_compile/platform/etherscan.py @@ -148,7 +148,9 @@ def _handle_multiple_files( filtered_paths: List[str] = [] for filename, source_code in source_codes.items(): path_filename = Path(filename) - if "contracts" in path_filename.parts and not filename.startswith("@"): + # https://etherscan.io/address/0x19bb64b80cbf61e61965b0e5c2560cc7364c6546#code has an import of erc721a/contracts/ERC721A.sol + # if the full path is lost then won't compile + if "contracts" == path_filename.parts[0] and not filename.startswith("@"): path_filename = Path(*path_filename.parts[path_filename.parts.index("contracts") :]) filtered_paths.append(str(path_filename)) From bc07da51fd2aa805c2b539ad6869d0f8232178ab Mon Sep 17 00:00:00 2001 From: bohendo Date: Fri, 6 Jan 2023 13:06:50 -0500 Subject: [PATCH 2/2] rm trailing whitespace --- 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 9f4a989b..7960471c 100644 --- a/crytic_compile/platform/etherscan.py +++ b/crytic_compile/platform/etherscan.py @@ -153,7 +153,7 @@ def _handle_multiple_files( for filename, source_code in source_codes.items(): path_filename = PurePosixPath(filename) # https://etherscan.io/address/0x19bb64b80cbf61e61965b0e5c2560cc7364c6546#code has an import of erc721a/contracts/ERC721A.sol - # if the full path is lost then won't compile + # if the full path is lost then won't compile if "contracts" == path_filename.parts[0] and not filename.startswith("@"): path_filename = PurePosixPath( *path_filename.parts[path_filename.parts.index("contracts") :]