-
Notifications
You must be signed in to change notification settings - Fork 47
Open
Labels
ASAPPriority:highhelp wantedExtra attention is neededExtra attention is neededonlydust-waveContribute to awesome OSS repos during OnlyDust's open source weekContribute to awesome OSS repos during OnlyDust's open source week
Description
ποΈ 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 scriptsAcceptance Criteria:
π€ Build & Compilation:
- scarb build succeeds without warnings
- All contracts compile with Cairo 2.11.4
- No duplicate contract definitions
- Consistent storage patterns across all contracts
- Proper module exports and imports
βοΈ Functionality:
- All existing functionality preserved
- Storage operations work consistently
- Events emit correctly for all state changes
- Error handling prevents invalid operations
- Cross-contract calls work properly
π§ͺ Testing:
- All existing tests pass
π Documentation:
- Architecture documentation complete
- Deployment guides for each module
- Integration examples provided
Uniti sumus.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
ASAPPriority:highhelp wantedExtra attention is neededExtra attention is neededonlydust-waveContribute to awesome OSS repos during OnlyDust's open source weekContribute to awesome OSS repos during OnlyDust's open source week