Skip to main content
Version: v3.0.0-nightly.20251231

Contract Artifacts

Compiling an Aztec contract produces a contract artifact file (.json) containing everything needed to interact with that contract: its name, functions, their interfaces, and compiled bytecode. Since private function bytecode is never published to the network, you need this artifact file to call private functions.

Most developers don't need this

When you compile a contract and use aztec codegen, you get type-safe TypeScript classes that handle artifacts automatically. This page is useful if you're:

  • Building custom tooling around Aztec contracts
  • Debugging compilation or deployment issues
  • Understanding what data is available in artifacts

Where to Find Artifacts

After running aztec compile, artifacts are output to the target/ directory:

target/
└── my_contract-MyContract.json # Contract artifact

Use aztec codegen to generate TypeScript bindings from these artifacts for type-safe contract interaction.

Contract Artifact Structure

A contract artifact contains:

  • name: The contract name as defined in Noir
  • functions: Array of function artifacts (private, public dispatch, and utility functions)
  • nonDispatchPublicFunctions: Public function ABIs (excluding the dispatch function)
  • outputs: Exported structs and globals from the contract
  • storageLayout: Storage slot mappings for contract state
  • fileMap: Source file mappings for debugging

Function Properties

Each function in the artifact includes:

PropertyDescription
nameFunction name as defined in Noir
functionTypeOne of private, public, or utility
isOnlySelfIf true, function can only be called from within the same contract
isStaticIf true, function cannot alter state
isInitializerIf true, function can be used as a constructor
parametersArray of input parameters with name, type, and visibility
returnTypesArray of return value types
errorTypesCustom error types the function can throw
bytecodeCompiled ACIR bytecode (base64 encoded)
verificationKeyVerification key for private functions (optional)
debugSymbolsCompressed debug information linking to source code

Function Types

  • private: Executed and proved locally by the client. Bytecode is not published to the network.
  • public: Executed and proved by the sequencer. Bytecode is published to the network.
  • utility: Executed locally to compute information (e.g., view functions). Cannot be called in transactions.

Parameter and Return Types

Parameters and return values use these type definitions:

TypeDescription
fieldA field element in the BN254 curve's scalar field
booleanTrue/false value
integerWhole number with sign (signed/unsigned) and width (bits)
arrayCollection of elements with length and element type
stringCharacter sequence with fixed length
structComposite type with named fields and a path identifier
tupleUnnamed composite type with ordered fields

Parameter visibility can be public, private, or databus.

Next Steps