PatrickAlphaC/dao-template

Error running yarn hardhat deploy

waner11 opened this issue ยท 5 comments

When I finished the script 03-deploy-governor-contract and try to run the deploy command, it throws the error below, I have the exact same code shown in the YT tutorial. The first two contracts are deployed but the error comes in the third one, the GovernorContract.

Error: cannot estimate gas; transaction may fail or may require manual gas limit [ See: https://links.ethers.org/v5-errors-UNPREDICTABLE_GAS_LIMIT ] (reason="Transaction reverted: trying to deploy a contract whose code is too large", method="estimateGas"

Screen Shot 2022-07-05 at 12 39 40 AM

Hey mate!
I had the same problem and I was able to fix it by changing this in hardhat.config.ts:
Change this line : solidity: "0.8.8", for:

  solidity: {
    version: "0.8.8",
    settings: {
      optimizer: {
        enabled: true,
        runs: 200,
      },
    },
  },

I hope it helps ๐Ÿ™‚

Can you make a PR with this? ๐Ÿ™

Oh nice!

Hey mate! I had the same problem and I was able to fix it by changing this in hardhat.config.ts: Change this line : solidity: "0.8.8", for:

  solidity: {
    version: "0.8.8",
    settings: {
      optimizer: {
        enabled: true,
        runs: 200,
      },
    },
  },

I hope it helps ๐Ÿ™‚

Thanks a lot man, this worked for me!