Skip to content

Commit

Permalink
Reformat code and add launch.json.
Browse files Browse the repository at this point in the history
  • Loading branch information
cleanunicorn committed Jul 20, 2019
1 parent f6c910c commit 308fbe4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
"console": "integratedTerminal",
"args": [
"--account-pk=0xb0057716d5917badaf911b193b12b910811c1497b5bada8d7711f758981c3773",
"--contract=0x7c728214be9a0049e6a86f2137ec61030d0aa964",
"--contract=0xb87bF323AB5174806911CED29E9A2B9b6e839120",
"--rpc-http=http://localhost:8545",
"--source=mythril",
"--rpc-ws=ws://localhost:8546",
// "--rpc-ws=ws://localhost:8545",
],
},
Expand Down
15 changes: 7 additions & 8 deletions theo/interfaces/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,9 @@ def main():

# Load exploits from file
parser.add_argument(
"--load-file",
type=str,
help="Load exploit from file",
default="",
"--load-file", type=str, help="Load exploit from file", default=""
)

args = parser.parse_args()

# Get account from the private key
Expand Down Expand Up @@ -86,31 +83,33 @@ def start_repl(args):
]

if len(exploits) == 0:
print(
"No exploits found. You're going to need to load some exploits."
)
print("No exploits found. You're going to need to load some exploits.")
else:
print("Found exploits(s)", exploits)

# Load history
history_path = "./.theo_history"

def save_history(historyPath=history_path):
import readline

readline.write_history_file(history_path)

import os
import readline

if os.path.isfile(history_path):
readline.read_history_file(history_path)
# Trigger history save on exit
import atexit

atexit.register(save_history)
# Load variables
vars = globals()
vars.update(locals())
# Start REPL
import rlcompleter

readline.set_completer(rlcompleter.Completer(vars).complete)
readline.parse_and_bind("tab: complete")
del os, atexit, readline, rlcompleter, save_history
Expand Down
2 changes: 1 addition & 1 deletion theo/scanner/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def exploits_from_mythril(
eth=EthJsonRpc(host=host, port=port, tls=rpc_tls),
solc_version=None,
solc_args=None,
enable_online_lookup=enable_online_lookup
enable_online_lookup=enable_online_lookup,
)
disassembler.load_from_address(contract)
# Analyzer
Expand Down

0 comments on commit 308fbe4

Please sign in to comment.