Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

261 dup: contracts file path must be first for transform #345

Merged
merged 3 commits into from
Jan 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion crytic_compile/platform/etherscan.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,9 @@ def _handle_multiple_files(
filtered_paths: List[str] = []
for filename, source_code in source_codes.items():
path_filename = PurePosixPath(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 = PurePosixPath(
*path_filename.parts[path_filename.parts.index("contracts") :]
)
Expand Down