Files
self/contracts/scripts/showRegistryAddresses.ts
Evi Nova 8c5b90e89f Contracts cleanup (#1311)
* refactor: use singular ETHERSCAN_API_KEY in .env

Etherscan has unified all keys of associated explorers like Celoscan into a singular key rather than different keys for different networks.

* refactor: use one .env instead of separate .env.test + .env files

* refactor: deploy contracts with runs of 1000 instead of 200

Decreases gas cost of function calls on deployed contracts

* clean: remove duplicate/redundant deploy modules + scripts

* clean: cleanup empty script file

* refactor: cleanup default network of scripts

Read network from .env instead of using defaults of alfajores (outdated) or staging

* clean: remove references to Alfajores, replace with Sepolia

* chore: add default .env variables

* chore: update build-all script to include aardhaar circuit

* chore: update broken Powers of Tau download link (use iden3)

* chore: remove duplicate script

* fix: use stable version 18 for disclose circuits

* test: update test import paths to allow for .ts version of generateProof

* test: fix broken tests

* test: uncomment critical code for registration, change error names to updated names, fix broken import paths, update disclose tests for new scope generation/handling

* fix: broken import path

* test: fix Airdrop tests to use V2 logic

* docs: update docs for necessary prerequisite programs

* chore: yarn prettier formatting

* fix: CI errors occuring when deploying contracts as can't read .env

Using a dummy key for CI builds

* chore: yarn prettier

* refactor: change runs to 100000
2025-10-27 11:50:19 +01:00

52 lines
1.7 KiB
TypeScript

import * as fs from "fs";
import * as path from "path";
async function showRegistryAddresses() {
console.log("🔍 Registry Deployment Addresses:");
console.log("================================");
try {
// Read the deployed addresses from the deployment artifacts
const deployedAddressesPath = path.join(
__dirname,
"../ignition/deployments/chain-11142220/deployed_addresses.json",
);
if (!fs.existsSync(deployedAddressesPath)) {
console.log("❌ No deployment found for chain 11142220 (Sepolia)");
console.log(" Please run: yarn deploy:registry");
return;
}
const deployedAddresses = JSON.parse(fs.readFileSync(deployedAddressesPath, "utf8"));
// Show registry-related addresses
const registryKeys = Object.keys(deployedAddresses).filter((key) => key.startsWith("DeployRegistryModule#"));
if (registryKeys.length === 0) {
console.log("❌ No registry contracts found in deployed addresses");
console.log(" Available deployments:", Object.keys(deployedAddresses));
return;
}
registryKeys.forEach((key) => {
const contractName = key.replace("DeployRegistryModule#", "");
const address = deployedAddresses[key];
let emoji = "📝";
if (contractName === "PoseidonT3") emoji = "📚";
else if (contractName === "IdentityRegistryImplV1") emoji = "🏗️";
else if (contractName === "IdentityRegistry") emoji = "🚀";
console.log(`${emoji} ${contractName}:`);
console.log(` ${address}`);
});
console.log("\n✅ Registry deployment complete!");
} catch (error) {
console.error("❌ Error reading deployment addresses:", error);
}
}
showRegistryAddresses().catch(console.error);