# aave/aave-proposals-v3 architecture

> Architecture diagram of the GitHub repository aave/aave-proposals-v3, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aave/aave-proposals-v3
- Repository: https://github.com/aave/aave-proposals-v3

## Overview

##### Main Components
- Proposal Workflow Manager – This is the core governance proposals system that organizes the three-step process: payload deployment, AIP creation, and mainnet proposal submission. This layer is represented by the files in the src/ and diffs/ directories.
- CLI Generator Module – Located under the generator folder, this module provides a command-line interface that helps users generate and bootstrap proposals by creating the required markdown files and associated configuration files. It also includes prompts, templates, and TypeScript logic.
- Smart Contract Config Engine – Referenced in the README and found in the lib/aave-helpers, this component is a helper smart contract that abstracts the “admin” operations with the Aave protocol. It sits in the blockchain interaction layer.
- Testing & Deployment Framework – Built around Foundry (with foundry.toml, Makefile, and test scripts), this component supports testing, deployment, and even verification. It also plays a role in redeploying payloads via scripts and verifying contracts via Etherscan and Catapulta.
- External Services & Tools – Components like IPFS (for automatically uploading proposals upon merge), Etherscan integration for verification via the provided verify script, and configuration via environment variables (i.e. .env file) are used to bridge off-chain and on-chain interactions.

##### Relationships and Data Flow
- Developer/Operator initiates the workflow using the CLI Generator. Their commands (e.g., “npm run generate”) trigger the generator module.
- The generator uses pre-defined templates to create proposal markdown files (AIPs) in the src/ directory and populates configuration files.
- The proposals are then “deployed” as payloads to the blockchain using the Foundry environment. The Makefile abstracts calls to deploy scripts, which in turn interact with the smart contract config engine.
- Results of deployments (payload addresses, encoded hashes, etc.) are used again to complete the proposal creation step.
- Automated test suites (with Foundry and supplementary scripts) validate changes and updates before proposals are merged.
- If verification issues occur, developers follow the troubleshooting steps (copying verify.example.json, editing .env, running custom commands) to ensure that smart contracts are properly verified.

##### Architectural Patterns and Technical Stack
- The project uses a modular pattern with clearly defined directories: generator (CLI & templates), src (proposal descriptions and configurations), diffs (before/after snapshots of proposals), and reports (for automated tests and reports).
- It leverages a build/test/deploy automation environment around Foundry, integrating with standard JavaScript/TypeScript tooling (via npm, tsx) for the CLI module.
- The separation of concerns is evident in how proposals (configuration and MD files) are isolated from generator code and blockchain-related smart contract helpers.

## Diagram (Mermaid)

```mermaid
flowchart TD
    Developer("Developer/Operator"):::developer
    CLI("CLI Generator Module"):::generator
    Proposal("Proposal Workflow Manager"):::workflow
    Testing("Testing & Deployment Framework"):::testing
    SmartContract("Smart Contract Config Engine"):::blockchain
    External("External Services & Tools"):::external

    Developer -->|"initiates"| CLI
    CLI -->|"createsProposalFiles"| Proposal
    Proposal -->|"triggersDeployment"| Testing
    Testing -->|"invokesAdminOps"| SmartContract
    SmartContract -->|"sendsForVerification"| External
    External -->|"verificationFeedback"| Developer

    click CLI "https://github.com/aave/aave-proposals-v3/tree/main/generator/"
    click Proposal "https://github.com/aave/aave-proposals-v3/tree/main/src/"
    click Proposal "https://github.com/aave/aave-proposals-v3/tree/main/diffs/"
    click Testing "https://github.com/aave/aave-proposals-v3/blob/main/foundry.toml"
    click Testing "https://github.com/aave/aave-proposals-v3/tree/main/Makefile"
    click Testing "https://github.com/aave/aave-proposals-v3/tree/main/reports/"
    click SmartContract "https://github.com/aave/aave-proposals-v3/tree/main/lib/aave-helpers/"
    click External "https://github.com/aave/aave-proposals-v3/blob/main/.github/workflows/ipfs.yml"
    click External "https://github.com/aave/aave-proposals-v3/blob/main/.env.example"
    click External "https://github.com/aave/aave-proposals-v3/blob/main/verify.example.json"

    classDef developer fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
    classDef generator fill:#AED6F1,stroke:#3498DB,stroke-width:2px;
    classDef workflow fill:#ABEBC6,stroke:#28B463,stroke-width:2px;
    classDef testing fill:#F5B7B1,stroke:#E74C3C,stroke-width:2px;
    classDef blockchain fill:#D2B4DE,stroke:#8E44AD,stroke-width:2px;
    classDef external fill:#FAD7A0,stroke:#E67E22,stroke-width:2px;
```
