ποΈ Description:
The current contract codebase has significant architectural issues that prevent proper development and deployment. We need a complete restructuring to support ShadowChat's privacy-first, decentralized social network vision with proper separation of concerns, consistent patterns, and scalable design.
β οΈ Current Problems:
- Mixed Cairo versions - Cairo 0 and Cairo 2 contracts coexist
- Inconsistent storage patterns - Vec vs Map+Counter mismatches
- Duplicate contract definitions - Multiple ProfileSystem implementations
- Poor separation of concerns - All contracts mixed in single files
- Missing core infrastructure - No encryption, governance, or identity layers
- Inconsistent naming conventions - Mixed patterns across contracts
- No clear module boundaries - Hard to maintain and extend
ποΈ Proposed Architecture:
contract/
βββ src/
β βββ lib.cairo # Main entry point, exports all modules
β βββ core/
β β βββ mod.cairo # Core module exports
β β βββ storage.cairo # Shared storage patterns and utilities
β β βββ events.cairo # Common event definitions
β β βββ errors.cairo # Custom error types
β βββ messaging/
β β βββ mod.cairo # Messaging module exports
β β βββ message_storage.cairo # Message storage contract
β β βββ media_sharing.cairo # Media sharing contract
β β βββ encryption.cairo # E2E encryption layer
β βββ identity/
β β βββ mod.cairo # Identity module exports
β β βββ profile_nft.cairo # User profile NFT contract
β β βββ anonymous_identity.cairo # ZK-based anonymous identity
β β βββ reputation.cairo # Reputation system
β βββ governance/
β β βββ mod.cairo # Governance module exports
β β βββ community.cairo # Community/group management
β β βββ voting.cairo # Voting and proposal system
β β βββ moderation.cairo # Content moderation
β βββ storage/
β βββ mod.cairo # Storage module exports
β βββ ipfs_manager.cairo # IPFS integration
β βββ arweave_manager.cairo # Arweave integration
βββ tests/
β βββ integration/ # Integration tests
β βββ unit/ # Unit tests by module
β βββ fixtures/ # Test data and utilities
βββ migrations/ # Contract upgrade scripts
Acceptance Criteria:
π€ Build & Compilation:
βοΈ Functionality:
π§ͺ Testing:
π Documentation:
Uniti sumus.
ποΈ Description:
The current contract codebase has significant architectural issues that prevent proper development and deployment. We need a complete restructuring to support ShadowChat's privacy-first, decentralized social network vision with proper separation of concerns, consistent patterns, and scalable design.
ποΈ Proposed Architecture:
Acceptance Criteria:
π€ Build & Compilation:
βοΈ Functionality:
π§ͺ Testing:
π Documentation:
Uniti sumus.