Replies: 5 comments 13 replies
-
What’s the version of Solidity and solc |
Beta Was this translation helpful? Give feedback.
-
You are most probably using higher versions of solc . |
Beta Was this translation helpful? Give feedback.
-
Do you solve this problem? |
Beta Was this translation helpful? Give feedback.
-
Changing to |
Beta Was this translation helpful? Give feedback.
-
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,
|
Beta Was this translation helpful? Give feedback.
-
Hello, im trying to run my deploy.js but it keeps giving the error below.
this is the erorr i get:
Beta Was this translation helpful? Give feedback.
All reactions