Browse Source

More fixing for std serv

cl-refactor
Gav Wood 10 years ago
parent
commit
e2b3925683
  1. 5
      alethzero/MainWin.cpp
  2. 40
      stdserv.js

5
alethzero/MainWin.cpp

@ -355,6 +355,9 @@ void Main::on_enableOptimizer_triggered()
void Main::load(QString _s) void Main::load(QString _s)
{ {
QString contents = QString::fromStdString(dev::asString(dev::contents(_s.toStdString())));
ui->webView->page()->currentFrame()->evaluateJavaScript(contents);
/*
QFile fin(_s); QFile fin(_s);
if (!fin.open(QFile::ReadOnly)) if (!fin.open(QFile::ReadOnly))
return; return;
@ -375,7 +378,7 @@ void Main::load(QString _s)
//eval(line); //eval(line);
line.clear(); line.clear();
} }
} }*/
} }
void Main::on_loadJS_triggered() void Main::on_loadJS_triggered()

40
stdserv.js

@ -1,29 +1,23 @@
eth = web3.eth; eth = web3.eth;
env = web3.env; env = web3.env;
env.note('Creating Config...') var configSource =
var config; "{"+
eth.lll(" " [[69]] (caller)"+
{ " (returnlll {"+
[[69]] (caller) " (when (&& (= (calldatasize) 64) (= (caller) @@69))"+
(returnlll { " (for {} (< @i (calldatasize)) [i](+ @i 64)"+
(when (&& (= (calldatasize) 64) (= (caller) @@69)) " [[ (calldataload @i) ]] (calldataload (+ @i 32))"+
(for {} (< @i (calldatasize)) [i](+ @i 64) " )"+
[[ (calldataload @i) ]] (calldataload (+ @i 32)) " )"+
) " (return @@ $0)"+
) " })"+
(return @@ $0) "}";
})
}" console.log('Creating Config...')
).then(function(configCode) var config = eth.lll(configSource);
{ config = config.then(function (configCode) { console.log('Config code: ' + configCode); return eth.transact({ 'code': configCode }); });
console.log('Config code: ' + configCode); config.then(function(configAddress) { console.log('Config at address ' + configAddress); config = configAddress; return configAddress; });
return eth.transact({ 'code': configCode });
}).then(function(configAddress)
{
config = configAddress;
console.log('Config at address ' + configAddress);
});
// marek: TODO // marek: TODO
/* /*

Loading…
Cancel
Save