Cannot read properties of undefined (reading 'JsonRpcProvider') #6745
-
I currently having problem when trying to deploy the deploy.js. Below is my code: const ethers = require("ethers");
const fs = require("fs");
async function main() {
// http://127.0.0.1:7545
const provider = new ethers.providers.JsonRpcProvider(
"http://127.0.0.1:7545"
);
const wallet = new ethers.Wallet(
"0x9df18b477d04fc0e60e355d905fb57c50db5089a219cac274992a13d28126585",
provider
);
const abi = fs.readFileSync("./SimpleStorage_sol_SimpleStorage.abi", "utf8");
const binary = fs.readFileSync(
"./SimpleStorage_sol_SimpleStorage.bin",
"utf8"
);
const contractFactory = new ethers.ContractFactory(abi, binary, wallet);
console.log("Deploying, please wait...");
const contract = await contractFactory.deploy();
console.log(contract);
}
main().then(() =>
ProcessingInstruction.exit(0).catch((error) => {
console.error(error);
ProcessingInstruction.exit(1);
})
); The error that I get looked like this:
Then I read some online resources that I should downgrade the ethers version to 5.7.2 so I did it. but then the new error pop out which looked like this:
Perhaps someone had this issue resolved, could you guys help me resolve this also? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 6 replies
-
I go through the discussion once again and found this solution that worked for me. If only I go through a little bit longer....Here is the solution link: |
Beta Was this translation helpful? Give feedback.
-
Yes i am also undergoing the course
…On Thu, 10 Oct 2024, 11:20 panzul, ***@***.***> wrote:
Hello bro, are you also undergoing this course also?
—
Reply to this email directly, view it on GitHub
<#6745 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BL5YWFLF35PKWGFBM3UQBDLZ2ZIFVAVCNFSM6AAAAABPRROLB6VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTAOJQGI3DEMI>
.
You are receiving this because you commented.Message ID:
<smartcontractkit/full-blockchain-solidity-course-js/repo-discussions/6745/comments/10902621
@github.com>
|
Beta Was this translation helpful? Give feedback.
-
Yes completely different
Your contact no. probably we can link up more better
…On Thu, 10 Oct 2024, 11:26 panzul, ***@***.***> wrote:
Which timestamp are you currently in cuz im currently stuck in hours 10
where the hardhat version perhaps really different from 2 years ago like in
the tutorial
—
Reply to this email directly, view it on GitHub
<#6745 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BL5YWFKBFZMHQEMF34XSEI3Z2ZI4TAVCNFSM6AAAAABPRROLB6VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTAOJQGI3DMOI>
.
You are receiving this because you commented.Message ID:
<smartcontractkit/full-blockchain-solidity-course-js/repo-discussions/6745/comments/10902669
@github.com>
|
Beta Was this translation helpful? Give feedback.
-
Ok maybe Telegram
…On Thu, 10 Oct 2024, 11:51 panzul, ***@***.***> wrote:
Or discord maybe
—
Reply to this email directly, view it on GitHub
<#6745 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BL5YWFMPNOKMRKOZ4DA7IBLZ2ZL2HAVCNFSM6AAAAABPRROLB6VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTAOJQGI4DQMA>
.
You are receiving this because you commented.Message ID:
<smartcontractkit/full-blockchain-solidity-course-js/repo-discussions/6745/comments/10902880
@github.com>
|
Beta Was this translation helpful? Give feedback.
-
I currently on suspension on discord
Let try Telegram
…On Thu, 10 Oct 2024, 11:52 panzul, ***@***.***> wrote:
Here is my discord acc: hanyaikan#8177
—
Reply to this email directly, view it on GitHub
<#6745 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BL5YWFL5Y2W2U3SDYQ6BU3DZ2ZL6PAVCNFSM6AAAAABPRROLB6VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTAOJQGI4DSMQ>
.
You are receiving this because you commented.Message ID:
<smartcontractkit/full-blockchain-solidity-course-js/repo-discussions/6745/comments/10902892
@github.com>
|
Beta Was this translation helpful? Give feedback.
I go through the discussion once again and found this solution that worked for me. If only I go through a little bit longer....Here is the solution link:
#34 (comment)