feat: Refactor/pinata integration final#124
Merged
GoSTEAN merged 2 commits intoskill-mind:mainfrom Aug 2, 2025
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
InheritX Smart Contract Refactoring Summary
Overview
Closes #121
This document outlines the comprehensive refactoring of the InheritX smart contract to reduce storage overhead and integrate Pinata/IPFS for off-chain data storage.
Major Changes Made
1. Storage Optimization
Removed Heavy Storage Elements:
user_activities,user_activities_pointerplan_media_messages,media_message_recipients,plan_media_messages_countuser_notificationsverification_code,verification_attempts,verification_expiryrecovery_codes,recovery_code_expiryuser_wallets_length,user_wallets,user_primary_wallet,total_user_walletsfull_name,profile_image,notification_settings,security_settingsKept Essential On-Chain Data:
2. Pinata/IPFS Integration
New IPFS Storage System:
user_ipfs_data- Stores off-chain user dataplan_ipfs_data- Stores off-chain plan detailsUserProfile- Extended profile informationPlanDetails- Detailed plan informationMediaMessages- Media files and messagesActivityLog- User activity historyNotifications- Notification preferencesWallets- Wallet management dataNew Functions Added:
update_user_ipfs_data()- Update user's off-chain dataupdate_plan_ipfs_data()- Update plan's off-chain dataget_user_ipfs_data()- Retrieve user's off-chain dataget_plan_ipfs_data()- Retrieve plan's off-chain data3. Type System Simplification
Simplified Types:
ipfs_hashfield for off-chain dataprofile_ipfs_hashLegacy Support:
4. Dependency Updates
Updated Dependencies:
TODO - Items Removed/Refactored
✅ Completed Removals:
User Activity Storage
user_activitiesmappinguser_activities_pointermappingMedia Message Storage
plan_media_messagesmappingmedia_message_recipientsmappingplan_media_messages_countmappingNotification System
user_notificationsmappingVerification System
verification_codemappingverification_attemptsmappingverification_expirymappingRecovery System
recovery_codesmappingrecovery_code_expirymappingWallet Management
user_wallets_lengthmappinguser_walletsmappinguser_primary_walletmappingtotal_user_walletsmappingDetailed User Profiles
full_namefield removedprofile_imagefield removednotification_settingsfield removedsecurity_settingsfield removed✅ Pinata Integration Added:
IPFS Data Storage
Pinata Utilities
New Interface Functions
Benefits of Refactoring
1. Reduced Gas Costs
2. Improved Scalability
3. Enhanced Flexibility
4. Better Data Management
Migration Guide
For Existing Users:
For Developers:
Testing
Updated Test Configuration:
New Test Areas:
Future Enhancements
Planned Improvements:
Security Considerations:
Conclusion
The refactoring successfully addresses the original issues:
The codebase is now lighter, more efficient, and ready for production use with proper off-chain data management through Pinata/IPFS.