Lesson 5: Error: invalid bytecode > during contract deployment #148
-
I am running into this error while compiling my deploy.js file. I just started the ether js lesson not working with hardhat yet. Code: const provider = new ethers.providers.JsonRpcProvider(
"http://127.0.0.1:7545"
);
const wallet = new ethers.Wallet(
"02f6401fd77129f7967695f811607be9f22e488de3f528d88319dc788c7b93cc",
provider
);
const abi = fs.readFileSync("./SimpleStorage_sol_SimpleStorage.abi", "utf8");
const binary = fs.readFileSync(
"./SimpleStorage_sol_SimpleStorage.abi",
"utf8"
);
const contractFactory = new ethers.ContractFactory(abi, binary, wallet);
console.log("Deploying, please wait...");
const contract = await contractFactory.deploy();
console.log(contract);
|
Beta Was this translation helpful? Give feedback.
Answered by
PatrickAlphaC
Jun 7, 2022
Replies: 1 comment 3 replies
-
Hmm... Is your code exactly the same as what's in the file here? https://github.com/PatrickAlphaC/ethers-simple-storage-fcc/blob/main/deploy.js |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
fayzali1
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hmm... Is your code exactly the same as what's in the file here?
https://github.com/PatrickAlphaC/ethers-simple-storage-fcc/blob/main/deploy.js