chainid.js 226 B

12345678910
  1. const hre = require('hardhat');
  2. async function getChainId() {
  3. const chainIdHex = await hre.network.provider.send('eth_chainId', []);
  4. return new hre.web3.utils.BN(chainIdHex, 'hex');
  5. }
  6. module.exports = {
  7. getChainId,
  8. };