Files
self/contracts/scripts/showRegistryAddresses.ts
Kevin Lin 66c3df7fcb ci: add prettier check for contract sdk (#602)
* Add Prettier check for code formatting in contracts workflow

* Update contracts workflow: remove unused checkout action and fix build step name

* Run formatter

* Run lint fix
2025-06-28 07:30:29 +08:00

49 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-44787/deployed_addresses.json");
if (!fs.existsSync(deployedAddressesPath)) {
console.log("❌ No deployment found for chain 44787 (Alfajores)");
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);