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)
{
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()

40
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
/*

Loading…
Cancel
Save