import { ethers } from "hardhat"; import hre from "hardhat"; async function main() { const currentTimestampInSeconds = Math.round(Date.now() / 1000); const ONE_YEAR_IN_SECS = 365 * 24 * 60 * 60; const unlockTime = currentTimestampInSeconds + ONE_YEAR_IN_SECS; const lockedAmount = ethers.utils.parseEther("1"); //* Deployement Process const Lock = await ethers.getContractFactory("Lock"); const lock = await Lock.deploy(unlockTime, { value: lockedAmount }); await lock.deployed(); console.log("Lock with 1 ETH deployed to:", lock.address); //* Verfication Process console.log("Sleeping..."); await sleep(50000); await hre.run("verify:verify", { address: lock.address, constructorArguments: [unlockTime], }); } function sleep(ms: number) { return new Promise((resolve) => setTimeout(resolve, ms)); } main().catch((error) => { console.error(error); process.exitCode = 1; });