Problem Statement
Global constants defined in a Noir contract are not included in the generated artifact. This forces consumers (e.g. TypeScript clients) to manually duplicate those values, which can silently drift out of sync with the contract.
Proposed Solution
Export Noir contract globals in the artifact so that consumers can read them directly at runtime, without having to hardcode the values themselves.
Example Use Case
// Instead of duplicating:
const PURPOSE_AUTHORIZE_AZTEC_TRANSACTION = "Authorize Aztec Transaction";
// Read directly from the artifact:
const { PURPOSE_AUTHORIZE_AZTEC_TRANSACTION } = MyContractArtifact.globals;
Alternative Solutions
Manually keeping the TypeScript constants in sync with the Noir globals — error-prone and requires discipline across every change.
Additional Context
This came up when building an account contract that defines purpose strings as Noir globals. The TypeScript signing code needs the same strings to construct EIP-712 typed data, but currently has no way to obtain them from the artifact.
Problem Statement
Global constants defined in a Noir contract are not included in the generated artifact. This forces consumers (e.g. TypeScript clients) to manually duplicate those values, which can silently drift out of sync with the contract.
Proposed Solution
Export Noir contract globals in the artifact so that consumers can read them directly at runtime, without having to hardcode the values themselves.
Example Use Case
Alternative Solutions
Manually keeping the TypeScript constants in sync with the Noir globals — error-prone and requires discipline across every change.
Additional Context
This came up when building an account contract that defines purpose strings as Noir globals. The TypeScript signing code needs the same strings to construct EIP-712 typed data, but currently has no way to obtain them from the artifact.