Minimal deployment failed Returned error: VM Exception while processing transaction: out of gas

:1234: Code to reproduce

I have run ganache-cli --allowUnlimitedContractSize

Here is my configuration in network.js:

module.exports = {
  networks: {
    development: {
      protocol: 'http',
      host: 'localhost',
      port: 8545,
      //gas: 5000000,
      gas: 6721975,
      //gasPrice: 5e9,
      networkId: '*',
  compilers: {
    solc: {
      version: "0.5.7",
      //docker: false,
      settings: {
       optimizer: {
         enabled: true,
         runs: 200
1 Like

Hi @xxs,

I suggest trying to deploy as a regular contract to start with.
I assume that you are deploying a large contract as you changed ganache to allow unlimited contract size.
You could try increasing the gas further.
You may want to change the number of runs for the optimizer to 1.

Are you able to share your contract or a repository?

Hi @xxs,

Just wanted to follow up to see if you had resolved?