Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: cannot estimate gas; transaction may fail or may require manual gas limit #6348

Open
Clintontrillz opened this issue Dec 23, 2023 · 1 comment
Labels

Comments

@Clintontrillz
Copy link

Clintontrillz commented Dec 23, 2023

Lesson

Lesson 5

Could you please leave a link to the timestamp in the video where this error occurs? (You can right click a video and "copy video URL at current time")

No response

Operating System

Windows

Describe the bug

"Error: cannot estimate gas; transaction may fail or may require manual gas limit". I keep getting this error message whenever i deploy my contract on ganache.

const ethers = require("ethers");
const fs = require("fs-extra");

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(
    "0xb8c18ade1aa094d70c5ad689dff011d6b50bd2472f10ec179d28ba5a0d663862",
    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();
  console.log(contract);
}
main()
  .then(() => Process.exit(0))
  .catch((error) => {
    console.error(error);
    Process.exit(1);
  });
@bharathkumar369
Copy link

same error for me ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants