0

I am trying to create a contract from other contract on gnache-cli using remix web3 provider but getting following error:

VM Exception while processing transaction: revert

The issue is that when I try it on the JavaScript VM (on remix), I am not getting any error. Kindly note that I am running ganache-cli with the following parameters:

ganache-cli -h 0.0.0.0 -p 8545 -l 3000000000

As a sidenote, I am able to deploy the contract... the problem appears only when deploying from another contract. In the ganache-cli console, I am getting this error:

Transaction: 0x1f77d94278c27412affe6be5f7bd50d6f95d47503fa6c302553e1a94cfb7111c
Gas usage: 2250998
Block Number: 3
Block Time: Fri Sep 28 2018 13:33:14 GMT+0400 (+04)
Runtime Error: revert

Version of tools used:

  • ganache-cli 6.1.8 (ganache-core: 2.2.1)
  • solc, the solidity compiler commandline interface: 0.4.24+commit.e67f0147.Linux.g++
  • npm: 6.4.1

Contract code:

pragma solidity ^0.4.24;

contract Test2{
    constructor() public{

    }
}

contract Test{

    function createInstance() public{
        address test2 = new Test2();
    }
}
0

Gas limit estimated in a wrong way(because of internal smart contract deployment), the transaction needs more gas than it was estimated by metamask(web3). If you increase gas limit the transaction will pass.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.