Generic Proxy Contract
Relevant source files
The following files were used as context for generating this wiki page:
The generic_proxy is a specialized Aztec contract module designed to provide a reusable proxy architecture for other standardized contracts within the Aztec Standards repository. Its primary purpose is to serve as a dependency for complex contract implementations, such as the Token and NFT contracts, enabling patterns that separate implementation logic from contract instances.
In the context of the Aztec Network, this module leverages the aztec-nr library to facilitate privacy-preserving operations and standard contract structures. By acting as a shared dependency, it ensures consistency across various primitives like the Token Contract and NFT Contract.
Sources: src/generic_proxy/Nargo.toml:1-9, README.md:1-15
Dependency Architecture
The generic_proxy is structured as a standalone Aztec contract package. It depends on the core Aztec framework and is itself utilized as a dependency by several major standards in the repository.
Dependency Flow
The following diagram illustrates how the generic_proxy sits at the base of the Aztec Standards dependency tree, supporting high-level contract implementations.
The diagram shows the hierarchical relationship where generic_proxy consumes the base Aztec library and provides services to the Token and NFT standards.
Sources: src/generic_proxy/Nargo.toml:7-9, src/token_contract/Nargo.toml:11, src/nft_contract/Nargo.toml:10, src/dripper/Nargo.toml:8
Technical Configuration
The module is configured using the Noir package manager (Nargo). It specifies the compiler versions and external repository links required to build proxy-capable contracts on the Aztec devnet.
Package Specifications
| Attribute | Value | Source |
|---|---|---|
| Package Name | generic_proxy | src/generic_proxy/Nargo.toml:2 |
| Type | contract | src/generic_proxy/Nargo.toml:5 |
| Compiler Version | >=0.25.0 | src/generic_proxy/Nargo.toml:4 |
| Core Dependency | aztec-nr/aztec (v4.0.0-devnet.1-patch.0) | src/generic_proxy/Nargo.toml:8 |
Integration in Standards
The generic_proxy is integrated via relative pathing in the Nargo.toml files of implementation contracts. This allows the standards to inherit proxy logic while maintaining their specific privacy extensions and state variables.
Token Contract Integration
The token_contract includes the proxy to support standard AIP-20 (Aztec Token Standard) features while potentially allowing for upgradability or specialized initialization patterns through the proxy layer.
Sources: src/token_contract/Nargo.toml:11, README.md:21-25
NFT Contract Integration
Similarly, the nft_contract utilizes the proxy to implement ERC-721-like functionality with Aztec-specific privacy features, ensuring that unique digital assets can be managed through a consistent interface.
Sources: src/nft_contract/Nargo.toml:10, README.md:38-42
Summary
The generic_proxy contract serves as a foundational utility within the Aztec Standards ecosystem. By providing a centralized proxy implementation, it enables the Token and NFT contracts to maintain a modular architecture, facilitating the deployment of privacy-preserving assets on the Aztec Network. Its integration across multiple packages ensures that the standards follow a unified development pattern.
Sources: src/generic_proxy/Nargo.toml