You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, when i wrote this below code and ran it using node
constethers=require("ethers");constfs=require("fs");// we can only use await keyword inside async functionsasyncfunctionmain(){constrpcURL="http://127.0.0.1:7545";constprovider=newethers.providers.JsonRpcProvider(rpcURL);constwallet=newethers.Wallet("0xd3ff6e741deb110873fe5e8b51bd204f1de0fde2508102c986089389fbace67f",provider);consttx={to: "0x9bBC28112B173246C18C3cE3345C5B4eb422a03a",value: ethers.utils.parseEther("0.1"),gasLimit: 21000,};constabi=fs.readFileSync("./SimpleStorage_sol_SimpleStorage.abi","utf-8");constbinary=fs.readFileSync("./SimpleStorage_sol_SimpleStorage.bin","utf-8");constcontractFactory=newethers.ContractFactory(abi,binary,wallet);console.log("Deploying, please wait...");constcontract=awaitcontractFactory.deploy();// STOP here, wait for the contract to deployconsole.log(contract);}main().then(()=>process.exit(0)).catch((err)=>{console.error(err);process.exit(1);});
Error:
Error: cannot estimate gas; transaction may fail or may require manual gas limit
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, when i wrote this below code and ran it using node
Error:
Can you please help me out here
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions