Deployment
Deploying on a Local Network
npx hardhat compileasync function main() { const Contract = await ethers.getContractFactory("MyContract"); const contract = await Contract.deploy(); console.log("Contract deployed to:", contract.address); } main() .then(() => process.exit(0)) .catch((error) => { console.error(error); process.exit(1); });npx hardhat run scripts/deploy.js --network localhost
