Skip to content

Commit a5cddc5

Browse files
committed
platform: etherscan: support ETHERSCAN_API_KEY environment variable
Fixes #567
1 parent 0d121d1 commit a5cddc5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

crytic_compile/platform/etherscan.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,8 @@ def compile(self, crytic_compile: "CryticCompile", **kwargs: str) -> None:
310310
only_bytecode = kwargs.get("etherscan_only_bytecode", False)
311311

312312
etherscan_api_key = kwargs.get("etherscan_api_key", None)
313+
if etherscan_api_key is None:
314+
etherscan_api_key = os.getenv("ETHERSCAN_API_KEY")
313315

314316
export_dir = kwargs.get("export_dir", "crytic-export")
315317
export_dir = os.path.join(

0 commit comments

Comments
 (0)