@nomicfoundation/hardhat-verify
Version:
Hardhat plugin for verifying contracts
11 lines • 386 B
JavaScript
const chainIdCache = new WeakMap();
export async function getChainId(provider) {
const cachedChainId = chainIdCache.get(provider);
if (cachedChainId !== undefined) {
return cachedChainId;
}
const chainId = Number(await provider.request({ method: "eth_chainId" }));
chainIdCache.set(provider, chainId);
return chainId;
}
//# sourceMappingURL=chains.js.map