Merge pull request #80 from barkthins/gh-pages

Updated example to show how to use with web3
pull/1/head
chriseth 9 years ago
commit e04e22cbc8
  1. 5
      README.md

@ -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:

Loading…
Cancel
Save