Skip to content

Commit

Permalink
prepend compiled bytecode with 0x #11
Browse files Browse the repository at this point in the history
  • Loading branch information
7flash committed Nov 20, 2018
1 parent cf2e07b commit 88d688e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ program
contractDocs.push(cDocs);
var ABI = metadata.output.abi;
var bytecode = output.contracts[contractName].bytecode;
if (!bytecode.startsWith('0x')) {
bytecode = '0x'+bytecode;
}
var instance = new web3.eth.Contract(ABI, {data: bytecode, from:accounts[0], gasPrice:"0", gas: 6000000});
instances[contractName] = instance;
var filename = contractName.replace(".","_").replace(":","-") + '.json';
Expand Down

0 comments on commit 88d688e

Please sign in to comment.