Skip to main content

Overview

Complete guide for integrating ZKScore smart contracts using the viem library.

Installation

Basic Setup

Client Configuration

Contract Configuration

Identity Operations

Check Identity Status

Mint Identity

Score Operations

Get User Score

Listen to Score Updates

Achievement Operations

Get User Achievements

Claim Achievement

Trust Registry Operations

Create Attestation

Multi-chain Support

Chain Configuration

Best Practices

  1. Use Type Safety: Leverage viem’s TypeScript support
  2. Handle Errors Gracefully: Implement comprehensive error handling
  3. Use Event Watchers: Watch contract events for real-time updates
  4. Batch Operations: Combine multiple calls when possible
  5. Monitor Gas Prices: Use appropriate gas prices for network conditions