mirror of
https://github.com/vacp2p/rln-interep-contract.git
synced 2025-02-28 22:20:42 +00:00
27 lines
865 B
TypeScript
27 lines
865 B
TypeScript
import { HardhatRuntimeEnvironment } from "hardhat/types";
|
|
import { DeployFunction } from "hardhat-deploy/types";
|
|
import { getValidGroups, isDevNet } from "../common";
|
|
|
|
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
|
|
const { deployments, getUnnamedAccounts } = hre;
|
|
const { deploy } = deployments;
|
|
|
|
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;
|
|
func.tags = ["ValidGroupStorage"];
|
|
func.dependencies = ["InterepTest"];
|