Skip to content

Commit

Permalink
feat: add Lock contract ignition module
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedali8 committed Sep 19, 2024
1 parent 571c962 commit 0437423
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
18 changes: 18 additions & 0 deletions ignition/modules/Lock.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { buildModule } from "@nomicfoundation/hardhat-ignition/modules";

const JAN_1ST_2030 = 1893456000;
const ONE_GWEI: bigint = 1_000_000_000n;

export default buildModule("Lock", (m) => {
const deployer = m.getAccount(0);

const unlockTime = m.getParameter("unlockTime", JAN_1ST_2030);
const lockedAmount = m.getParameter("lockedAmount", ONE_GWEI);

const lock = m.contract("Lock", [unlockTime], {
from: deployer,
value: lockedAmount,
});

return { lock };
});
6 changes: 6 additions & 0 deletions ignition/parameters.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"Lock": {
"unlockTime": "1893456000",
"lockedAmount": "1000000000n"
}
}

0 comments on commit 0437423

Please sign in to comment.