Repository project

Continuous Payments

Per-second wage vesting in an Ethereum contract

Accrued wages, contractor withdrawals, and employer access to unvested funds.

  • Solidity
  • Ethereum
  • JavaScript
  • Truffle
  • Web3
  • Webpack

00 / Overview

The project at a glance.

Continuous Payments models wages as funds that vest every second. A configurable payment rate determines the amount available to a contractor, capped by the contract balance. The employer can withdraw the remaining unvested balance.

Implementation

Implemented the vesting and withdrawal contract, a mock clock for time-based tests, and JavaScript tests with Truffle/Webpack tooling.

Project scope

A time-based payment contract with distinct withdrawal rules for accrued wages and remaining employer funds.

01

Time-based payment logic

The contract records a contractor, employer, start time, and wei-per-second rate. Funding starts the payment period, and balanceOwed calculates accrued payment from elapsed time while capping it at available funds. Contractor and employer withdrawals emit events recording the amount and withdrawing address.

02

A focused contract experiment

A mock contract overrides the clock to support time-dependent tests, and the README documents running tests with TestRPC and Truffle. The implementation uses Solidity 0.4.15 and includes a TODO for contract reuse. The focus is the vesting calculation and withdrawal behavior.

How it connects

The payment flow

  1. 01

    Set a payment rate

  2. 02

    Fund the contract

  3. 03

    Accrue wages over time

  4. 04

    Withdraw available funds

Hiring a senior engineer?

Let’s talk engineering.

AI tools, mobile and web products, and the services behind them. Remote US or Los Angeles hybrid.

Email Elliot
Explore another projectEthmailerSending encrypted messages to Ethereum addresses