Skip to content

chucksentertainment-hash/PulseRegistry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PulseRegistry 💓

The "Liveness Oracle" for Sustainable Open Source Funding.

PulseRegistry is a decentralized source of truth for project activity within the Drips ecosystem. It solves the critical problem of "Ghost Funding" by ensuring that continuous capital streams only flow to projects that are actively maintained.


🛡️ The Problem: Ghost Funding

In decentralized funding protocols, funds are often streamed continuously over time. While this provides stability, it creates a risk: Abandoned Projects.

  • Scenario: A maintainer stops working on a project, but the funding stream remains active.
  • Impact: Capital is trapped in "dead" projects, reducing the overall efficiency of the ecosystem.
  • Solution: PulseRegistry acts as a circuit breaker, requiring periodic proof-of-work (Heartbeats) to keep the funding valves open.

🏗️ Architecture & System Design

High-Level Workflow

sequenceDiagram
    participant Dev as Maintainer
    participant Git as GitHub/GitLab
    participant Oracle as Pulse Oracle
    participant PR as PulseRegistry Contract
    participant TD as TidalDistributor (Cashier)

    Dev->>Git: Push Code / Merge PR
    Git-->>Oracle: Activity Webhook
    Oracle->>PR: recordHeartbeat(project_id)
    Note over PR: Update lastHeartbeat[id]
    
    TD->>PR: isProjectActive(project_id)?
    alt is Active
        PR-->>TD: true
        TD->>Dev: Distribute Funds
    else is Stale
        PR-->>TD: false
        TD->>TD: Halt Distributions
    end
Loading

Core Components

Component Description
Heartbeat Mapping A global mapping(address => uint256) that records the last Unix timestamp of activity.
Grace Period A constant 30 days window. If now - lastHeartbeat > GracePeriod, the project is "Stale".
Oracle Layer The off-chain component (not in this repo) that bridges Git activity to the blockchain.

💻 Smart Contract API Reference

State Variables

lastHeartbeat

mapping(address => uint256) public lastHeartbeat;

Stores the block timestamp of the last recorded activity for any given address.

GRACE_PERIOD

uint256 public constant GRACE_PERIOD = 30 days;

The immutable time window (default 2,592,000 seconds) after which a project loses its active status.

Functions

recordHeartbeat

function recordHeartbeat(address _project) external;

Updates the liveness status of a project.

  • Requirement: In production, this should be protected by an onlyOracle modifier.
  • Effect: Sets lastHeartbeat[_project] to block.timestamp.

isProjectActive

function isProjectActive(address _project) public view returns (bool);

Determines if a project is eligible for funding.

  • Logic: Returns true if block.timestamp <= lastHeartbeat[_project] + GRACE_PERIOD.
  • Logic: Returns false if the project has never recorded a heartbeat or the period has expired.

🌟 Use Cases

1. Automated Stream Halting

Integrated contracts can automatically pause streams if isProjectActive returns false, redirecting funds to a DAO treasury or active projects.

2. Governance Weighting

DAOs can use project "liveness" as a multiplier for voting power or reward distribution tiers.

3. Investor Transparency

Provides a real-time, on-chain dashboard for funders to see which projects are actually being maintained.


🚀 Development & Setup

Prerequisites

Installation

git clone https://github.com/your-org/pulse-registry.git
cd pulse-registry
npm install

Compilation

npx hardhat compile

Testing

npx hardhat test

🗺️ Future Roadmap

  • Multi-Oracle Support: Aggregate heartbeats from multiple sources (GitHub, Radicle, Manual).
  • Customizable Grace Periods: Allow projects to set their own liveness windows based on their development cycle.
  • Heartbeat History: Track historical activity frequency rather than just the last timestamp.
  • Access Control: Implement robust RBAC (Role-Based Access Control) for oracle management.

📜 License

This project is licensed under the MIT License.


Ensuring every heartbeat of development is met with a pulse of funding.

About

PulseRegistry is an on-chain 'Liveness Oracle' for the Drips ecosystem. It prevents 'Ghost Funding' by tracking project activity via periodic heartbeats. By enforcing a 30-day grace period, it ensures capital only flows to actively maintained projects, maximizing the efficiency of decentralized funding.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors