waku-rlnv1-contract/deploy/002_deploy_rln_registry.ts

39 lines
1.1 KiB
TypeScript
Raw Normal View History

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,
});
2024-04-22 14:34:28 -04:00
let initializeAbi = [
"function initialize(address _poseidonHasher, uint40 _ttl)",
];
let iface = new hre.ethers.utils.Interface(initializeAbi);
2024-04-22 14:34:28 -04:00
const data = iface.encodeFunctionData("initialize", [
poseidonHasherAddress,
0,
]);
await deploy("WakuRlnRegistry_Proxy", {
contract: "ERC1967Proxy",
from: deployer,
log: true,
args: [implRes.address, data],
});
};
2023-07-03 18:15:38 +05:30
export default func;
2023-08-03 17:20:25 +05:30
func.tags = ["WakuRlnRegistry"];
2023-07-03 18:15:38 +05:30
func.dependencies = ["PoseidonHasher"];