rln-interep-contract/common/chain-utils.ts
2022-12-06 13:46:27 +05:30

28 lines
830 B
TypeScript

export const devNets = ["hardhat", "localhost"];
export const testNets = ["goerli", "localhost_integration"];
export const prodNets = ["mainnet"];
export const isDevNet = (networkName: string) => devNets.includes(networkName);
export const isTestNet = (networkName: string) =>
testNets.includes(networkName);
export const isProdNet = (networkName: string) =>
prodNets.includes(networkName);
export const useRealVerifier = (networkName: string) =>
networkName === "localhost_integration";
export const getInterepAddress = (networkName: string) => {
switch (networkName) {
case "mainnet":
throw new Error("Interep not deployed on mainnet yet.");
case "goerli":
return "0x9f44be9F69aF1e049dCeCDb2d9296f36C49Ceafb";
default:
throw new Error(`Unknown network name: ${networkName}`);
}
};