From 93fef132658487f716ae080a34113e99ab12f618 Mon Sep 17 00:00:00 2001 From: Grzegorz Kucmierz Date: Sun, 25 Oct 2020 01:02:23 +0200 Subject: [PATCH] fix dotenv; add contract flag --- run.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/run.js b/run.js index 41b28c1..1fa1d67 100644 --- a/run.js +++ b/run.js @@ -1,14 +1,18 @@ +const PARSED = require('dotenv').config().parsed; const { PHRASE -} = require('dotenv').config(); +} = PARSED; +const CONTRACT = PARSED.CONTRACT === 'true'; -const CMD = `./profanity.x64 --contract --skip 1 --matching ${PHRASE} -I 1000 -i 255`; +const CMD = `./profanity.x64 ${CONTRACT ? '--contract' : ''} --skip 1 --matching ${PHRASE} -I 1000 -i 255`; +console.log(CMD); const exec = require('child_process').exec; const fs = require('fs'); const loop = () => { + exec('rm cache-opencl**'); const proc = exec(CMD); const { toChecksumAddress } = require('ethereum-checksum-address'); @@ -17,7 +21,7 @@ const loop = () => { const check = (priv, addr) => { console.log(`check: ${addr}`); if (addr.indexOf(PHRASE) !== -1) { - fs.appendFileSync('output.txt', [toChecksumAddress(addr), priv].join('\t') + '\n'); + fs.appendFileSync('output.txt', [toChecksumAddress(addr), priv, CONTRACT].join('\t') + '\n'); beep(); proc.kill(); loop(); @@ -26,7 +30,10 @@ const loop = () => { const match = str => { console.log(str); - const m = str.match(/Private: (0x[a-f0-9]+) Contract: (0x[a-f0-9]+)/); + const m = (CONTRACT ? + str.match(/Private: (0x[a-f0-9]+) Contract: (0x[a-f0-9]+)/) : + str.match(/Private: (0x[a-f0-9]+) Address: (0x[a-f0-9]+)/) + ); if (m) check(m[1], m[2]); };