How vemo-network/vemo-core-protocol works
Main Components
• Smart Contract Modules:
• Account Modules – Found mostly in directories like src/accounts and src/abstract/execution. These likely include account management logic (e.g., “AccountV3” in the README).
• Voucher Modules – These contracts (with VoucherFactory, VoucherAccount implementations, etc.) handle voucher creation, data registry associations, and collection management.
• Vesting Modules – Vemo Vesting Factory components are deployed to manage vesting pools.
• Wallet Modules – Vemo Wallet contracts (WalletFactory Proxy, Account Wallet Proxy, and wallet implementations) provide the user’s wallet functionality.
• Supporting Libraries and Helpers:
• The lib folder contains imported libraries for account abstraction, ERC6551 standards, OpenZeppelin implementations, and upgradeability patterns (openzeppelin-foundry-upgrades).
• The src/helpers directory includes helper components for NFT descriptors (including submodules like DelegationURI, NFTAccount, VoucherURI), which are important for token metadata and integrations.
• Deployment and Scripting Resources:
• The script directory contains deployment and verification scripts for both voucher and wallet contracts.
• The foundry.toml, remappings.txt, and package.json indicate build configuration and dependency management.
• Testing Modules:
• The “test” folder is structured into modules for testing accounts, factories, gas profiling, and mocks. This highlights both unit and integration tests for the contracts.
Relationships and Interactions
• How the Wallet, Voucher, and Vesting factory contracts are central “nodes” in the system.
• The “Factory” contracts deploy and manage new instances (e.g., VoucherFactory, WalletFactory).
• The account registry and data registry serve as central stores providing valid addresses and state management for deployed contracts.
• The helpers, especially in NFTDescriptor, interact with the voucher/account modules to encode metadata and assist in URI delegation.
• External interactions:
• Interaction with blockchain networks (e.g., ARB, BNB, AVAX) as specified in the README deployment sections.
• Integration with external services (e.g., Etherscan for contract verification and the use of Cast command-line tools).
Architectural Patterns and Design Principles
• The project shows a modular design: segregating contracts into clear domains (accounts, vouchers, vesting, and deployment).
• Upgradeability and abstraction patterns are evident via separate implementations (Impl directories and upgrade scripts), the use of proxies, and the consistent separation between interface contracts and implementation details.
• Use of industry-standard libraries like OpenZeppelin reinforces safe and maintainable smart contract development practices.
Relevant Technologies, Frameworks, and Tools
• Solidity as the programming language.
• Foundry for building, testing, and deployment (commands like forge build, forge test, forge script).
• Integration with OpenZeppelin contracts (both standard and upgradeable versions).
• Deployment scripts written for various networks, reflecting cross-chain deployment considerations.
• Testing frameworks with gas-reporting and snapshot abilities.
Being Detailed and Exhaustive
• Don’t shy away from splitting components into as many parts as needed; for example, separate “Factory Components” from “Implementation Components” where proxies are used.
• That the labels (addresses, roles defined in the README, network specifics) are mentioned where relevant.