|
50 | 50 | "testnet.avax:": ("-testnet.snowtrace.io", "testnet.snowtrace.io"),
|
51 | 51 | "ftm:": (".ftmscan.com", "ftmscan.com"),
|
52 | 52 | "goerli.base:": ("-goerli.basescan.org", "goerli.basescan.org"),
|
| 53 | + "base:": (".basescan.org", "basescan.org"), |
| 54 | + "gno:": (".gnosisscan.io", "gnosisscan.io"), |
| 55 | + "polyzk:": ("-zkevm.polygonscan.com", "zkevm.polygonscan.com"), |
53 | 56 | }
|
54 | 57 |
|
55 | 58 |
|
@@ -237,6 +240,9 @@ def compile(self, crytic_compile: "CryticCompile", **kwargs: str) -> None:
|
237 | 240 | ftmscan_api_key = kwargs.get("ftmscan_api_key", None)
|
238 | 241 | bscan_api_key = kwargs.get("bscan_api_key", None)
|
239 | 242 | optim_api_key = kwargs.get("optim_api_key", None)
|
| 243 | + base_api_key = kwargs.get("base_api_key", None) |
| 244 | + gno_api_key = kwargs.get("gno_api_key", None) |
| 245 | + polyzk_api_key = kwargs.get("polyzk_api_key", None) |
240 | 246 |
|
241 | 247 | export_dir = kwargs.get("export_dir", "crytic-export")
|
242 | 248 | export_dir = os.path.join(
|
@@ -267,6 +273,15 @@ def compile(self, crytic_compile: "CryticCompile", **kwargs: str) -> None:
|
267 | 273 | if optim_api_key and "optim" in etherscan_url:
|
268 | 274 | etherscan_url += f"&apikey={optim_api_key}"
|
269 | 275 | etherscan_bytecode_url += f"&apikey={optim_api_key}"
|
| 276 | + if base_api_key and "base" in etherscan_url: |
| 277 | + etherscan_url += f"&apikey={base_api_key}" |
| 278 | + etherscan_bytecode_url += f"&apikey={base_api_key}" |
| 279 | + if gno_api_key and "gno" in etherscan_url: |
| 280 | + etherscan_url += f"&apikey={gno_api_key}" |
| 281 | + etherscan_bytecode_url += f"&apikey={gno_api_key}" |
| 282 | + if polyzk_api_key and "zkevm" in etherscan_url: |
| 283 | + etherscan_url += f"&apikey={polyzk_api_key}" |
| 284 | + etherscan_bytecode_url += f"&apikey={polyzk_api_key}" |
270 | 285 |
|
271 | 286 | source_code: str = ""
|
272 | 287 | result: Dict[str, Union[bool, str, int]] = {}
|
@@ -299,6 +314,10 @@ def compile(self, crytic_compile: "CryticCompile", **kwargs: str) -> None:
|
299 | 314 | LOGGER.error("Incorrect etherscan request")
|
300 | 315 | raise InvalidCompilation("Incorrect etherscan request " + etherscan_url)
|
301 | 316 |
|
| 317 | + if not info["message"].startswith("OK") and "Invalid API Key" in info["result"]: |
| 318 | + LOGGER.error("Invalid etherscan API Key") |
| 319 | + raise InvalidCompilation("Invalid etherscan API Key: " + etherscan_url) |
| 320 | + |
302 | 321 | if not info["message"].startswith("OK"):
|
303 | 322 | LOGGER.error("Contract has no public source code")
|
304 | 323 | raise InvalidCompilation("Contract has no public source code: " + etherscan_url)
|
|
0 commit comments