I'm trying to migrate my contract to a mainnet fork using ganache-cli:

ganache-cli -f https://mainnet.infura.io/v3/{infuraKey} -l 8000000000000 --defaultBalanceEther 1000000000 --allowUnlimitedContractSize

Using these configurations:

 development: {
  network_id: '*',
  host: "",     // Localhost (default: none)
  port: 8545,            // Standard Ethereum port (default: none)
  gas: 8000000000000, 

Whenever I run truffle migrate, I get this error:


   Deploying '{contractName}'

Error:  *** Deployment Failed ***
"{contractName}" ran out of gas (using a value you set in your network config or deployment parameters.)
   * Block limit:  8000000000000 (0x746a5288000)
   * Gas sent:     8000000000000 (0x746a5288000)

As you can see, I've increased the block limit and gas limit to an extremely high amount and I'm still running out of gas, any advice?

1 Answer 1


My contract was over 24kb, reduced contract size and that fixed it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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