Skip to content

Stellopay/Starknet-Contracts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StelloPay — Programmable Payroll & Work-Agreement Protocol (Starknet)

Overview

StelloPay is a programmable payroll and work-agreement protocol built on Starknet.
It enables DAOs and Web3 teams to lock funds upfront and release payments automatically based on predefined rules such as time, milestones, or governance approvals, using Cairo smart contracts.

The protocol replaces trust-based, manual payroll operations with on-chain enforceable agreements.


Core Idea

At its core, StelloPay introduces a new primitive:

Work agreements as smart contracts backed by escrowed funds

Instead of trusting a treasury or admin to pay contributors manually, StelloPay ensures that:

  • Funds are secured before work starts
  • Payment rules are defined on-chain
  • Releases happen automatically when conditions are met

This creates trust-minimized, transparent compensation for DAOs and contributors.


Problem Statement

DAOs and Web3 teams face several challenges:

  • Manual and error-prone contributor payments
  • Lack of trust between treasuries and contributors
  • No standardized on-chain payroll primitive
  • Difficulty managing milestone-based or conditional payouts

Existing solutions rely heavily on off-chain processes and human intervention.


Solution

StelloPay solves this by:

  • Locking funds in escrow before work begins
  • Encoding payment conditions in Cairo smart contracts
  • Automatically releasing funds when conditions are satisfied
  • Providing full on-chain transparency and auditability

Design Principles

  • Trust minimization: No party can unilaterally control funds
  • Automation-first: Payments are rule-driven, not admin-driven
  • Composable: Can integrate with DAOs, multisigs, governance systems
  • Protocol-level: Designed as a reusable primitive, not just an app

High-Level Architecture

Actors:

  • DAO / Employer
  • Contributor
  • StelloPay Smart Contracts
  • ERC-20 Tokens on Starknet

Main Components:

  1. Payroll Escrow
  2. Work Agreement
  3. Payment Release Logic
  4. (Optional) Factory & Registry

Low-Level Contract Design

1. Payroll Escrow Contract

Purpose

  • Securely hold funds allocated for work agreements

Responsibilities

  • Accept deposits from employers/DAOs
  • Release funds only when authorized by agreement logic
  • Prevent arbitrary withdrawals

Core Functions

  • deposit(token, amount)
  • release(to, amount)
  • refund_remaining()

Key Properties

  • Funds are locked upfront
  • Escrow is controlled by agreement rules, not humans

2. Work Agreement Contract

Purpose

  • Define the rules under which payments are released

Stored Parameters

  • Employer / DAO address
  • Contributor address
  • Payment token
  • Total payment amount
  • Payment type
  • Agreement status

Supported Payment Types

  • Time-based (salary)
  • Milestone-based
  • Task-based / approval-based

Core Functions

  • create_agreement()
  • activate()
  • pause()
  • cancel()

3. Payment Release Logic

Purpose

  • Enforce payment conditions

Release Conditions

  • Time elapsed (block timestamp)
  • Milestone approval
  • DAO multisig or governance approval

Validation Checks

  • Agreement is active
  • Funds are available
  • Condition is satisfied
  • Payment not already released

4. Dispute & Safety Mechanisms

Pause

  • Temporarily stop payments

Cancel

  • End agreement early
  • Remaining funds returned to employer after rules are met

Timeouts

  • Prevent funds from being permanently locked

Example Flows

Example 1: Monthly DAO Salary

  1. DAO deploys a Work Agreement:
    • Contributor: Alice
    • Salary: 1,000 USDC/month
    • Duration: 3 months
  2. DAO deposits 3,000 USDC into Escrow
  3. Every 30 days:
    • Contract verifies time condition
    • 1,000 USDC released automatically

Example 2: Milestone-Based Grant

  1. DAO defines milestones:
    • Spec completed → 1,500 USDC
    • Deployment → 2,000 USDC
    • Audit passed → 1,500 USDC
  2. DAO locks 5,000 USDC
  3. Each milestone requires approval
  4. Approved milestone triggers payment release

Example 3: Task-Based Contributor Payments

  1. DAO locks a budget (e.g., 2,000 USDC)
  2. Each approved task releases a fixed amount
  3. Ideal for bounties and per-PR rewards

MVP Scope (Grant-Oriented)

Phase 1 (Grant MVP)

  • Payroll Escrow contract
  • Work Agreement contract
  • Time-based and milestone-based payments
  • Unit tests and documentation

Phase 2 (Post-Grant)

  • Agreement Factory
  • Registry for indexing agreements
  • UI & indexing layer
  • DAO governance integrations

Why Starknet

  • Cairo enables safe, expressive smart contract logic
  • Starknet scalability supports frequent payment operations
  • Strong alignment with DAO and governance use cases
  • Ideal environment for programmable financial agreements

What This Is Not

  • Not a wallet
  • Not a traditional payroll app
  • Not token streaming

StelloPay is a protocol-level payroll primitive.


Long-Term Vision

  • Standard payroll layer for DAOs
  • Cross-chain execution (e.g., settlement on payment-optimized chains)
  • Freelancer and contributor marketplaces
  • On-chain reputation & work history

Summary

StelloPay transforms payroll from a trust-based process into a verifiable, automated, and enforceable on-chain system.

DAO locks funds → Smart contracts enforce rules → Payments release automatically.

That is the core idea.

About

StelloPay is a programmable payroll and work-agreement protocol built on Starknet.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages