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

fix: conflict when multiple api keys provided #569

Closed
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
26 changes: 13 additions & 13 deletions crytic_compile/platform/etherscan.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,42 +249,42 @@ def compile(self, crytic_compile: "CryticCompile", **kwargs: str) -> None:
export_dir, kwargs.get("etherscan_export_dir", "etherscan-contracts")
)

if etherscan_api_key and "etherscan" in etherscan_url:
etherscan_url += f"&apikey={etherscan_api_key}"
etherscan_bytecode_url += f"&apikey={etherscan_api_key}"
if arbiscan_api_key and "arbiscan" in etherscan_url:
etherscan_url += f"&apikey={arbiscan_api_key}"
etherscan_bytecode_url += f"&apikey={arbiscan_api_key}"
if polygonscan_api_key and "polygonscan" in etherscan_url:
elif polygonscan_api_key and "polygonscan" in etherscan_url:
etherscan_url += f"&apikey={polygonscan_api_key}"
etherscan_bytecode_url += f"&apikey={polygonscan_api_key}"
if test_polygonscan_api_key and "polygonscan" in etherscan_url:
elif test_polygonscan_api_key and "polygonscan" in etherscan_url:
etherscan_url += f"&apikey={test_polygonscan_api_key}"
etherscan_bytecode_url += f"&apikey={test_polygonscan_api_key}"
if avax_api_key and "snowtrace" in etherscan_url:
elif avax_api_key and "snowtrace" in etherscan_url:
etherscan_url += f"&apikey={avax_api_key}"
etherscan_bytecode_url += f"&apikey={avax_api_key}"
if ftmscan_api_key and "ftmscan" in etherscan_url:
elif ftmscan_api_key and "ftmscan" in etherscan_url:
etherscan_url += f"&apikey={ftmscan_api_key}"
etherscan_bytecode_url += f"&apikey={ftmscan_api_key}"
if bscan_api_key and "bscscan" in etherscan_url:
elif bscan_api_key and "bscscan" in etherscan_url:
etherscan_url += f"&apikey={bscan_api_key}"
etherscan_bytecode_url += f"&apikey={bscan_api_key}"
if optim_api_key and "optim" in etherscan_url:
elif optim_api_key and "optim" in etherscan_url:
etherscan_url += f"&apikey={optim_api_key}"
etherscan_bytecode_url += f"&apikey={optim_api_key}"
if base_api_key and "base" in etherscan_url:
elif base_api_key and "base" in etherscan_url:
etherscan_url += f"&apikey={base_api_key}"
etherscan_bytecode_url += f"&apikey={base_api_key}"
if gno_api_key and "gno" in etherscan_url:
elif gno_api_key and "gno" in etherscan_url:
etherscan_url += f"&apikey={gno_api_key}"
etherscan_bytecode_url += f"&apikey={gno_api_key}"
if polyzk_api_key and "zkevm" in etherscan_url:
elif polyzk_api_key and "zkevm" in etherscan_url:
etherscan_url += f"&apikey={polyzk_api_key}"
etherscan_bytecode_url += f"&apikey={polyzk_api_key}"
if blast_api_key and "blast" in etherscan_url:
elif blast_api_key and "blast" in etherscan_url:
etherscan_url += f"&apikey={blast_api_key}"
etherscan_bytecode_url += f"&apikey={blast_api_key}"
elif etherscan_api_key and "etherscan" in etherscan_url:
etherscan_url += f"&apikey={etherscan_api_key}"
etherscan_bytecode_url += f"&apikey={etherscan_api_key}"

source_code: str = ""
result: Dict[str, Union[bool, str, int]] = {}
Expand Down
Loading