@solarity/hardhat-migrate
Version:
The simplest way to deploy smart contracts
12 lines (8 loc) • 387 B
text/typescript
import { toBigInt } from "ethers";
import { networkManager } from "../tools/network/NetworkManager";
export async function getChainId(): Promise<bigint> {
return toBigInt(await networkManager!.provider.send("eth_chainId"));
}
export async function isDeployedContractAddress(address: string): Promise<boolean> {
return (await networkManager!.provider.getCode(address)) !== "0x";
}