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"
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? ๐
@PatrickAlphaC I just realized this piece of code was already included by @zeuslawyer here: d2afede#diff-57cf5378f8cab20b02b279097ba6fad08eb53f747d81770045dda9c5f95effe3
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!