Skip to content

Conversation

@Samuel1-ona
Copy link
Collaborator

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:

  1. Validates eligibility
  2. Assigns unique IDs
  3. Stores user information
  4. Triggers NFT minting
  5. Emits registration events

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

@Samuel1-ona Samuel1-ona merged commit 076a733 into weaver-points:main Apr 23, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant