Weaver is an on-chain identity solution built within the Starknet ecosystem. It acts as a digital passport that verifies and showcases users' authenticity and contributions across various Starknet protocols.
The Weaver protocol consists of several core contracts that work together to provide identity and contribution tracking:
-
Weaver Contract (
weaver.cairo
):- Main identity registry
- Handles user registration
- Manages protocol registration
- Tracks user tasks and contributions
-
WeaverNFT Contract (
WeaverNFT.cairo
):- ERC721-compliant NFT contract
- Mints identity NFTs for users
- Tracks NFT ownership and minting history
-
Protocol Contracts (
protocols.cairo
,protocolcomponent.cairo
,protocolNFT.cairo
):- Protocol registration and management
- Campaign creation and participation
- Task creation and completion tracking
- Protocol-specific NFT minting
-
Interfaces (
IWeaver.cairo
,IWeaverNFT.cairo
,Iprotocol.cairo
, etc.):- Standardized contract interfaces
- Defines required functions for interoperability
-
Utilities (
Convert_felt_to_bytearray.cairo
):- Helper functions for data conversion
- Cairo and Starknet development environment
- Scarb package manager
- Starknet Foundry (for testing)
- Clone the repository:
git clone https://github.com/onlydustapp/weaver.git cd weaver
- Install dependencies:
scarb build
- Set up testing environment:
snforge
- Registration:
- Users register with the Weaver contract
- Automatically receive a Weaver NFT
- Protocol Interaction:
- Protocols register with Weaver
- Can create campaigns and tasks
- Users join campaigns and complete tasks
- Contribution Tracking:
- Completed tasks are recorded on-chain
- Users can mint NFTs for completed tasks
- All activity is verifiable via the Weaver contract
- Weaver Contract:
- Acts as the central registry
- Coordinates between users, protocols, and NFTs
- WeaverNFT:
- Minted for user registration
- Minted for protocol registration
- Minted for task completion
- Protocol Contracts:
- Manage protocol-specific campaigns
- Track task completion
- Mint protocol-specific NFTs
The test suite verifies all core functionality of the Weaver protocol.
test_weaver_contract.cairo
: Tests for main Weaver contracttest_protocol_component.cairo
: Tests for protocol functionality
- Run all tests:
snforge test #or scarb test
- Run specific test file:
snforge test test_weaver_contract.cairo #or scarb test test_weaver_contract.cairo
- Run with detailed output:
snforge test -v #or scarb test -v
The tests cover:
- User registration
- Protocol registration
- Task creation and completion
- NFT minting
- Error cases and edge conditions
- Event emission
Weaver provides a comprehensive on-chain identity system with:
- Digital Identity:
- Unique NFT-based identity for each user
- Verifiable on-chain credentials
- Contribution Tracking:
- Records user participation in protocols
- Tracks task completion
- Provides proof of work
- Protocol Integration:
- Standardized interface for protocols
- Tools for campaign management
- Contribution verification
- Developer Reputation:
- Showcase contributions across Starknet ecosystem
- Build verifiable reputation
- Protocol Governance:
- Identify active contributors
- Weight voting power by contribution
- Community Building:
- Recognize and reward participation
- Foster ecosystem engagement
- Built on Starknet for scalability
- Uses Cairo for smart contracts
- Leverages ERC721 for identity NFTs
- Modular design for extensibility
For more information about the Weaver protocol, please refer to: