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
const{ ethers }=require("hardhat");asyncfunctionmain(){// Get the signers from Hardhat's environmentconst[deployer]=awaitethers.getSigners();console.log("Deploying contract...");// Retrieve the address of the deployerconstdeployer_address=awaitdeployer.getAddress();console.log("-----------------------------");console.log(`Deployer address: ${deployer_address}`);// console.log("Account Balance:", (await deployer.getBalance()).toString());// Create a factory for the SimpleStorage contractconstsimpleStorage_factory=awaitethers.getContractFactory("SimpleStorage");// Deploy the contractconstsimpleStorage_contract=awaitsimpleStorage_factory.deploy();// Ensure the contract is fully deployedawaitsimpleStorage_contract.deployed();// Get the contract addressconstcontract_address=simpleStorage_contract.address;console.log("-------------------------");console.log("Contract address:",contract_address);console.log("---------------------------------------");}// Run the main function and handle possible errorsmain().then(()=>process.exit(0)).catch((error)=>{console.error(error);process.exit(1);});
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
-
Beta Was this translation helpful? Give feedback.
All reactions