npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

zetta-contracts

v1.0.0

Published

## Contract Dependencies

Readme

Zetta Protocol System Architecture

Contract Dependencies

graph TD
    A[AgentFactory] -->|Registers| B[LineageTracker]
    C[ModelFactory] -->|Registers| B
    D[DatasetFactory] -->|Registers| B
    E[Agent] -->|Deploys| F[Service]
    E -->|Created by| A
    F -->|Records| B
    F -->|Settles| G[Settlement]
    H[SubnetRegistry] -->|Deploys| I[Subnet]
    I -->|Updates| H
    
    classDef factory fill:#f96,stroke:#333
    classDef core fill:#9cf,stroke:#333
    classDef subnet fill:#9f9,stroke:#333
    class A,C,D factory
    class B,F,G core
    class H,I subnet

Core Contracts

LineageTracker

  • Role: Records and tracks dependencies between assets (Agent/Model/Dataset)
  • Permissions:
    • Owner: Can add/remove factory contract authorizations
    • Authorized Factories: Can record asset dependencies
  • Key Functions:
    • recordLineage: Records asset dependencies
    • getLineage: Retrieves complete dependency tree for an asset

Settlement

  • Role: Handles service fee settlement and distribution
  • Permissions:
    • Owner: Platform admin, verifies receipt signatures
  • Key Functions:
    • submitReceipt: Submits service usage receipts and triggers fee distribution

Service

  • Role: Manages service lifecycle and revenue distribution
  • Permissions:
    • Owner: Service owner
    • Agent: Service creator
  • Key Functions:
    • distributeIncome: Distributes revenue according to dependencies
    • isExpired: Checks if service has expired

SubnetRegistry

  • Role: Manages subnet lifecycle and user-subnet relationships
  • Permissions:
    • Owner: Can suspend/resume subnets and update stake requirements
    • Anyone: Can register new subnets and add stakes
  • Key Functions:
    • registerSubnet: Creates new subnet with specified governance type
    • addStake: Stakes tokens for subnet activation
    • isActive: Checks if subnet meets stake requirements

Subnet

  • Role: Manages subnet membership and governance
  • Permissions:
    • Admin: Has full control over subnet operations
    • Operators: Can manage members and subnet configuration and withdraw income
    • Contributors: Regular subnet members
  • Key Functions:
    • applyForMembership: Join request based on governance type
    • inviteMembers: Add members in invite-only mode
    • withdrawIncome: Withdraws income from subnet

Factory Contracts

AgentFactory

  • Role: Creates and manages Agents
  • Permissions:
    • Owner: Can set distribution thresholds
  • Dependencies:
    • LineageTracker: Records Agent dependencies

DatasetFactory/ModelFactory

  • Role: Creates and manages Datasets/Models
  • Permissions:
    • Owner: Factory contract administrator
  • Dependencies:
    • LineageTracker: Records asset dependencies

Permission Management Flow

  1. Asset Creation

    • Factory contracts must be authorized by LineageTracker
    • Creator becomes asset Owner
  2. Service Deployment

    • Can only be deployed by Agent
    • Service Owner can manage service configuration
  3. Revenue Distribution

    • Service contract automatically distributes based on dependencies
    • Must meet minimum distribution threshold
  4. Fee Settlement

    • Platform admin signs receipts for verification
    • Settlement contract executes actual transfers

Governance Types

DEFAULT (Invite-only)

  • Members join through invitation or merkle proof
  • Requires admin/operator approval
  • Supports both direct invitation and merkle verification

PERMISSIONLESS

  • Open membership model
  • Anyone can join directly
  • No approval required

PERMISSIONED

  • Application-based membership
  • Members must apply and be approved
  • Supports application review process

Subnet Management Flow

  1. Subnet Creation

    • Register subnet through SubnetRegistry
    • Set governance type and owner
    • Meet stake requirements for activation
  2. Membership Management

    • Based on governance type:
      • DEFAULT: Invitation/merkle proof required
      • PERMISSIONLESS: Direct join
      • PERMISSIONED: Application and approval
  3. Revenue Distribution

    • Two modes:
      • SUBNET_MANAGED: Income goes to subnet contract
      • DIRECT: Income goes to individual recipients
  4. Access Control

    • Hierarchical roles:
      • DEFAULT_ADMIN_ROLE: Full control
      • OPERATOR_ROLE: Member management
      • CONTRIBUTOR_ROLE: Basic membership

Security Features

  1. Stake Requirements

    • Subnets must maintain minimum stake
    • Anyone can contribute stake
    • Only owner can withdraw
  2. Member Restrictions

    • One subnet per user
    • Must leave current subnet before joining another
    • Support for member suspension
  3. Governance Controls

    • Type-specific membership flows
    • Merkle proof verification for invite-only
    • Operator management system