rln-interep-contract/deploy/004_deploy_valid_group_storage.ts

27 lines
865 B
TypeScript
Raw Normal View History

2022-11-25 11:38:38 +05:30
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";
import { getValidGroups, isDevNet } from "../common";
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
2022-11-25 11:38:38 +05:30
const { deployments, getUnnamedAccounts } = hre;
const { deploy } = deployments;
2022-11-25 11:38:38 +05:30
const [deployer] = await getUnnamedAccounts();
if (!isDevNet(hre.network.name)) {
throw new Error("Interep not deployed on mainnet yet.");
}
const interepAddress = isDevNet(hre.network.name)
? (await deployments.get("InterepTest")).address
: "0x0000000000000000000000000000000000000000";
await deploy("ValidGroupStorage", {
from: deployer,
log: true,
args: [interepAddress, getValidGroups()],
});
};
export default func;
2022-11-25 11:38:38 +05:30
func.tags = ["ValidGroupStorage"];
func.dependencies = ["InterepTest"];