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
This example shows how NFT marketplaces can integrate ZKScore to track trading activity, verify collectors, and reward marketplace participation.
NFT Marketplace Integration
class NFTMarketplaceIntegration {
constructor(marketplace, zkScoreContracts) {
this.marketplace = marketplace;
this.zkScore = zkScoreContracts;
}
async trackNFTPurchase(buyer, seller, nftAddress, tokenId, price) {
// Record trade
await this.marketplace.executeTrade(buyer, seller, nftAddress, tokenId, price);
// Update buyer's NFT score
await this.zkScore.scoreCalculator.updateCategoryScore(buyer, 1, price / 100);
// Check collector achievements
const nftCount = await this.marketplace.getUserNFTCount(buyer);
if (nftCount >= 10) {
await this.zkScore.achievementRegistry.claimAchievement(200, '0x'); // NFT Collector
}
}
}
Best Practices
- Track All Trades: Update scores for every transaction
- Buyer & Seller: Track both sides of trades
- Collection Diversity: Reward diverse collecting
- Rarity Tracking: Higher scores for rare NFTs