Comments (4)
remove providers object from the line below
so instead of :
const provider = new ethers.providers.JsonRpcProvider(
"HTTP://127.0.0.1:7545"
);
write this :
const provider = new ethers.JsonRpcProvider(
"HTTP://127.0.0.1:7545"
);
this error maybe related to recent update which is not takken into account in this course.
from full-blockchain-solidity-course-js.
I do not see a deply.js here?
Sounds like you need to check JsonRpcProvidor.
'''TypeError: Cannot read properties of undefined (reading 'JsonRpcProvider')'''
from full-blockchain-solidity-course-js.
My freind is also having this mistake so he tried some code that might solve your problem here is the solve it :
const ethers = require("ethers");
const fs = require("fs-extra");
async function main() {
const provider = new ethers.providers.JsonRpcProvider(
"http://127.0.0.1:7545"
);
const privateKey = "0x558cc70107e27f955b18929f466564d6044269c09870c7e58ead521327ae0b12";
const Wallet = new ethers.Wallet(privateKey, provider);
const abi = JSON.parse(fs.readFileSync("SimpleStorage_sol_SimpleStorage.abi", "utf8"));
const bytecode = "0x" + fs.readFileSync("SimpleStorage_sol_SimpleStorage.bin", "utf8");
const contractFactory = new ethers.ContractFactory(abi, bytecode, Wallet);
console.log("Deploying, please wait...");
const contract = await contractFactory.deploy();
console.log("Contract address:", contract.address);
console.log("Transaction hash:", contract.deployTransaction.hash);
await contract.deployed();
console.log("Contract deployed successfully!");
}
main()
.then(() => process.exit(0))
.catch((error) => {
console.error(error);
process.exit(1);
});
from full-blockchain-solidity-course-js.
Hopefully it might work..
from full-blockchain-solidity-course-js.
Related Issues (20)
- Factory runner does not support sending transactions
- Gas estimation fAILED
- Lesson 4: Kovan RPC is down HOT 1
- TypeError: Cannot read properties of undefined (reading 'waitForTransaction')
- Lending Pool Error: Pool is Paused HOT 1
- TypeError: Cannot read properties of undefined (reading 'wait') HOT 1
- Error: failed to get chainId, falling back on net_version... ConnectTimeoutError: Connect Timeout Error HOT 1
- Error: could not coalesce error (error={ "code": -32000, "data": { "hash": HOT 4
- Lesson 10: TypeError: can't access property "toString", _ctx.sent is undefined
- Problem while running code HOT 3
- SPDX license identifier error HOT 4
- Error: cannot estimate gas; transaction may fail or may require manual gas limit HOT 2
- Moralis Self hosted server url and App id is necessary in the graph way? HOT 3
- Lesson07: Failed to get chainId, falling back to net_version HOT 4
- PLEASE HELP ME WITH THIS ISSUE
- transaction is revert inspite provinding the required eth HOT 1
- trouble with connecting to sepolia HOT 6
- About the problem in Lesson 9, "Error: Timeout of 20000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. " HOT 1
- Lesson 7 error : "before each" hook for "should set the aggregator address correctly": TypeError: ethers.getContract is not a function HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from full-blockchain-solidity-course-js.