Skip to content

Commit

Permalink
Merge pull request #4466 from NomicFoundation/hh-viem-fixes
Browse files Browse the repository at this point in the history
Fix script in viem sample project
  • Loading branch information
fvictorio authored Oct 11, 2023
2 parents 02911f1 + 9357a00 commit b2a551f
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import viem from "viem";
import { formatEther, parseEther } from "viem";
import hre from "hardhat";

async function main() {
const currentTimestampInSeconds = Math.round(Date.now() / 1000);
const unlockTime = BigInt(currentTimestampInSeconds + 60);

const lockedAmount = viem.parseEther("0.001");
const lockedAmount = parseEther("0.001");

const lock = await hre.viem.deployContract("Lock", [unlockTime], {
value: lockedAmount,
});

console.log(
`Lock with ${viem.formatEther(
`Lock with ${formatEther(
lockedAmount
)}ETH and unlock timestamp ${unlockTime} deployed to ${lock.address}`
);
Expand Down

0 comments on commit b2a551f

Please sign in to comment.