Skip to content
Showcase projectBlockchain & Web3
  • 223 tests
  • 100% coverage
  • Slither-analysed

Milestone Escrow

Milestone-based escrow for freelance and agency work, in ETH or any standard ERC-20

Solidity 0.8.28OpenZeppelin v5ETH / ERC-20Foundry

What it is

MilestoneEscrow is a single on-chain escrow contract that holds any number of independent jobs. The client funds the whole budget when creating a job, split into up to 50 milestones, so the freelancer can see the money is there before starting work.

Funds move only when the client releases a milestone, when a neutral arbiter settles a dispute by splitting the unreleased funds in basis points, or when the job is cancelled and the client is refunded. A small protocol fee — hard-capped at 5% and snapshotted per job — is deducted from payouts to the freelancer; refunds are never charged a fee.

The business problem

Remote work between parties who don't know each other runs into a trust gap: clients don't want to pay up front, freelancers don't want to deliver before they're paid. Platforms close that gap, but they charge significant fees, can freeze accounts and decide disputes in ways the parties can't see.

How it works

  1. 1

    Create: the client calls createJob(freelancer, arbiter, token, amounts[]) and funds the full sum in ETH or an ERC-20. The current fee is snapshotted into the job.

  2. 2

    Deliver: the freelancer calls requestRelease(jobId, i) to signal that milestone i is done.

  3. 3

    Release: the client calls releaseMilestone(jobId, i). The freelancer receives the amount minus the fee; once all milestones are released the job is completed.

  4. 4

    Dispute (optional): either party raises a dispute, which freezes the job. The arbiter splits every unreleased milestone between freelancer and client in basis points.

  5. 5

    Cancel (optional): the client can cancel for a full refund before any work was requested or released; the arbiter can cancel while the job is open.

Security measures

  • nonReentrant on every value-moving function; state finalised before external calls (checks-effects-interactions)
  • Griefing-resistant ETH payouts: failed push payments are credited for later withdrawal
  • Fee-on-transfer tokens rejected via balance-before/after check
  • Fee cap (5%) and per-job fee snapshot — the owner can't raise fees on funded jobs
  • Bounded loops (max. 50 milestones) and three distinct roles
  • Ownable2Step; the admin can never touch job funds
  • Fuzzed solvency invariant: contract balance equals the sum of unreleased milestones

Features

  • Any number of jobs in one contract
  • ETH or ERC-20 funding
  • Up to 50 milestones per job
  • Release requests and disputes with basis-point arbiter split
  • Cancel & refund
  • Protocol fee snapshot, capped at 5%

Typical use cases

  • Freelance marketplaces and agency platforms with non-custodial payments
  • B2B service contracts with milestone billing
  • Grant programmes paying out in tranches, with a committee as arbiter

Known limitations

The arbiter is trusted to be neutral — in production a multisig, a DAO or a decentralised court. Rebasing tokens are not supported.

Other showcase contracts

Showcase

Token + Vesting + Staking

A capped ERC-20 with gasless approvals, vesting schedules with cliff for team and investors, and Synthetix-style staking rewards.

ERC-20EIP-2612OpenZeppelin v5

223 tests · 100% coverage · Slither‑analysed

Showcase

SigmaNFT Collection

A fair NFT launch: allowlist and public phases, per-wallet limits, immutable max supply, ERC-2981 royalties and a delayed reveal.

ERC-721ERC-2981Merkle proofs

223 tests · 100% coverage · Slither‑analysed

Showcase

Gold-Backed Token (RWA)

Backing becomes a precondition of minting: tokens can only be minted if the reported gold reserve covers the new total supply.

ERC-20AccessControlProof of reserve

223 tests · 100% coverage · Slither‑analysed

Standards: Solidity 0.8.x, OpenZeppelin, Foundry tests with fuzzing, Slither static analysis, verified source. 223 tests · 100% coverage · Slither-analysed.

Have a project in mind?

Tell us what you're building. You get an honest assessment, a clear scope and a fixed-price or milestone proposal, usually within a few working days.

Prefer to write first? Write to us