Pact

April 9, 2026 · View on GitHub

Pact is a trustless escrow protocol for freelance work, deployed on Base. A client deposits ETH into a smart contract, a freelancer delivers work, and funds are released — no middleman, no trust required. The protocol takes a 1% fee.

How It Works

  1. Client creates an escrow — deposits ETH, specifies the freelancer address, a description, and a deadline.
  2. Freelancer delivers — marks the work as delivered onchain.
  3. Client releases funds — ETH goes to the freelancer minus a 1% protocol fee.
  4. Dispute flow — either party can dispute. The contract owner resolves disputes and sends funds to the winner.
  5. Refund — if the deadline passes with no delivery, the client can reclaim their ETH.

Tech Stack

  • Smart Contract: Solidity 0.8.20, OpenZeppelin (Ownable, ReentrancyGuard)
  • Frontend: Next.js 16, React 19, TypeScript, Tailwind CSS
  • Web3: wagmi, viem, RainbowKit
  • Chain: Base (Ethereum L2, Chain ID 8453)
  • Tooling: Hardhat, ethers.js

Project Structure

pact/
├── contracts/
│   └── Pact.sol            # Escrow smart contract
├── scripts/
│   └── deploy.js           # Deployment script
├── frontend/
│   ├── app/                 # Next.js app router
│   │   ├── page.tsx         # Main escrow UI
│   │   ├── providers.tsx    # Web3 providers (wagmi, RainbowKit)
│   │   └── api/             # API routes
│   ├── lib/
│   │   ├── contract.ts      # Contract ABI + address
│   │   └── wagmi.ts         # wagmi config
│   └── public/              # Static assets
├── hardhat.config.js
└── package.json

Local Development

Smart Contract

npm install
npx hardhat compile

To deploy (requires .env with PRIVATE_KEY):

npx hardhat run scripts/deploy.js --network base

Frontend

cd frontend
pnpm install
pnpm dev

Open http://localhost:3000.

Contract Details

  • Fee: 1% (100 basis points) on every release
  • Statuses: Created, Funded, Delivered, Released, Disputed, Refunded
  • Security: ReentrancyGuard on all ETH transfers, Ownable for dispute resolution

License

MIT