From f5d90ee2f7b00452f34670fe7d2f1de297918ddc Mon Sep 17 00:00:00 2001 From: pszabop Date: Mon, 14 Dec 2015 17:08:31 -0800 Subject: [PATCH] Updated example to show how to use with web3 --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 68a7c79925..3a223bc953 100644 --- a/README.md +++ b/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: