import hre from "hardhat";
async function main() {
// جلب الحساب الأول من Hardhat runtime
const [deployer] = await hre.getSigners();
// طباعة عنوان الحساب ورصيده
console.log("Deploying contract with account:", await deployer.getAddress());
const balance = await deployer.getBalance();
console.log("Account balance:", balance.toString());
// الحصول على Factory للعقد HighestCoin
const HighestCoin = await hre.ethers.getContractFactory("HighestCoin");
// نشر العقد
const contract = await HighestCoin.deploy();
// انتظار نشر العقد على الشبكة
await contract.waitForDeployment();
// طباعة عنوان العقد بعد النشر
console.log("HighestCoin deployed to:", await contract.getAddress());
}
// تنفيذ الدالة
main().catch((error) => {
console.error(error);
process.exitCode = 1;
});



ساحة النقاش