Skip to content

VM Exception while processing transaction: out of gas #44

@dreammonkey

Description

@dreammonkey

Hi,

In the kickstart project test script I ran into an issue where ganache was refusing to deploy the CampaignFactory.

VM Exception while processing transaction: out of gas

It turned out I had to augment the gasLimit to 10 million when deploying:

factory = await new web3.eth.Contract(compiledFactory.abi)
  .deploy({ data: compiledFactory.evm.bytecode.object })
  .send({
    from: accounts.kickstarter,
    gas: "10000000",
  });

After that the following error appeared:

n: Exceeds block gas limit

Apparently I also needed to raise the global gasLimit in the ganache provider:

const web3 = new Web3(
  ganache.provider({
    gasLimit: 10000000,
  })
);

This resolved the issue and successfully deployed the factory on the test network.
But I have yet to find the reason why this was needed ?
And more importantly what would be the consequences when deploying this on the MainNet ?

Are there any thoughts on this ?

Best Regards,
Diederik

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions