Skip to content

Commit 9dcbea3

Browse files
committed
optimistic support
1 parent 6980c9a commit 9dcbea3

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

crytic_compile/cryticparser/cryticparser.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,14 @@ def _init_etherscan(parser: ArgumentParser) -> None:
352352
default=DEFAULTS_FLAG_IN_CONFIG["etherscan_api_key"],
353353
)
354354

355+
group_etherscan.add_argument(
356+
"--optim-apikey",
357+
help="Optimistic API key.",
358+
action="store",
359+
dest="optim_api_key",
360+
default=DEFAULTS_FLAG_IN_CONFIG["etherscan_api_key"],
361+
)
362+
355363
group_etherscan.add_argument(
356364
"--etherscan-export-directory",
357365
help="Directory in which to save the analyzed contracts.",

crytic_compile/platform/etherscan.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ def compile(self, crytic_compile: "CryticCompile", **kwargs: str) -> None:
209209
avax_api_key = kwargs.get("avax_api_key", None)
210210
ftmscan_api_key = kwargs.get("ftmscan_api_key", None)
211211
bscan_api_key = kwargs.get("bscan_api_key", None)
212+
optim_api_key = kwargs.get("optim_api_key", None)
212213

213214
export_dir = kwargs.get("export_dir", "crytic-export")
214215
export_dir = os.path.join(
@@ -233,6 +234,9 @@ def compile(self, crytic_compile: "CryticCompile", **kwargs: str) -> None:
233234
if bscan_api_key and "bscscan" in etherscan_url:
234235
etherscan_url += f"&apikey={bscan_api_key}"
235236
etherscan_bytecode_url += f"&apikey={bscan_api_key}"
237+
if optim_api_key and "optim" in etherscan_url:
238+
etherscan_url += f"&apikey={optim_api_key}"
239+
etherscan_bytecode_url += f"&apikey={optim_api_key}"
236240

237241
source_code: str = ""
238242
result: Dict[str, Union[bool, str, int]] = {}

0 commit comments

Comments
 (0)