eth_compileSolidity

半兽人 发表于: 2020-03-14   最后更新时间: 2020-03-14 16:27:36  
{{totalSubscript}} 订阅, 2,321 游览

eth_compileSolidity,返回编译后的solidity代码。

参数

  • String - 源码
    params: [
     "contract test { function multiply(uint a) returns(uint d) {   return a * 7;   } }",
    ]
    

返回:

  • DATA - 编译后的代码。

例子

// Request
curl -X POST --data '{"jsonrpc":"2.0","method":"eth_compileSolidity","params":["contract test { function multiply(uint a) returns(uint d) {   return a * 7;   } }"],"id":1}'

// Result
{
  "id":1,
  "jsonrpc": "2.0",
  "result": {
      "code": "0x605880600c6000396000f3006000357c010000000000000000000000000000000000000000000000000000000090048063c6888fa114602e57005b603d6004803590602001506047565b8060005260206000f35b60006007820290506053565b91905056",
      "info": {
        "source": "contract test {\n   function multiply(uint a) constant returns(uint d) {\n       return a * 7;\n   }\n}\n",
        "language": "Solidity",
        "languageVersion": "0",
        "compilerVersion": "0.9.19",
        "abiDefinition": [
          {
            "constant": true,
            "inputs": [
              {
                "name": "a",
                "type": "uint256"
              }
            ],
            "name": "multiply",
            "outputs": [
              {
                "name": "d",
                "type": "uint256"
              }
            ],
            "type": "function"
          }
        ],
        "userDoc": {
          "methods": {}
        },
        "developerDoc": {
          "methods": {}
        }
      }

}
更新于 2020-03-14

查看ethereumj更多相关的文章或提一个关于ethereumj的问题,也可以与我们一起分享文章