mirror of
https://github.com/Instadapp/dsa-periphery-contract.git
synced 2024-07-29 22:27:13 +00:00
25 lines
718 B
TypeScript
25 lines
718 B
TypeScript
import { ethers } from "hardhat";
|
|
|
|
async function main() {
|
|
const currentTimestampInSeconds = Math.round(Date.now() / 1000);
|
|
const unlockTime = currentTimestampInSeconds + 60;
|
|
|
|
const lockedAmount = ethers.utils.parseEther("0.001");
|
|
|
|
const Lock = await ethers.getContractFactory("Lock");
|
|
const lock = await Lock.deploy(unlockTime, { value: lockedAmount });
|
|
|
|
await lock.deployed();
|
|
|
|
console.log(
|
|
`Lock with ${ethers.utils.formatEther(lockedAmount)}ETH and unlock timestamp ${unlockTime} deployed to ${lock.address}`
|
|
);
|
|
}
|
|
|
|
// We recommend this pattern to be able to use async/await everywhere
|
|
// and properly handle errors.
|
|
main().catch((error) => {
|
|
console.error(error);
|
|
process.exitCode = 1;
|
|
});
|