Skip to content

feat!: make isContractInitialized a tri-state enum#21754

Open
nchamo wants to merge 3 commits intomerge-train/fairiesfrom
feat/contract-init-status-enum
Open

feat!: make isContractInitialized a tri-state enum#21754
nchamo wants to merge 3 commits intomerge-train/fairiesfrom
feat/contract-init-status-enum

Conversation

@nchamo
Copy link
Contributor

@nchamo nchamo commented Mar 18, 2026

Problem

After #21427, getContractMetadata.isContractInitialized returned boolean | undefined. The undefined case (no instance registered in PXE) was ambiguous -- consumers couldn't distinguish between "not initialized" and "can't determine status".

Fix

Replace boolean | undefined with a ContractInitializationStatus enum (YES, NO, UNKNOWN):

  • Instance registered: compute the private initialization nullifier (includes init_hash) for a definitive YES/NO
  • Instance not registered: fall back to checking the public initialization nullifier (address only). If found: YES. If absent: UNKNOWN (contract may have been privately initialized)

Fixes F-467

@nchamo nchamo self-assigned this Mar 18, 2026
@nchamo nchamo changed the title feat!(aztec.js): make isContractInitialized a tri-state enum feat!: make isContractInitialized a tri-state enum Mar 18, 2026
@nchamo nchamo requested a review from Thunkar March 18, 2026 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant