1

I am trying to compile and deploy simple contract :

 var Web3 = require("web3");
 var web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));

var source = "" +
"contract test {\n" +
"   function multiply(uint a) returns(uint d) {\n" +
"       return a * 7;\n" +
"   }\n" +
"}\n";
var compiled = web3.eth.compile.solidity(source);
console.log(compiled);

Based on documentation I was expecting sth like this :

"test": {
"code": "0x605280600c6000396000f3006000357c010000000000000000000000000000000000000000000000000000000090048063c6888fa114602e57005b60376004356041565b8060005260206000f35b6000600782029050604d565b91905056",
"info": {
  "source": "contract test {\n\tfunction multiply(uint a) returns(uint d) {\n\t\treturn a * 7;\n\t}\n}\n",
  "language": "Solidity",
  "languageVersion": "0",
  "compilerVersion": "0.8.2",
  "abiDefinition": [
    { ...

but what I get is :

0x606060405260308060106000396000f3606060405260e060020a6000350463c6888fa18114601c575b6002565b346002576007600435026060908152602090f3

I am not sure how to create new contract out of that as examples I found say I should do sth like that

var greeterContract = web3.eth.contract(compiled.test.info.abiDefinition);

 var greeter = greeterContract.new(_greeting,{from:web3.eth.accounts[0], data: compiled.test.code, gas: 1000000}, function(e, contract){

any ideas what I did wrong?

P.S. I am using Parity as provider

wonglik
  • 315
  • 2
  • 9
  • Step-by-step guide, but using geth, is available at http://ethereum.stackexchange.com/questions/2751/deploying-the-greeter-contract-via-the-geth-cli-is-not-registering-in-my-private . – BokkyPooBah Sep 28 '16 at 14:47

1 Answers1

0

Sounds like Parity isn't implementing eth_compileSolidity up to spec.

Edit: Looks like one reason they don't return the full result is they can't (yet). According to this link, they don't receive the ABI from compilation: https://github.com/ethcore/parity/issues/2276#issuecomment-249277973

Edit 2: Looks like there's a conversation about this here: https://github.com/ethcore/parity/issues/2272

Tim Coulter
  • 1,049
  • 1
  • 7
  • 9