Replies: 5 comments
-
I finally worked it out myself by chance. |
Beta Was this translation helpful? Give feedback.
-
Did you get the solution ? |
Beta Was this translation helpful? Give feedback.
-
Actually, in your deploy.js, your import is wrong Replace const ethers = require("hardhat"); with const { ethers } = require("hardhat"); But still, this won't solve your problem completely. const simplestorageFactory = await ethers.deploy(); with const simplestorageFactory = await SimpleStorageFactory.deploy(); Hopefully, this will solve your issue completely. |
Beta Was this translation helpful? Give feedback.
-
<!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
-->Yes please, I did. Many Thanks, Sent from Mail for Windows From: junaid5598Sent: Tuesday, 13 June 2023 3:48 amTo: smartcontractkit/full-blockchain-solidity-course-jsCc: Mr-Saade; State changeSubject: Re: [smartcontractkit/full-blockchain-solidity-course-js] Unable to Invoke ethers functions using hardhat (Discussion #5668) Did you get the solution ?—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you modified the open/close state.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Your Welcome :) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Error code: TypeError: ethers.getContractFactory is not a function
at main (/root/SmartContract/hardhat-simple-storage/scripts/deploy.js:3:45)
at Object. (/root/SmartContract/hardhat-simple-storage/scripts/deploy.js:19:1)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47
error Command failed with exit code 1.
Above is my deploy.js script used in deploying my SimpleStorage Contract which has compiled successfully.
Hardhat.config.js
Package.json
I need help with this please, I have been stuck on this for too long now as I have spent countless days on StackOverflow and Google searches but to no avail. I would appreciate your support., thank you.
Beta Was this translation helpful? Give feedback.
All reactions