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