diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f75b017..d91b6a4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,4 +44,4 @@ jobs: - name: "Run tests" run: npm run test - name: "Deploy contracts" - run: npm run deploy + run: npx hardhat run scripts/deploy.ts --network localhost diff --git a/hardhat.config.ts b/hardhat.config.ts index f0ccdea..69ba12a 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -23,7 +23,7 @@ task( task("deploy", "Deploys Contract", async (_, hre) => { const currentTimestampInSeconds = Math.round(Date.now() / 1000); - const unlockTime = currentTimestampInSeconds + 300; + const unlockTime = currentTimestampInSeconds + 365 * 24 * 60 * 60; // 1 year from now const lockedAmount = hre.ethers.parseEther("0.001"); const lockInstance = await hre.ethers.deployContract("Lock", [unlockTime], { diff --git a/package.json b/package.json index 3ceb591..25f52e7 100644 --- a/package.json +++ b/package.json @@ -13,8 +13,8 @@ "author": "Salman Dabbakuti", "license": "ISC", "devDependencies": { - "@nomicfoundation/hardhat-toolbox": "^3.0.0", + "@nomicfoundation/hardhat-toolbox": "^4.0.0", "dotenv": "^16.3.1", - "hardhat": "^2.19.0" + "hardhat": "^2.19.1" } } diff --git a/scripts/deploy.ts b/scripts/deploy.ts index ce2d70a..2a1bc0c 100644 --- a/scripts/deploy.ts +++ b/scripts/deploy.ts @@ -2,7 +2,7 @@ import { ethers } from "hardhat"; async function main() { const currentTimestampInSeconds = Math.round(Date.now() / 1000); - const unlockTime = currentTimestampInSeconds + 300; + const unlockTime = currentTimestampInSeconds + 365 * 24 * 60 * 60; // 1 year from now const lockedAmount = ethers.parseEther("0.001"); const lockInstance = await ethers.deployContract("Lock", [unlockTime], {