Files
self/contracts/ignition/modules/scripts/updateRegistryHub.ts
Kevin Lin 5a3bd28e7b Feature/add prettier formatter (#568)
* Add Prettier configuration and ignore files for code formatting

- Created .prettierignore to exclude specific directories and files from formatting.
- Added .prettierrc.yml with custom settings for print width and trailing commas.
- Updated package.json to include Prettier and its Solidity plugin as dependencies, along with scripts for formatting and checking code.

* Run prettier formatting
2025-05-23 15:52:59 +09:00

20 lines
899 B
TypeScript

import { buildModule } from "@nomicfoundation/hardhat-ignition/modules";
import hre from "hardhat";
import fs 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(fs.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 };
});