Error: ENOENT: no such file or directory, open './SimpleStorage_sol_SimpleStorage.abi' #6532
Answered
by
sebaszeledon
sebaszeledon
asked this question in
Q&A
-
Hello all, I have trouble with the following issue, my code is exact the same as Patrick, however, the error is still present and the route of the file is correct. This is the code: async function main() {
// http://127.0.0.1:7545
const provider = new ethers.providers.JsonRpcProvider(
"HTTP://127.0.0.1:7545"
);
const wallet = new ethers.Wallet(
"0x2672242fbef4d055cd3c48a5a54338acd6eb87b78bd7ed4706ce4a2024a61c5f",
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 until the contract is deployed.
console.log(contract);
} This is the error:
|
Beta Was this translation helpful? Give feedback.
Answered by
sebaszeledon
Mar 29, 2024
Replies: 1 comment
-
For some reason the name of the files in my computer is longer: ./_Users_Sebas_hh-fcc_ethers-simple-storage_SimpleStorage_sol_SimpleStorage.abi I corrected this and now works. Just leaving the comment if someone else has the same issue. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
sebaszeledon
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For some reason the name of the files in my computer is longer:
./_Users_Sebas_hh-fcc_ethers-simple-storage_SimpleStorage_sol_SimpleStorage.abi
I corrected this and now works. Just leaving the comment if someone else has the same issue.