mirror of
https://github.com/cerc-io/watcher-ts
synced 2024-11-20 04:46:20 +00:00
cf0713eda7
Co-authored-by: nabarun <nabarun@deepstacksoft.com>
19 lines
431 B
TypeScript
19 lines
431 B
TypeScript
//
|
|
// Copyright 2021 Vulcanize, Inc.
|
|
//
|
|
|
|
import { task } from 'hardhat/config';
|
|
import '@nomiclabs/hardhat-ethers';
|
|
|
|
task(
|
|
'block-latest',
|
|
'Prints the current block info',
|
|
async (_, { ethers }) => {
|
|
const blockNumber = await ethers.provider.getBlockNumber();
|
|
const block = await ethers.provider.getBlock(blockNumber);
|
|
|
|
console.log('Block Number:', blockNumber);
|
|
console.log('Block Hash:', block.hash);
|
|
}
|
|
);
|