Skip to content
This repository has been archived by the owner on Sep 15, 2022. It is now read-only.

Commit

Permalink
fix dotenv; add contract flag
Browse files Browse the repository at this point in the history
  • Loading branch information
gkucmierz committed Oct 24, 2020
1 parent 70dee50 commit 93fef13
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions run.js
Original file line number Diff line number Diff line change
@@ -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');
Expand All @@ -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();
Expand All @@ -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]);
};

Expand Down

0 comments on commit 93fef13

Please sign in to comment.