diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index 0ad5ba938..e10d01efc 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -355,6 +355,9 @@ void Main::on_enableOptimizer_triggered() void Main::load(QString _s) { + QString contents = QString::fromStdString(dev::asString(dev::contents(_s.toStdString()))); + ui->webView->page()->currentFrame()->evaluateJavaScript(contents); + /* QFile fin(_s); if (!fin.open(QFile::ReadOnly)) return; @@ -375,7 +378,7 @@ void Main::load(QString _s) //eval(line); line.clear(); } - } + }*/ } void Main::on_loadJS_triggered() diff --git a/stdserv.js b/stdserv.js index 887586874..375a8379f 100644 --- a/stdserv.js +++ b/stdserv.js @@ -1,29 +1,23 @@ eth = web3.eth; env = web3.env; -env.note('Creating Config...') -var config; -eth.lll(" -{ - [[69]] (caller) - (returnlll { - (when (&& (= (calldatasize) 64) (= (caller) @@69)) - (for {} (< @i (calldatasize)) [i](+ @i 64) - [[ (calldataload @i) ]] (calldataload (+ @i 32)) - ) - ) - (return @@ $0) - }) -}" -).then(function(configCode) -{ - console.log('Config code: ' + configCode); - return eth.transact({ 'code': configCode }); -}).then(function(configAddress) -{ - config = configAddress; - console.log('Config at address ' + configAddress); -}); +var configSource = +"{"+ +" [[69]] (caller)"+ +" (returnlll {"+ +" (when (&& (= (calldatasize) 64) (= (caller) @@69))"+ +" (for {} (< @i (calldatasize)) [i](+ @i 64)"+ +" [[ (calldataload @i) ]] (calldataload (+ @i 32))"+ +" )"+ +" )"+ +" (return @@ $0)"+ +" })"+ +"}"; + +console.log('Creating Config...') +var config = eth.lll(configSource); +config = config.then(function (configCode) { console.log('Config code: ' + configCode); return eth.transact({ 'code': configCode }); }); +config.then(function(configAddress) { console.log('Config at address ' + configAddress); config = configAddress; return configAddress; }); // marek: TODO /*