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") )