Documentation Index
Fetch the complete documentation index at: https://core.anylayer.org/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The ZKScore Achievement Registry contract emits events for all significant actions including achievement creation, claiming, progress updates, and badge minting. These events are essential for tracking achievement lifecycle and building real-time applications.Achievement Events
AchievementCreated
Emitted when a new achievement is created.achievementId(uint256 indexed): The unique achievement IDname(string): Achievement namecategory(uint8): Category index (0-7)rarity(Rarity): Rarity level (0-4)
- When
createAchievement()is successfully called - During batch achievement creation
AchievementClaimed
Emitted when a user claims an achievement.user(address indexed): User who claimed the achievementachievementId(uint256 indexed): The claimed achievement IDtimestamp(uint256): Claim timestamp
- When
claimAchievement()is successfully executed - During batch achievement claims
AchievementUpdated
Emitted when an achievement’s configuration is updated.achievementId(uint256 indexed): The updated achievement IDupdateData(bytes): Encoded update data
- When
updateAchievement()is called - When achievement parameters are modified
AchievementDeactivated
Emitted when an achievement is deactivated.achievementId(uint256 indexed): The deactivated achievement IDtimestamp(uint256): Deactivation timestamp
- When
deactivateAchievement()is called - When achievement is permanently disabled
Progress Events
ProgressUpdated
Emitted when a user’s progress toward an achievement is updated.user(address indexed): User whose progress was updatedachievementId(uint256 indexed): The achievement IDprogress(uint256): New progress value
- When
updateProgress()is called - When automatic progress tracking updates
- During batch progress updates
Badge Events
BadgeMinted
Emitted when an NFT badge is minted for a claimed achievement.user(address indexed): Badge recipientachievementId(uint256 indexed): Associated achievement IDtokenId(uint256): Minted badge token ID
- When achievement is successfully claimed
- Immediately after
AchievementClaimedevent
Event Monitoring
Real-time Achievement Tracker
Event Analytics
Best Practices
Event Handling
- Use Indexed Parameters: Filter events efficiently using indexed parameters
- Handle Missing Events: Implement retry logic for missed events
- Store Event Data: Cache important event data locally
- Monitor Gas Costs: Be aware of gas costs for event queries
- Error Recovery: Implement error handling for event listeners
Performance Optimization
- Limit Block Ranges: Query smaller block ranges to avoid timeouts
- Use Filters: Apply filters to reduce data processing
- Batch Processing: Process multiple events in batches
- Cache Results: Cache frequently accessed event data
- Pagination: Implement pagination for large event sets
Related Documentation
- Contract Overview - Contract architecture and features
- Functions Reference - Complete function documentation
- Integration Guide - Integration examples
- Custom Achievements - Creating custom achievements