import type { HardhatRuntimeEnvironment } from "hardhat/types/hre";
/**
* Reconstruct `keccak256(abi.encodePacked(topNodes))` from aggregator public-input
* limbs. Each limb is a bytes32 with 128 bits right-aligned (`CommitteeHashLib`).
*/
export declare function committeeHashFromLimbs(hi: string, lo: string): string;
export declare const deploymentsFile: string;
/** Hardhat network names used for local development. */
export declare const LOCAL_DEPLOYMENT_NETWORKS: readonly ["localhost", "hardhat", "anvil", "ganache"];
/**
* Legacy deployment bucket keys written when scripts used `provider.getNetwork().name`
* (ethers reports "default" / "undefined" on local chains). Cleared with local deploys.
*/
export declare const LEGACY_LOCAL_DEPLOYMENT_ALIASES: readonly ["default", "undefined"];
/**
* Chain key for `deployed_contracts.json`. Use Hardhat's network name, not the provider's
* `network.name` (which is often `"default"` on localhost and does not match clean/deploy).
*/
export declare const getDeploymentChain: (hre: HardhatRuntimeEnvironment) => string;
export declare const isLocalDeploymentChain: (chain: string) => boolean;
export declare const REPO_ROOT: string;
/**
*
* Default insecure-512 / micro committee layout for BFV aggregator verifiers.
* Must match `lib::configs::default::{H, T}` in compiled circuits.
* Micro committee: N=3, T=1, H=3.
*
*/
export declare const BFV_DKG_H = 3;
export declare const BFV_THRESHOLD_T = 1;
/** `dkg_aggregator` EVM public-input count for honest-set size `h`. */
export declare function bfvPkExpectedPublicInputsLen(h: number): number;
/** `publicInputs` indices for `committee_hash_hi` / `committee_hash_lo` (matches `BfvPkVerifier`). */
export declare function bfvDkgCommitteeHashIndices(h: number): {
hi: number;
lo: number;
};
/** `decryption_aggregator` EVM public-input count for BFV threshold `t`. */
export declare function bfvDecExpectedPublicInputsLen(threshold: number): number;
/** `publicInputs` indices for decryption-aggregator committee hash limbs. */
export declare function bfvDecCommitteeHashIndices(): {
hi: number;
lo: number;
};
/** Recursive VK hashes for `BfvPkVerifier` sub-circuits (from `pnpm compile:circuits`). */
export declare const BFV_PK_SUB_CIRCUIT_VK_HASH_PATHS: {
readonly nodesFold: string;
readonly c5: string;
};
/** Recursive VK hashes for `BfvDecryptionVerifier` sub-circuits (from `pnpm compile:circuits`). */
export declare const BFV_DECRYPTION_SUB_CIRCUIT_VK_HASH_PATHS: {
readonly c6Fold: string;
readonly c7: string;
};
/**
* Reads a 32-byte recursive VK hash emitted by the circuit build (`*.vk_recursive_hash`).
* Co-redeploy `BfvPkVerifier` / `BfvDecryptionVerifier` when the corresponding sub-circuit VK changes.
*/
export declare function readVkRecursiveHash(filePath: string): string;
/** On-chain `BfvPkVerifier` sub-circuit VK immutables (for deploy-time staleness checks). */
export interface BfvPkVerifierVkReader {
expectedNodesFoldKeyHash(): Promise;
expectedC5KeyHash(): Promise;
}
/** On-chain `BfvDecryptionVerifier` sub-circuit VK immutables (for deploy-time staleness checks). */
export interface BfvDecryptionVerifierVkReader {
expectedC6FoldKeyHash(): Promise;
expectedC7KeyHash(): Promise;
}
/**
* Ensures deployed `BfvPkVerifier` immutables match current `*.vk_recursive_hash` artifacts.
* Call when reusing an address from `deployed_contracts.json` after `pnpm compile:circuits`.
*/
export declare function assertBfvPkVerifierSubCircuitVkHashes(verifier: BfvPkVerifierVkReader, address: string): Promise;
/**
* Ensures deployed `BfvDecryptionVerifier` immutables match current `*.vk_recursive_hash` artifacts.
*/
export declare function assertBfvDecryptionVerifierSubCircuitVkHashes(verifier: BfvDecryptionVerifierVkReader, address: string): Promise;
export interface DeploymentArgs {
address: string;
constructorArgs?: Record;
proxyRecords?: Record;
blockNumber?: number | null;
}
export interface ChainDeployments {
[contractName: string]: DeploymentArgs;
}
export interface Deployments {
[chainName: string]: ChainDeployments;
}
/**
* Defines the Enclave.config.yaml structure
*/
export interface EnclaveConfig {
chains: Array<{
name: string;
rpc_url: string;
contracts: {
e3_program?: {
address: string;
deploy_block: number;
};
enclave?: {
address: string;
deploy_block: number;
};
ciphernode_registry?: {
address: string;
deploy_block: number;
};
bonding_registry?: {
address: string;
deploy_block: number;
};
slashing_manager?: {
address: string;
deploy_block: number;
};
fee_token?: {
address: string;
deploy_block: number;
};
};
}>;
program: unknown;
nodes: unknown;
}
/**
* Store the deployment arguments for a given contract and chain
* @param args - The deployment arguments to store
* @param contractName - The name of the contract to store the deployments for
* @param chain - The chain to store the deployments for
*/
export declare const storeDeploymentArgs: (args: DeploymentArgs, contractName: string, chain: string) => void;
/**
* Read the deployment arguments for a given contract and chain
* @param contractName - The name of the contract to read the deployments from
* @param chain - The chain to read the deployments from
* @returns The deployment arguments for the given contract and chain
*/
export declare const readDeploymentArgs: (contractName: string, chain: string) => DeploymentArgs | undefined;
/**
* Read all the deployments from the deployments file
* @returns All the deployments from the deployments file
*/
export declare const readAllDeployments: () => Deployments;
/**
* Clean the deployments for a given network
* @param network - The network for which to clean the deployments
*/
export declare const cleanDeployments: (network: string) => void;
/**
* Remove deployment records for a local Hardhat network and legacy provider-name buckets.
*/
export declare const cleanLocalDeployments: (network: string) => void;
/**
* Check if two arrays are equal by checking the values inside
* @param arr1 - The first array
* @param arr2 - The second array to check
* @returns Whether the two arrays are equal
*/
export declare function areArraysEqual(arr1: T[], arr2: T[]): boolean;
/**
* The function to update the enclave.config.yaml file with the deployed contract addresses.
* Uses line-by-line text manipulation to preserve comments, blank lines, and quote style.
* @param chainToConfig - The chain name to update in the config
* @param pathToConfigFile - The path to the enclave.config.yaml file
* @param contractMapping - A mapping of contract names to config keys
*/
export declare const updateE3Config: (chainToConfig: string, pathToConfigFile: string, contractMapping: Record, rpcUrl?: string) => void;
//# sourceMappingURL=utils.d.ts.map