From bd00d944cad6b10b7f13ede199ae5d969ea4148f Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Sat, 9 May 2020 00:44:08 +0100 Subject: [PATCH] Fix config to handle when infura key isn't provided (#1380) --- mythril/mythril/mythril_config.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mythril/mythril/mythril_config.py b/mythril/mythril/mythril_config.py index 174e47e5..e7f4463b 100644 --- a/mythril/mythril/mythril_config.py +++ b/mythril/mythril/mythril_config.py @@ -192,11 +192,14 @@ class MythrilConfig: if m and m.group(1) in ["mainnet", "rinkeby", "kovan", "ropsten"]: if self.infura_id in (None, ""): - raise CriticalError( - "Infura key not provided. Use --infura-id " + log.info( + "Infura key not provided, so onchain access is disabled. " + "Use --infura-id " "or set it in the environment variable INFURA_ID " - "or in the ~/.mythril/config.ini file'" + "or in the ~/.mythril/config.ini file" ) + self.eth = None + return rpcconfig = ( "{}.infura.io/v3/{}".format(m.group(1), self.infura_id),