Skip to content

Commit

Permalink
works with undeployed contracts, prints addresses of all contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
hacker-DOM committed May 31, 2018
1 parent ee1c2e9 commit 89dafe0
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@ async function asyncFn() {
}

console.log('Tx in Block #' + tx.blockNumber)
console.log('Transaction being sent from:', from);
// console.log('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
// console.log('tx',tx);
// console.log('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
console.log('Transaction being sent from:', from)
console.log('To:', to)
console.log('Input:', input2)
console.log('Events:',)
Expand All @@ -91,11 +94,21 @@ async function asyncFn() {

}
}

// Print all contracts

const l = Math.max(names.length, addresses.length)

for (let i = 0; i < l; i++) {
const add = addresses[i] ? addresses[i] : 'not deployed'
console.log(names[i], add)
}
}

async function printLogs(logs) {
for (let i = 0; i < logs.length; i++) {
const log = logs[i]
if (!log) continue
console.log(`${log.name}:`)
for (let j = 0; j < log.events.length; j++) {
const param = log.events[j]
Expand Down Expand Up @@ -153,7 +166,7 @@ function isInUpToLibraries(bytecode, input) {
}
}

if (!index || bytecode[index] === '_') return true
if ((!index || bytecode[index] === '_') && bytecode.length > 2) return true
else return false
}

Expand Down

0 comments on commit 89dafe0

Please sign in to comment.