err =“合同创建代码存储不足”

时间:2019-06-05 16:15:41

标签: blockchain ethereum smartcontracts quorum

我尝试通过混音部署一个非常简单的智能合约

       contract SimpleStorage2 {
             uint public storedData;

             constructor (uint initVal) public {
             storedData = initVal;
             }

       function set(uint x) public {
                storedData = x;
             } 

       function get() view public returns (uint retVal) {
       return storedData;
       }
       }

执行部署似乎一切正常,但是当我查阅node.log时,它似乎是:

        VM returned with error   err="contract creation code storage 
        out of gas"

有人对这个问题有想法吗 Ps:我正在运行一个具有4个节点的局域网,并且正在为帐户分配eth。

有人对这个问题有想法吗?

这是我的genesis.json

                     {
       "alloc": {
          "0xed9d02e382b34818e88b88a309c7fe71e65f419d": {
             "balance": "1000000000000000000000000000"

        },
        "coinbase": "0x0000000000000000000000000000000000000000",
        "config": {
        "homesteadBlock": 0,
        "byzantiumBlock": 0,
        "chainId": 10,
        "eip150Block": 0,
        "eip155Block": 0,
        "eip150Hash": 
        "0x000000
        0000000000000000000000000000000000000000000000000000000000",
        "eip158Block": 0,
        "isQuorum": true
        },
        "difficulty": "0x0",
        "extraData": 
        "0x0000000000000000000
        000000000000000000000000000000000000000000000",
        "gasLimit": "0xE0000000",
        "mixhash": "0x00000000000000
        000000000000000000000000647572616c65787365646c6578",
        "nonce": "0x0",
        "parentHash": "0x000000000000000000000000000000000000
        0000000000000000000000000000",
        "timestamp": "0x00"
        }

2 个答案:

答案 0 :(得分:0)

在创建合同之前尝试增加“气体限制”值。因为该消息显示“汽油不足”,表明汽油限量太低。

答案 1 :(得分:0)

我意识到这是一个老问题,但是对于像我这样陷入困境的任何人,可能是您使用的是Solidity编译器的较新版本,而您的geth版本支持较旧的版本。