Refactoring Codebase for Frontend integration . #90
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.
This PR delivers two main improvements to the codebase:
ProtocolCampaign Module Refactoring
Fixed naming: Corrected "ProtocolCampagin" misspelling to "ProtocolCampaign"
Removed deprecated code: Eliminated unused verify_protocol function and CreateTask event
Streamlined protocol initialization by removing redundant protocol_initialized mapping
Enhanced campaign user logic with additional campaign_details field in CampaignMembers struct
Added new helper functions:
get_all_protocol_details: Retrieves all registered protocols with metadata
get_all_campaign_for_members: Returns all campaigns for a user with protocol details
Optimized read operations to return enriched data structures using Option::Some pattern
WeaverContract User Registration Implementation
Added modular components: WeaverComponent and OwnableComponent
Introduced storage for NFT address, user data, and ownership
Implemented a comprehensive user registration flow that:
Added getter/setter functions for critical contract data
The changes improve code quality, enhance developer experience, and establish a complete user onboarding flow within Weaver. Unit tests have been added to validate the functionality.
Rebust integration testing on all changes on tests/test_protocol_component.cairo
Contract Deployed to testnet for frontend integration
weaverContract addressb: 0x000a6ab43cb891ee68a350dbfd2a972bab0379701c6fc115802284dad4d22dea
WeaverNFT address : 0x041def29d2d5c719c89788959db261c708303c6fe9ef2cdcddd3af6678c6bf07
protocols address: 0x02d916e6f8d8e2dc8d3c9a8a6f25f5f72b280ed25fdaf18e09116800c608e26e
protocolNFT address: 0x051685ff5506f403a05385f0ae10ab637336da849925bc5ebf6cd0a04055de12