mirror of
https://github.com/logos-messaging/waku-rlnv1-contract.git
synced 2026-01-06 00:03:08 +00:00
34 lines
1.0 KiB
TypeScript
34 lines
1.0 KiB
TypeScript
import { HardhatRuntimeEnvironment } from "hardhat/types";
|
|
import { DeployFunction, DeploymentSubmission } from "hardhat-deploy/types";
|
|
|
|
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
|
|
const { deployments, getUnnamedAccounts } = hre;
|
|
const { deploy } = deployments;
|
|
|
|
const [deployer] = await getUnnamedAccounts();
|
|
|
|
const poseidonHasherAddress = (await deployments.get("PoseidonHasher"))
|
|
.address;
|
|
|
|
const implRes = await deploy("WakuRlnRegistry_Implementation", {
|
|
contract: "WakuRlnRegistry",
|
|
from: deployer,
|
|
log: true,
|
|
});
|
|
|
|
let initializeAbi = ["function initialize(address _poseidonHasher)"];
|
|
let iface = new hre.ethers.utils.Interface(initializeAbi);
|
|
const data = iface.encodeFunctionData("initialize", [poseidonHasherAddress]);
|
|
|
|
await deploy("WakuRlnRegistry_Proxy", {
|
|
contract: "ERC1967Proxy",
|
|
from: deployer,
|
|
log: true,
|
|
args: [implRes.address, data],
|
|
});
|
|
};
|
|
|
|
export default func;
|
|
func.tags = ["WakuRlnRegistry"];
|
|
func.dependencies = ["PoseidonHasher"];
|