Error when a missing contract is specified to read-storage. Previously this just silently exited

pull/2235/head
Usmann Khan 1 year ago
parent e3dcf1ecd3
commit 912d6b2e4e
  1. 3
      slither/tools/read_storage/__main__.py

@ -7,6 +7,7 @@ import argparse
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

Loading…
Cancel
Save