Updated example to show how to use with web3

pull/1/head
pszabop 9 years ago
parent 1f39624086
commit f5d90ee2f7
  1. 5
      README.md

@ -14,8 +14,11 @@ And then use it like so:
var solc = require('solc');
var input = "contract x { function g() {} }";
var output = solc.compile(input, 1); // 1 activates the optimiser
for (var contractName in output.contracts)
for (var contractName in output.contracts) {
// code and ABI that are needed by web3
console.log(contractName + ': ' + output.contracts[contractName].bytecode);
console.log(contractName + '; ' + JSON.parse( output.contracts[contractName].interface));
}
Starting from version 0.1.6, multiple files are supported with automatic import resolution by the compiler as follows:

Loading…
Cancel
Save