From 5466633c82fb89eb59c6ad01fc6385aff570e0e4 Mon Sep 17 00:00:00 2001 From: Feist Josselin Date: Mon, 9 Jan 2023 15:46:29 +0100 Subject: [PATCH] Change priority hardhat <> foundry --- crytic_compile/platform/hardhat.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crytic_compile/platform/hardhat.py b/crytic_compile/platform/hardhat.py index dc6a9e4a..3afe7bed 100755 --- a/crytic_compile/platform/hardhat.py +++ b/crytic_compile/platform/hardhat.py @@ -205,6 +205,11 @@ def is_supported(target: str, **kwargs: str) -> bool: hardhat_ignore = kwargs.get("hardhat_ignore", False) if hardhat_ignore: return False + + # If there is both foundry and hardhat, foundry takes priority + if os.path.isfile(os.path.join(target, "foundry.toml")): + return False + return os.path.isfile(os.path.join(target, "hardhat.config.js")) | os.path.isfile( os.path.join(target, "hardhat.config.ts") )