@ -24,7 +24,6 @@ Window {
property string packageHash
property alias packageBase64: base64Value . text
property string eth: "4c3f7330690ed3657d3fa20fe5717b84010528ae" ; /* TODO: replace with the good address */
property string yanndappRegistrar: "29a2e6d3c56ef7713a4e7229c3d1a23406f0161a" ; /* TODO: Only fur testing purpose. To remove when registrar contract will be deployed in genesis block */
property string currentAccount
property alias gasToUse: gasToUseInput . text
@ -287,161 +286,6 @@ Window {
text: qsTr ( "Close" ) ;
onClicked: close ( ) ;
}
/* TODO: Only fur testing purpose. To remove when registrar contract will be deployed in genesis block */
Button {
text: qsTr ( "Checking eth/yanndapp" ) ;
visible : false
onClicked: {
var requests = [ ] ;
var ethStr = QEtherHelper . createString ( "yanndapp" ) ;
requests . push ( { / / o w n e r
jsonrpc: "2.0" ,
method: "eth_call" ,
params: [ { "to" : '0x' + modalDeploymentDialog . eth , "data" : "0xec7b9200" + ethStr . encodeValueAsString ( ) } ] , / / c h e c k f o r y a n n d a p p R e g i s t r a r i n e t h
id: 1
} ) ;
requests . push ( { / / r e g i s t e r
jsonrpc: "2.0" ,
method: "eth_call" ,
params: [ { "to" : '0x' + modalDeploymentDialog . eth , "data" : "0x6be16bed" + ethStr . encodeValueAsString ( ) } ] , / / g e t r e g i s t e r y a n n d a p p R e g i s t r a r i n e t h
id: 2
} ) ;
requests . push ( { / / g e t O w n e r
jsonrpc: "2.0" ,
method: "eth_call" ,
params: [ { "to" : '0x' + modalDeploymentDialog . yanndappRegistrar , "data" : "0x893d20e8" } ] , / / c h e c k o w n e r o f t h i s r e g i s t r a r
id: 3
} ) ;
/*requests.push({ / / register
jsonrpc: "2.0" ,
method: "eth_call" ,
params: [ { "to" : '0x' + modalDeploymentDialog . yanndappRegistrar , "data" : "0x6be16bed" + ethStr . encodeValueAsString ( ) } ] ,
id: 2
} ) ; * /
var jsonRpcUrl = "http://localhost:8080" ;
var rpcRequest = JSON . stringify ( requests ) ;
var httpRequest = new XMLHttpRequest ( ) ;
httpRequest . open ( "POST" , jsonRpcUrl , true ) ;
httpRequest . setRequestHeader ( "Content-type" , "application/json" ) ;
httpRequest . setRequestHeader ( "Content-length" , rpcRequest . length ) ;
httpRequest . setRequestHeader ( "Connection" , "close" ) ;
httpRequest . onreadystatechange = function ( ) {
if ( httpRequest . readyState === XMLHttpRequest . DONE ) {
if ( httpRequest . status === 200 ) {
console . log ( httpRequest . responseText ) ;
} else {
var errorText = qsTr ( "path registration failed " ) + httpRequest . status ;
console . log ( errorText ) ;
}
}
}
httpRequest . send ( rpcRequest ) ;
}
}
/* TODO: Only fur testing purpose. To remove when registrar contract will be deployed in genesis block */
Button {
text: qsTr ( "add contracts" ) ;
visible : false
onClicked: {
var jsonRpcRequestId = 0 ;
var requests = [ ] ;
requests . push ( {
jsonrpc: "2.0" ,
method: "eth_transact" ,
params: [ { "gas" : 20000 , "code" : "0x60056011565b600180601c6000396000f35b6008600081905550560000" } ] ,
id: jsonRpcRequestId ++
} ) ;
var jsonRpcUrl = "http://localhost:8080" ;
var rpcRequest = JSON . stringify ( requests ) ;
var httpRequest = new XMLHttpRequest ( ) ;
httpRequest . open ( "POST" , jsonRpcUrl , true ) ;
httpRequest . setRequestHeader ( "Content-type" , "application/json" ) ;
httpRequest . setRequestHeader ( "Content-length" , rpcRequest . length ) ;
httpRequest . setRequestHeader ( "Connection" , "close" ) ;
httpRequest . onreadystatechange = function ( ) {
if ( httpRequest . readyState === XMLHttpRequest . DONE ) {
console . log ( httpRequest . responseText ) ;
var requests = [ ] ;
requests . push ( {
jsonrpc: "2.0" ,
method: "eth_transact" ,
params: [ { "gas" : 20000 , "code" : "0x60056011565b600180601c6000396000f35b6009600081905550560000" } ] ,
id: jsonRpcRequestId ++
} ) ;
rpcRequest = JSON . stringify ( requests ) ;
httpRequest = new XMLHttpRequest ( ) ;
httpRequest . open ( "POST" , jsonRpcUrl , true ) ;
httpRequest . setRequestHeader ( "Content-type" , "application/json" ) ;
httpRequest . setRequestHeader ( "Content-length" , rpcRequest . length ) ;
httpRequest . setRequestHeader ( "Connection" , "close" ) ;
httpRequest . onreadystatechange = function ( ) {
if ( httpRequest . readyState === XMLHttpRequest . DONE ) {
console . log ( httpRequest . responseText ) ;
}
}
httpRequest . send ( rpcRequest ) ;
}
}
httpRequest . send ( rpcRequest ) ;
}
}
/* TODO: Only fur testing purpose. To remove when registrar contract will be deployed in genesis block */
Button {
text: qsTr ( "Registering eth/yanndapp" ) ;
visible: false
onClicked: {
console . log ( "registering eth/yanndapp" )
var jsonRpcRequestId = 0 ;
var requests = [ ] ;
var ydapp = QEtherHelper . createString ( "yanndapp" ) ;
requests . push ( { / / r e s e r v e
jsonrpc: "2.0" ,
method: "eth_transact" ,
params: [ { "gas" : 2000 , "to" : '0x' + modalDeploymentDialog . eth , "data" : "0x1c83171b" + ydapp . encodeValueAsString ( ) } ] ,
id: jsonRpcRequestId ++
} ) ;
requests . push ( { / / s e t R e g i s t e r
jsonrpc: "2.0" ,
method: "eth_transact" ,
params: [ { "gas" : 2000 , "to" : '0x' + modalDeploymentDialog . eth , "data" : "0x96077307" + ydapp . encodeValueAsString ( ) + modalDeploymentDialog . pad ( modalDeploymentDialog . yanndappRegistrar ) } ] ,
id: jsonRpcRequestId ++
} ) ;
var jsonRpcUrl = "http://localhost:8080" ;
var rpcRequest = JSON . stringify ( requests ) ;
var httpRequest = new XMLHttpRequest ( ) ;
httpRequest . open ( "POST" , jsonRpcUrl , true ) ;
httpRequest . setRequestHeader ( "Content-type" , "application/json" ) ;
httpRequest . setRequestHeader ( "Content-length" , rpcRequest . length ) ;
httpRequest . setRequestHeader ( "Connection" , "close" ) ;
httpRequest . onreadystatechange = function ( ) {
if ( httpRequest . readyState === XMLHttpRequest . DONE ) {
if ( httpRequest . status === 200 ) {
console . log ( httpRequest . responseText ) ;
} else {
var errorText = qsTr ( "path registration failed " ) + httpRequest . status ;
console . log ( errorText ) ;
}
}
}
httpRequest . send ( rpcRequest ) ;
}
}
}
}
}