Developing Smart Contracts
Aztec.nr is the smart contract development framework for Aztec. It is a set of utilities that help you write Noir programs to deploy on the Aztec network.
Contract Development
Prerequisites
- Install Aztec Sandbox and tooling
- Install the Noir LSP for your editor.
Flow
- Write your contract and specify your contract dependencies. Every contract written for Aztec will have
aztec-nr as a dependency. Add it to your
Nargo.toml
with
# Nargo.toml
[dependencies]
aztec = { git="https://github.com/AztecProtocol/aztec-packages/", tag="v3.0.0-nightly.20250927", directory="noir-projects/smart-contracts/aztec" }
- Profile the private functions in your contract to get a sense of how long generating client side proofs will take
- Write unit tests directly in Noir and end-to-end tests with TypeScript
- Compile your contract
- Deploy your contract with Aztec.js
Section Contents
📄️ Compiling Contracts
Compile your Aztec smart contracts into deployable artifacts using aztec-nargo.
📄️ Declaring Contract Storage
Define and manage storage state in your Aztec smart contracts using various storage types.
📄️ Defining Contract Functions
Define different types of functions in your Aztec smart contracts for various execution environments.
📄️ Calling Other Contracts
Call functions in other contracts from your Aztec smart contracts to enable composability.
📄️ Emitting Events
Learn how to emit events from your Aztec smart contracts for offchain applications to consume.
📄️ Enabling Authentication Witnesses
Enable contracts to execute actions on behalf of user accounts using authentication witnesses.
📄️ Implementing custom notes
Learn how to create and use custom note types for specialized private data storage in Aztec contracts
📄️ Testing Contracts
Write and run tests for your Aztec smart contracts using Noir's TestEnvironment.
📄️ Communicating Cross-Chain
Send messages and data between L1 and L2 contracts using portal contracts and cross-chain messaging.
🗃️ Advanced Topics
5 items