Skip to content

Commit

Permalink
platform: etherscan: support ETHERSCAN_API_KEY environment variable
Browse files Browse the repository at this point in the history
Fixes #567
  • Loading branch information
elopez committed Oct 26, 2024
1 parent e8e879c commit de7ae2c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crytic_compile/platform/etherscan.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,8 @@ def compile(self, crytic_compile: "CryticCompile", **kwargs: str) -> None:
only_bytecode = kwargs.get("etherscan_only_bytecode", False)

etherscan_api_key = kwargs.get("etherscan_api_key", None)
if etherscan_api_key is None:
etherscan_api_key = os.getenv("ETHERSCAN_API_KEY")

export_dir = kwargs.get("export_dir", "crytic-export")
export_dir = os.path.join(
Expand Down

0 comments on commit de7ae2c

Please sign in to comment.