mirror of
https://github.com/logos-messaging/waku-rlnv1-contract.git
synced 2026-01-07 16:53:09 +00:00
43 lines
1.2 KiB
TypeScript
43 lines
1.2 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 priceCalculatorAddress = (
|
|
await deployments.get("WakuSimplePriceCalculator")
|
|
).address;
|
|
|
|
const implRes = await deploy("WakuRlnRegistry_Implementation", {
|
|
contract: "WakuRlnRegistry",
|
|
from: deployer,
|
|
log: true,
|
|
});
|
|
|
|
let initializeAbi = [
|
|
"function initialize(address _poseidonHasher, address _priceCalculator)",
|
|
];
|
|
let iface = new hre.ethers.utils.Interface(initializeAbi);
|
|
const data = iface.encodeFunctionData("initialize", [
|
|
poseidonHasherAddress,
|
|
priceCalculatorAddress,
|
|
]);
|
|
|
|
await deploy("WakuRlnRegistry_Proxy", {
|
|
contract: "ERC1967Proxy",
|
|
from: deployer,
|
|
log: true,
|
|
args: [implRes.address, data],
|
|
});
|
|
};
|
|
|
|
export default func;
|
|
func.tags = ["WakuRlnRegistry"];
|
|
func.dependencies = ["PoseidonHasher", "WakuSimplePriceCalculator"];
|