mirror of
https://github.com/selfxyz/self.git
synced 2026-02-21 03:00:36 -05:00
25 lines
1.1 KiB
TypeScript
25 lines
1.1 KiB
TypeScript
import { buildModule } from "@nomicfoundation/hardhat-ignition/modules";
|
|
import hre from "hardhat";
|
|
import fs from "fs";
|
|
import path from "path";
|
|
import { getSMTs } from "../../../test/utils/generateProof.js";
|
|
|
|
module.exports = buildModule("UpdateRegistryOfacRoot", (m) => {
|
|
const networkName = hre.network.config.chainId;
|
|
|
|
const deployedAddressesPath = path.join(__dirname, `../../deployments/chain-${networkName}/deployed_addresses.json`);
|
|
const deployedAddresses = JSON.parse(fs.readFileSync(deployedAddressesPath, "utf8"));
|
|
|
|
const registryAddress = deployedAddresses["DeployRegistryModule#IdentityRegistry"];
|
|
|
|
const deployedRegistryInstance = m.contractAt("IdentityRegistryImplV1", registryAddress);
|
|
console.log("Deployed registry instance", deployedRegistryInstance);
|
|
|
|
const { passportNo_smt, nameAndDob_smt, nameAndYob_smt } = getSMTs();
|
|
|
|
m.call(deployedRegistryInstance, "updatePassportNoOfacRoot", [passportNo_smt.root]);
|
|
m.call(deployedRegistryInstance, "updateNameAndDobOfacRoot", [nameAndDob_smt.root]);
|
|
m.call(deployedRegistryInstance, "updateNameAndYobOfacRoot", [nameAndYob_smt.root]);
|
|
return { deployedRegistryInstance };
|
|
});
|