embark-area-51/lib/contracts/solcP.js

15 lines
323 B
JavaScript
Raw Normal View History

2017-02-25 03:49:34 +00:00
var solc;
process.on('message', function(msg) {
if (msg.action === 'loadCompiler') {
solc = require('solc');
process.send({result: "loadedCompiler"});
}
if (msg.action === 'compile') {
var output = solc.compile(msg.obj, msg.optimize);
process.send({result: "compilation", output: output});
}
});