Skip to main content

Overview

This guide provides comprehensive examples for integrating with the ZKScore Achievement Registry contract. It covers Web3 integration, claiming workflows, progress tracking, and best practices for production deployments.
Always test your integration on testnet before deploying to mainnet. Use the testnet contract addresses provided in the Contract Overview section.

Web3 Integration

Basic Setup

Integration Class

Achievement Dashboard

Complete Achievement Tracker

Real-time Progress Tracking

Progress Monitor

Error Handling

Comprehensive Error Handler

Best Practices

Performance Optimization

  1. Cache Achievement Data: Cache achievement metadata locally
  2. Batch Queries: Query multiple achievements in parallel
  3. Event Listening: Use events for real-time updates
  4. Progress Caching: Cache progress data with TTL
  5. Gas Estimation: Estimate gas before claiming

Security Considerations

  1. Verify Requirements: Always check canClaim() before claiming
  2. Validate Proofs: Ensure proof generation is secure
  3. Monitor Events: Track all claim events
  4. Gas Limits: Set appropriate gas limits
  5. Error Handling: Implement comprehensive error handling

User Experience

  1. Progress Feedback: Show real-time progress updates
  2. Clear Requirements: Display achievement requirements clearly
  3. Claim Notifications: Notify users when achievements are claimable
  4. Celebration: Celebrate achievement claims
  5. Badge Display: Show earned badges prominently