How aave/aave-proposals-v3 works
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.