Skip to content

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

Answered by mazen-sleem
mazen-sleem asked this question in Q&A
Discussion options

You must be logged in to vote

this is the code :

const ethers = require("ethers")

const fs = require("fs-extra")
require("dotenv").config()

async function main() {
  
    let provider = new ethers.providers.JsonRpcProvider(process.env.RPC_URL)
    
    const encryptedJson = fs.readFileSync("./.encryptedKey.json", "utf8");
    let wallet = new ethers.Wallet.fromEncryptedJsonSync(
      encryptedJson,
      process.env.PRIVATE_KEY_PASSWORD
    );
    wallet = wallet.connect(provider);
    const abi = fs.readFileSync("./SimpleStorage_sol_SimpleStorage.abi", "utf8")
    const binary = fs.readFileSync(
        "./SimpleStorage_sol_SimpleStorage.bin",
        "utf8"
    )
    const contractFactory = new ethers.ContractFac…

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@mazen-sleem
Comment options

@mazen-sleem
Comment options

@Sunil-Reddy-Gummalla
Comment options

@mazen-sleem
Comment options

Answer selected by mazen-sleem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants