From 912d6b2e4e21a770437abbb5ac9e260f50ffa873 Mon Sep 17 00:00:00 2001 From: Usmann Khan Date: Thu, 16 Nov 2023 14:16:26 -0800 Subject: [PATCH] Error when a missing contract is specified to read-storage. Previously this just silently exited --- slither/tools/read_storage/__main__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/slither/tools/read_storage/__main__.py b/slither/tools/read_storage/__main__.py index 8415ae185f..3baa5d351a 100644 --- a/slither/tools/read_storage/__main__.py +++ b/slither/tools/read_storage/__main__.py @@ -7,6 +7,7 @@ from crytic_compile import cryticparser from slither import Slither +from slither.exceptions import SlitherError from slither.tools.read_storage.read_storage import SlitherReadStorage, RpcInfo @@ -129,6 +130,8 @@ def main() -> None: if args.contract_name: contracts = slither.get_contract_from_name(args.contract_name) + if len(contracts) == 0: + raise SlitherError(f"Contract {args.contract_name} not found.") else: contracts = slither.contracts