Commit f5d90ee2 authored by pszabop's avatar pszabop

Updated example to show how to use with web3

parent 1f396240
...@@ -14,8 +14,11 @@ And then use it like so: ...@@ -14,8 +14,11 @@ And then use it like so:
var solc = require('solc'); var solc = require('solc');
var input = "contract x { function g() {} }"; var input = "contract x { function g() {} }";
var output = solc.compile(input, 1); // 1 activates the optimiser 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 + ': ' + 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: Starting from version 0.1.6, multiple files are supported with automatic import resolution by the compiler as follows:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment