Architecture Overview
This document provides a comprehensive overview of Dodao's technical architecture, helping developers understand how different components work together.
System Architecture
Core Components
-
Smart Contracts (Blockchain Layer)
- Diamond Pattern Implementation (EIP-2535)
- Multi-token Support (ERC-1155)
- Cross-chain Communication
- Task Management System
-
Frontend Application
- Flutter/Dart Implementation
- Cross-platform Support
- Web3 Integration
- Responsive UI/UX
-
Storage Layer
- Arweave Decentralized Storage
- IPFS Integration
- On-chain Data Management
-
Cross-chain Infrastructure
- Axelar GMP Integration
- Hyperlane Support
- LayerZero Protocol
- Wormhole Implementation
Smart Contract Architecture
Diamond Pattern Implementation
// Core Diamond Structure
Diamond (Main Contract)
├── TaskCreateFacet
├── TaskDataFacet
├── AccountsFacet
├── TokenFacet
└── InterchainFacet
Key Components
-
Task Management
- Task Creation and Management
- User Account Management
- Task State Transitions
- Dispute Resolution
-
Token System
- ERC-1155 Implementation
- NFT Management
- Token Economics
- Reward Distribution
-
Cross-chain Communication
- Message Passing
- State Synchronization
- Asset Transfers
- Protocol Integration
Network Architecture
Supported Networks
graph TD
A[Moonbeam] --> B[Axelar]
A --> C[Hyperlane]
A --> D[LayerZero]
A --> E[Wormhole]
B --> F[Connected Chains]
C --> F
D --> F
E --> F
Cross-chain Features
-
Asset Bridging
- Token Transfers
- State Synchronization
- Message Passing
-
Protocol Integration
- Axelar GMP
- Hyperlane
- LayerZero
- Wormhole
Application Architecture
Frontend Components
-
Core Modules
- Wallet Integration
- Task Management UI
- User Profile System
- Notification System
-
Web3 Integration
- Custom WebThree Library
- Transaction Management
- Contract Interaction
- Event Handling
Backend Services
-
Decentralized Storage
- Arweave Integration
- Content Management
- Data Persistence
-
Oracle Services
- Witnet Integration
- External Data Fetching
- GitHub API Integration
Security Architecture
Smart Contract Security
-
Access Control
- Role-based Permissions
- Function Access Control
- Diamond Cut Restrictions
-
Asset Security
- Safe Transfer Patterns
- Reentrancy Protection
- Integer Overflow Prevention
Cross-chain Security
-
Message Verification
- Source Chain Validation
- Message Integrity Checks
- State Verification
-
Protocol Security
- Bridge Security Measures
- Transaction Validation
- Error Handling
Development Workflow
Smart Contract Development
# Local Development
1. Clone Repository
2. Install Dependencies
3. Run Local Network
4. Deploy Contracts
5. Run Tests
Frontend Development
# Setup Development Environment
1. Install Flutter SDK
2. Configure Web3 Dependencies
3. Run Local Development Server
4. Connect to Test Networks
Integration Points
External Systems
-
GitHub Integration
- API Integration
- Webhook Support
- Automated Verification
-
Oracle Integration
- Witnet Oracle Usage
- Data Verification
- External API Access
Performance Considerations
-
Smart Contract Optimization
- Gas Optimization
- Storage Patterns
- Function Delegation
-
Cross-chain Efficiency
- Message Batching
- State Synchronization
- Resource Management
Future Architecture
Planned Improvements
-
Scalability
- Layer 2 Integration
- State Channel Support
- Optimistic Rollups
-
Feature Expansion
- Additional Chain Support
- Enhanced Oracle Integration
- Improved Cross-chain Communication
Resources
This architecture overview provides a foundation for understanding Dodao's technical implementation. For detailed implementation specifics, refer to the respective documentation sections.