/** * pop org status — quick org health summary (+ module version panel). * * The version panel answers, per deployed module: which implementation is it * on, is that the protocol's latest for the type, and will its beacon follow * upgrades automatically. TypeName strings and typeId derivation VERIFIED * against contracts origin/main src/libs/ModuleTypes.sol * (typeId = keccak256(bytes(typeName))) and * script/deploy/DeployInfrastructure.s.sol (addContractType calls). * * SUBGRAPH FIRST (2026-07). This panel used to cost up to 18 EIP-1967 slot * walks + 9 PoaManager calls + 9 OrgRegistry calls + one block-0 eth_getLogs * for a read-only summary. All four are indexed and verified populated on live * Gnosis AND Arbitrum: * * implementation RegisteredContract.beacon → SwitchableBeaconContract.mode * → Beacon(typeId).currentImplementation (Mirror) * latestImplementation Beacon(typeId).currentImplementation * version Beacon.version / BeaconUpgradeEvent.version * * autoUpgrade deliberately stays on OrgRegistry.isAutoUpgrade: the indexed * RegisteredContract.autoUpgrade is registration-time only (no AutoUpgradeSet * handler exists), so it cannot observe setAutoUpgrade. * * Two caveats are honoured rather than assumed away: * - SwitchableBeaconContract.mirrorBeacon is NULL on every live row, so the * Mirror branch joins the global beacon by typeId (see queries/beacons.ts). * - No Pinned beacon exists on any live deployment, so * pinnedImplementation has never been observed populated; a Pinned (or * unclassifiable) beacon falls back to RPC instead of guessing Mirror. * * The whole panel is best-effort: any RPC/subgraph failure degrades to a * one-line note, and --fast skips it entirely. JSON output is additive: * `moduleVersions` / `moduleVersionsError` / `moduleVersionsSource` appear * alongside the existing fields; the row shape is unchanged. */ import type { Argv, ArgumentsCamelCase } from 'yargs'; import { ethers } from 'ethers'; import { OrgModules } from '../../lib/resolve'; import type { VersionIndex } from '../../lib/versions'; import type { OrgBeaconSnapshot } from '../../queries/beacons'; interface StatusArgs { org?: string; chain?: number; fast?: boolean; } /** * Org module → PoaManager contract-type name. TypeName strings verified * against contracts origin/main (ModuleTypes.sol + DeployInfrastructure). */ export declare const MODULE_TYPES: Array<{ key: keyof OrgModules; label: string; typeName: string; }>; export interface ModuleVersionRow { module: string; typeName: string; proxy: string; implementation: string | null; latestImplementation: string | null; upToDate: boolean | null; /** null when the OrgRegistry read failed/reverted (e.g. ContractUnknown) */ autoUpgrade: boolean | null; /** * Deployed implementation version string ("v4", "v11", …) resolved from the registry's * ImplementationRegistered log. null = undeterminable, which is NOT the same as "old". */ version: string | null; } export interface VersionPanelSources { /** Indexed module→beacon data; omit/null to force the pure-RPC path. */ snapshot?: OrgBeaconSnapshot | null; /** Implementation→version lookup; omit to use the registry log scan. */ versions?: VersionIndex | null; } /** * Build the module version rows for every module the org has deployed. * * Pass `sources.snapshot` to serve implementation / latest / autoUpgrade from * the subgraph; anything it cannot answer still falls back to RPC per field, so * a partial index degrades gracefully rather than producing nulls. Individual * module failures degrade that row (nulls); only total infrastructure failure * should be handled by the caller's try/catch. */ export declare function buildVersionPanel(provider: ethers.providers.Provider, modules: OrgModules, infra: { poaManagerAddress: string; orgRegistryAddress: string | null; implementationRegistryAddress?: string | null; }, sources?: VersionPanelSources): Promise; /** Human status label for one version row. */ export declare function versionStatusLabel(row: ModuleVersionRow): string; export declare const statusHandler: { builder: (yargs: Argv) => Argv<{ fast: boolean; }>; handler: (argv: ArgumentsCamelCase) => Promise; }; export {};