Replies: 6 comments 14 replies
|
What’s the version of Solidity and solc |
|
You are most probably using higher versions of solc . |
Do you solve this problem? |
|
Changing to |
|
Follow this steps:
this will make sure that you are using same version which is specified in contract, and then it will compile the contract now check is or past this code in deploy.js, just add your private key : const ethers = require("ethers")
const fs = require('fs-extra')
async function main() {
//https://127.0.0.1:7545
const provider = new ethers.providers.JsonRpcProvider("HTTP://127.0.0.1:7545");
const wallet = new ethers.Wallet("===========>YOUR PRIVATE KEY<=============", provider);
const abi = fs.readFileSync("./SimpleStorage_sol_SimpleStorage.abi", "utf-8")
const binary = fs.readFileSync("./SimpleStorage_sol_SimpleStorage.bin", "utf-8")
const contractFactory = new ethers.ContractFactory(abi, binary, wallet)
const contract = await contractFactory.deploy()
const deploymentRecipt = await contract.deployTransaction.wait(1);
console.log("here is deployment transactoin:");
console.log(contract)
}
main().then(() => process.exit(0)).catch((error) => {
console.error(error);
process.exit(1)
})now run deploy.js, |
|
Check that Ganache is working properly. |

Uh oh!
There was an error while loading. Please reload this page.
Hello, im trying to run my deploy.js but it keeps giving the error below.
this is the erorr i get:
All reactions