rln-interep-contract/deploy/003_deploy_interep_test.ts

44 lines
1.1 KiB
TypeScript
Raw Normal View History

2022-11-25 11:38:38 +05:30
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";
2022-11-28 10:32:53 +05:30
import { getGroups, isDevNet, merkleTreeDepth } from "../common";
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
2022-11-25 11:38:38 +05:30
const { deployments, getUnnamedAccounts } = hre;
const { deploy } = deployments;
const [deployer] = await getUnnamedAccounts();
2022-11-28 10:32:53 +05:30
const verifierAddress = (await deployments.get("VerifierTest")).address;
2022-11-25 11:38:38 +05:30
const interepTest = await deploy("InterepTest", {
from: deployer,
log: true,
2022-11-28 10:32:53 +05:30
args: [
[
{
contractAddress: verifierAddress,
merkleTreeDepth,
},
],
],
2022-11-25 11:38:38 +05:30
});
const contract = await hre.ethers.getContractAt(
"InterepTest",
interepTest.address
);
const groups = getGroups();
const groupInsertionTx = await contract.updateGroups(groups);
await groupInsertionTx.wait();
};
export default func;
2022-11-25 11:38:38 +05:30
func.tags = ["InterepTest"];
2022-11-28 10:32:53 +05:30
func.dependencies = ["VerifierTest"];
// skip when running on mainnet
func.skip = async (hre: HardhatRuntimeEnvironment) => {
2022-11-25 11:38:38 +05:30
if (isDevNet(hre.network.name)) {
return false;
}
return true;
};