mirror of
https://github.com/selfxyz/self.git
synced 2026-01-14 17:17:59 -05:00
* refactor: remove namespace imports * refactor: use named fs imports * refactor(app): replace path and fs namespace imports * format * format
20 lines
910 B
TypeScript
20 lines
910 B
TypeScript
import { buildModule } from "@nomicfoundation/hardhat-ignition/modules";
|
|
import hre from "hardhat";
|
|
import { readFileSync } from "fs";
|
|
import path from "path";
|
|
|
|
module.exports = buildModule("UpdateRegistryHub", (m) => {
|
|
const networkName = hre.network.config.chainId;
|
|
|
|
const deployedAddressesPath = path.join(__dirname, `../../deployments/chain-${networkName}/deployed_addresses.json`);
|
|
const deployedAddresses = JSON.parse(readFileSync(deployedAddressesPath, "utf8"));
|
|
|
|
const registryAddress = deployedAddresses["DeployRegistryModule#IdentityRegistry"];
|
|
const hubAddress = deployedAddresses["DeployHub#IdentityVerificationHub"];
|
|
|
|
const deployedRegistryInstance = m.contractAt("IdentityRegistryImplV1", registryAddress);
|
|
console.log("Deployed registry instance", deployedRegistryInstance);
|
|
m.call(deployedRegistryInstance, "updateHub", [hubAddress]);
|
|
return { deployedRegistryInstance };
|
|
});
|