Comments (5)
Did you check if ganache is running on local host 8545 and not at 7545?
Maybe also change HTTP into http (no caps)
You can see the local host in the ganache app on the top!
from full-blockchain-solidity-course-js.
@daalmana Yes, I have tested all of this. It still doesn't resolve the issue with the compiler.
This is the deploy.js code
const ethers = require("ethers");
const fs = require("fs-extra");
async function main() {
const provider = new ethers.provider.JsonRpcProvider("HTTP://0.0.0.0:8545");
const wallet = new ethers.Wallet(
"c893d45f...................................................fdef96c9a13081",
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(); //STOP here! wait for contract to deploy
console.log(contract);
}
main()
.then(() => ProcessingInstruction.exit(0))
.catch((error) => {
console.error(error);
ProcessingInstruction.exit(1);
});
This is the error I am getting running this code:
ReferenceError: ProcessingInstruction is not defined
And this the same simple storage contract I had on remix
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.8;
contract SimpleStorage {
uint256 favoriteNumber;
mapping(string => uint256) public nameToFavoriteNumber;
struct People {
uint256 favoriteNumber;
string name;
}
People[] public people;
function store(uint256 _favoriteNumber) public virtual {
favoriteNumber = _favoriteNumber;
}
function retrieve() public view returns (uint256) {
return favoriteNumber;
}
function addPerson(string memory _name, uint256 _favoriteNumber) public {
people.push(People(_favoriteNumber, _name));
nameToFavoriteNumber[_name] = _favoriteNumber;
}
}
Do you know whta could be the issue? What package maybe causing the issue?
from full-blockchain-solidity-course-js.
Maybe it's a bug in json settings?
{
"editor.defaultFormatter": "NomicFoundation.hardhat-solidity",
"workbench.colorTheme": "Abyss",
"html.format.unformatted": "esbenp.prettier-vscode",
"eslint.format.enable": true,
"editor.formatOnSave": true,
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"files.autoSave": "afterDelay",
"solang.target": "ewasm",
}
{
"dependencies": {
"ethers": "^5.6.8",
"fs-extra": "^10.1.0",
"solc": "^0.8.14-fixed"
},
"scripts": {
"compile": "yarn solcjs --bin --abi --include-path node_modules/ --base-path . -o . SimpleStorage.sol"
}
}
from full-blockchain-solidity-course-js.
Look at your main function at the bottom! It's should be procces not processingInstructions
from full-blockchain-solidity-course-js.
@daalmana Thank you for the info. I modified it but now it returns
TypeError: Cannot read properties of undefined (reading 'JsonRpcProvider')
When running node deploy.js, I am assuming it is related to Ganache UI (I always run into issues using Ganache UI)
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
- Help me in deploy.js HOT 4
- 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 1
- 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.