import type { Signer } from "ethers"; import type { E3RefundManager } from "../../types/contracts/E3RefundManager"; import type { Enclave, IEnclave } from "../../types/contracts/Enclave"; import type { BondingRegistry } from "../../types/contracts/registry/BondingRegistry"; import type { CiphernodeRegistryOwnable } from "../../types/contracts/registry/CiphernodeRegistryOwnable"; import type { SlashingManager } from "../../types/contracts/slashing/SlashingManager"; import type { MockCiphernodeRegistry } from "../../types/contracts/test/MockCiphernodeRegistry.sol/MockCiphernodeRegistry"; import type { MockComputeProvider } from "../../types/contracts/test/MockComputeProvider"; import type { MockDecryptionVerifier } from "../../types/contracts/test/MockDecryptionVerifier"; import type { MockE3Program } from "../../types/contracts/test/MockE3Program"; import type { MockPkVerifier } from "../../types/contracts/test/MockPkVerifier"; import type { MockCircuitVerifier } from "../../types/contracts/test/MockSlashingVerifier.sol/MockCircuitVerifier"; import type { MockUSDC } from "../../types/contracts/test/MockStableToken.sol/MockUSDC"; import type { EnclaveTicketToken } from "../../types/contracts/token/EnclaveTicketToken"; import type { EnclaveToken } from "../../types/contracts/token/EnclaveToken"; /** Timeout configuration accepted by `Enclave`. */ export interface TimeoutConfig { dkgWindow: number; computeWindow: number; decryptionWindow: number; } /** `[CommitteeSize enum value, [min, max]]`. */ export type CommitteeThreshold = [number, [number, number]]; /** Options accepted by {@link deployEnclaveSystem}. All optional. */ export interface DeployEnclaveSystemOptions { /** Override the sortition submission window (seconds). */ submissionWindow?: number; /** Override `Enclave.maxDuration` (seconds). */ maxDuration?: number; /** Override the timeout config. Defaults to {@link DEFAULT_TIMEOUT_CONFIG}. */ timeoutConfig?: TimeoutConfig; /** Treasury for `E3RefundManager`. Defaults to `"owner"`. */ treasury?: "owner" | Signer; /** `slashedFundsTreasury` passed to `BondingRegistry`. Defaults to `"owner"`. */ slashedFundsTreasury?: "owner" | Signer; /** * If `true` (default), perform the full slashing-side wiring: * - `enclave.setSlashingManager` * - `registry.setSlashingManager` * - `slashingManager.{setCiphernodeRegistry,setEnclave,setE3RefundManager}` * * Pass `false` for legacy fixtures that only wire the * `bondingRegistry <-> slashingManager` link (always wired). */ wireSlashingManager?: boolean; /** * Committee thresholds to install on the Enclave. * Defaults to `[[0, [1, 3]], [1, [2, 5]]]` (Micro & Small). */ committeeThresholds?: CommitteeThreshold[]; /** * Signers to mint `mintUsdcAmount` USDC to. * Defaults to `[owner, notTheOwner]`. * Pass `[]` to skip end-user USDC minting (operators are still funded). */ mintUsdcTo?: Signer[]; /** Amount minted to each entry of `mintUsdcTo`. Defaults to 1,000,000 USDC. */ mintUsdcAmount?: bigint; /** * Number of operators to bond + register + fund + add to the ciphernode * registry. Operators are taken from `getSigners()[2..2+N]`. Defaults to `3`. * Pass `0` to skip operator onboarding entirely. */ setupOperators?: number; /** * BFV parameter set to register as `paramSet 0`. * - `"default"` → degree 512 (used by short tests) * - `"large"` → degree 2048 (used by integration tests) */ bfvParams?: "default" | "large"; /** * If `true`, also deploys the `MockCircuitVerifier` used by slashing * proof-based lanes. Defaults to `false`. */ deployCircuitVerifier?: boolean; /** * If `true`, deploy `MockCiphernodeRegistry` instead of the real * `CiphernodeRegistryOwnable`. The mock implements `ICiphernodeRegistry` * with no-ops / configurable committees for tests that only exercise * BondingRegistry / SlashingManager flows. Implies `setupOperators` may * still be used (the mock's `addCiphernode` is a no-op). * * When `true`, the fixture also skips `ciphernodeRegistry.setSlashingManager` * (the mock does not expose that setter). */ useMockCiphernodeRegistry?: boolean; /** * If `true`, deploy `MockBlacklistUSDC` instead of `MockUSDC` as the * fee/ticket token. The returned `usdcToken` is typed as `MockUSDC` but * the underlying contract exposes `blacklist`/`unblacklist`; tests can * cast to call them. */ useBlacklistFeeToken?: boolean; } /** Mock contract bundle returned by {@link deployEnclaveSystem}. */ export interface EnclaveSystemMocks { e3Program: MockE3Program; decryptionVerifier: MockDecryptionVerifier; pkVerifier: MockPkVerifier; mockComputeProvider: MockComputeProvider; /** Only populated when `deployCircuitVerifier: true`. */ circuitVerifier?: MockCircuitVerifier; } /** Bundle returned by {@link deployEnclaveSystem}. */ export interface EnclaveSystem { enclave: Enclave; ciphernodeRegistry: CiphernodeRegistryOwnable; /** Populated only when `useMockCiphernodeRegistry: true`. */ mockCiphernodeRegistry?: MockCiphernodeRegistry; bondingRegistry: BondingRegistry; slashingManager: SlashingManager; e3RefundManager: E3RefundManager; licenseToken: EnclaveToken; ticketToken: EnclaveTicketToken; usdcToken: MockUSDC; mocks: EnclaveSystemMocks; owner: Signer; notTheOwner: Signer; operators: Signer[]; /** First 3 onboarded operators (when `setupOperators >= 3`). */ operator1: Signer | undefined; operator2: Signer | undefined; operator3: Signer | undefined; /** Resolved treasury signer for `E3RefundManager`. */ treasury: Signer; /** Resolved slashedFundsTreasury signer for `BondingRegistry`. */ slashedFundsTreasury: Signer; /** Default `Enclave.request(...)` params anchored at the fixture's `time.latest()`. */ request: IEnclave.E3RequestParamsStruct; } /** * Deploy a fully-wired Enclave system and return typed handles. Call from a * spec's `setup()` and add only file-specific extras (extra signers, * additional thresholds, custom wiring, etc.). */ export declare function deployEnclaveSystem(opts?: DeployEnclaveSystemOptions): Promise; //# sourceMappingURL=system.d.ts.map