From 775152b1ce2c58bdbe21fe7a129b54de4af95110 Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Sun, 10 Dec 2017 14:12:08 +0700 Subject: [PATCH] Handle invalid contract addresses --- myth | 3 +++ 1 file changed, 3 insertions(+) diff --git a/myth b/myth index 9046d0a2..087937f5 100755 --- a/myth +++ b/myth @@ -163,6 +163,9 @@ if (args.code): contracts.append(ETHContract(args.code, name="MAIN", address = util.get_indexed_address(0))) elif (args.address): + if not re.match(r'0x[a-fA-F0-9]{40}', args.address): + exitWithError("Invalid contract address. Expected format is '0x...'.") + try: code = eth.eth_getCode(args.address)