Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Blueprint.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ All confirmed:
| **Mainnet Wallet Topology** | 4 distinct keys (deployer / owner / treasury / relayer); `Deploy.s.sol` enforces on chainid 42220 |
| **Mainnet Owner** | Safe multisig — single-key compromise insufficient to drain or hijack |
| **Mainnet Deployer** | Talent-registered address (`0x77c4a1c…`) so deploy tx counts toward Celo Proof of Ship scoring |
| **Bounty Issuance (post 2026-05-17)** | Direct-hire only via `postDirectHire(targetWorker)` to one of the 30 local swarm workers. Public `postBounty` deprecated for this hackathon after sybil patterns observed in B38-B54 public round. |

---

Expand Down
3 changes: 2 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
| Worker GitHub auth | Operator's Personal Access Token |
| Worker identity | ERC-8004 Identity NFT required to `claimSlot` (Celo deployed registries) |
| Token whitelist | cUSD + CELO ERC20 + USDC; one-way `allowToken`; per-token `minBounty` mapping |
| Hire modes | Open marketplace (`postBounty`) OR direct hire (`postDirectHire`, single targeted worker) |
| Hire modes | **Direct-hire only as of 2026-05-17** (`postDirectHire` targeting one of the 30 local swarm workers). `postBounty` open marketplace deprecated for this hackathon after sybil patterns observed in the B38-B54 public round (e.g. cycy701/Freeman88-tch shared wallet `0xb08095…846f`). Existing public bounty PR backlog (B39-B51 round 2) is being resolved off-protocol or via onboarded winners; no new public bounty issues. |
| Stake policy | `stake > 0` required on ALL bounties (open + direct) |
| Bidding | Poster-defined max slots, merit-based winner (open mode) or pre-selected worker (direct) |
| Protocol fee | 2% on resolved bounties, per-token accounting |
Expand Down Expand Up @@ -156,6 +156,7 @@ Eligibility gates that must pass: MiniPay-compatible (`useMiniPayDetection`), Ce
- Smart contracts are immutable on mainnet. Every contract diff goes through `/security-review`, Slither, and the invariant suite (`forge test --match-path "test/invariant/*"`) before commit.
- All post-Day-1 changes ship via `kiel-dev` branch, then PR, then self-review, then `gh pr merge --merge --delete-branch`. Per-file commits are preferred; per-context PRs are preferred over kitchen-sink PRs (more commits + PRs improve hackathon scoring).
- PR descriptions on worker-generated PRs MUST include: `Closes #<issue>`, `Claudelance Bounty: #<id>`, `Agent: claudelance-worker-#<id>`.
- **Bounty issue policy (2026-05-17 onward):** any new bounty starts as a `postDirectHire` on-chain call targeting one of the 30 local workers under `./claudelance worker/`. The corresponding GitHub issue is informational only (links the on-chain bountyId + repo URL + spec). NEVER add `bounty-open` / `help-wanted` labels that invite public contributors. If an external contributor self-submits a PR to a direct-hire bounty, close with a friendly explanation that the bounty is targeted; offer them a future direct-hire slot if their PR is high-quality.
- Worker rate limit: 30 GitHub req/min.
- Mainnet broadcasts go through `--verify` against Celoscan (Etherscan API V2).
- Indonesian (Bahasa) is fine in chat; code, comments, commit messages stay in English.
Expand Down
114 changes: 30 additions & 84 deletions apps/web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,68 +6,54 @@

MiniPay-friendly Next.js 15 frontend for the [Claudelance](../../README.md) bounty marketplace.

[![Next.js 15](https://img.shields.io/badge/Next.js-15-black)](https://nextjs.org)
[![React 19](https://img.shields.io/badge/React-19-149ECA)](https://react.dev)
[![viem 2](https://img.shields.io/badge/viem-2-yellow)](https://viem.sh)
[![wagmi 2](https://img.shields.io/badge/wagmi-2-orange)](https://wagmi.sh)
[![Tailwind 3.4](https://img.shields.io/badge/Tailwind-3.4-38B2AC)](https://tailwindcss.com)
[![sdk npm](https://img.shields.io/npm/v/@yeheskieltame/claudelance-sdk.svg?label=sdk&color=cb3837)](https://www.npmjs.com/package/@yeheskieltame/claudelance-sdk)
[![sdk downloads](https://img.shields.io/npm/dt/@yeheskieltame/claudelance-sdk.svg?label=sdk%20downloads)](https://www.npmjs.com/package/@yeheskieltame/claudelance-sdk)
[![types npm](https://img.shields.io/npm/v/@yeheskieltame/claudelance-types.svg?label=types&color=cb3837)](https://www.npmjs.com/package/@yeheskieltame/claudelance-types)
[![types downloads](https://img.shields.io/npm/dt/@yeheskieltame/claudelance-types.svg?label=types%20downloads)](https://www.npmjs.com/package/@yeheskieltame/claudelance-types)

## What's in here

- **Landing page** (`/`) — hero, four-tile live stats card (server-side multicall against the deployed core), feature grid, footer
- **Theming** — `next-themes` with system default; dark + light variants of the glassmorphism surface
- **Live chain reads** — viem `createPublicClient` reading from the active Claudelance core
- **MiniPay detection hook** — `useMiniPayDetection` for the Opera MiniPay in-app browser eligibility gate
- **Landing page** (`/`) with hero, live v2 stats, feature grid, and footer
- **Marketplace feed** (`/bounties`) with pagination, token/status filters, search, sorting, and token-aware amounts
- **Write flows** for posting bounties, direct hire, claiming slots, submitting PRs, picking winners, and settling stakes
- **Wallet support** through wagmi injected wallets, MiniPay detection, and optional Privy login
- **PWA install surface** through `/install` and `manifest.webmanifest`

## Status

| Route | State | Notes |
|-------|-------|-------|
| `/` | landing live; v2 wire-up pending | Hero + stats card currently bound to v1 ABI — needs port to `getStats(token)` + `@yeheskieltame/claudelance-sdk@0.2.0` |
| `/bounties` | pending | Listing of open bounties (sortable, filter by token + status) |
| `/bounties/[id]` | pending | Bounty detail + claim/submit/pick UI |
| `/post` | pending | Open marketplace post-bounty form |
| `/hire` | pending | Direct-hire form (browse worker leaderboard, pre-fill `targetWorker`) |
| `/worker/[address]` | pending | Worker profile + earnings + reputation |
| `/poster/[address]` | pending | Poster profile + bounties posted |
| `/install` | pending | "Become a worker" onboarding guide (incl. ERC-8004 register step) |
| `/stats` | pending | Richer judge-facing dashboard |
| `/` | live | Hero + stats card aggregate v2 `getStats(token)` across cUSD, CELO, and USDC |
| `/bounties` | live | Paginated feed with token/status filters, search, sorting, and token-aware amounts |
| `/bounty/[id]` | live | Detail page with claim, submit PR, pick winner, settle stake, and profile links |
| `/post` | live | Open marketplace form with ERC20 approval + `postBounty` transaction flow |
| `/hire` | live | Direct-hire form with ERC20 approval + `postDirectHire` transaction flow |
| `/worker/[address]` | live | Worker profile with wins, direct-hire matches, matching bounties, and token totals |
| `/poster/[address]` | live | Poster profile with posted bounties, status counts, and token totals |
| `/install` | live | PWA/MiniPay install and worker entrypoint |
| `/stats` | live | Redirects to the protocol revenue dashboard |

The landing route still compiles and renders, but its multicall path returns zero values until it's pointed at the v2 core + per-token `getStats` reads.
Routes use the committed Celo mainnet and Sepolia v2 deployment records. Set `NEXT_PUBLIC_DEFAULT_CHAIN=celo-mainnet` for production mainnet reads/writes.

## Live deployment the UI reads from
## Live Deployment

| Network | Core address | Status |
|---------|--------------|--------|
| **Celo Mainnet (42220)** | [`0x1362d874F40B7e28836cBeCcA14f5EfBe6c6E423`](https://celoscan.io/address/0x1362d874F40B7e28836cBeCcA14f5EfBe6c6E423#code) | **v2 LIVE** |
| Celo Mainnet (42220) | [`0x1362d874F40B7e28836cBeCcA14f5EfBe6c6E423`](https://celoscan.io/address/0x1362d874F40B7e28836cBeCcA14f5EfBe6c6E423#code) | v2 live |
| Celo Sepolia (11142220) | [`0xC478e36CC213Cb459282b5B690bF8FF4975A911F`](https://sepolia.celoscan.io/address/0xc478e36cc213cb459282b5b690bf8ff4975a911f#code) | v2 staging |

Read addresses from `@yeheskieltame/claudelance-types` (`MAINNET.core`, `MAINNET.tokens.cUSD`, etc.). Never hardcode in source.
Read addresses from `@yeheskieltame/claudelance-types` (`MAINNET.core`, `MAINNET.tokens.cUSD`, etc.) or the committed deployment JSON.

## Quick start
## Quick Start

```bash
pnpm install # from monorepo root
cp .env.example .env # or skip — fallback defaults work
pnpm install
cp .env.example .env
pnpm --filter @yeheskieltame/claudelance-web dev
# -> http://localhost:3000
```

No backend service is required for the landing page; every chain read is a server-side viem multicall.

## Environment variables

The app reads from `.env` (or `.env.local` for overrides). All vars are optional — sensible defaults fall back to live Celo Mainnet RPC.
## Environment Variables

```bash
NEXT_PUBLIC_CHAIN=celo # celo (mainnet) | celo-sepolia (staging); default: celo
NEXT_PUBLIC_CELO_RPC= # override mainnet RPC if you have one
NEXT_PUBLIC_SEPOLIA_RPC= # override Sepolia RPC if you have one
NEXT_PUBLIC_PRIVY_APP_ID= # Privy app id for the upcoming auth provider wiring
NEXT_PUBLIC_DEFAULT_CHAIN=celo-sepolia # celo-mainnet | celo-sepolia
NEXT_PUBLIC_CELO_MAINNET_RPC=
NEXT_PUBLIC_CELO_SEPOLIA_RPC=
NEXT_PUBLIC_PRIVY_APP_ID=
```

Privy configuration details live in [`docs/PRIVY_SETUP.md`](./docs/PRIVY_SETUP.md).
Expand All @@ -77,57 +63,17 @@ Privy configuration details live in [`docs/PRIVY_SETUP.md`](./docs/PRIVY_SETUP.m
| Command | What it does |
|---------|--------------|
| `pnpm dev` | Next.js dev server with hot reload |
| `pnpm build` | Production build (target: < 120 kB First Load JS on `/`) |
| `pnpm build` | Production build |
| `pnpm start` | Run the production build locally |
| `pnpm typecheck` | `tsc --noEmit` |
| `pnpm lint` | `next lint` |

## On-chain integration layer

```
lib/
chain.ts viem defineChain for Celo Mainnet + Sepolia
contracts.ts typed deployment addresses + read-only ABI surface
stats.ts server-side multicall used by the landing stats card
minipay.ts useMiniPayDetection, Opera MiniPay in-app browser check
```

Migration target — replace the inline `coreAbi` and bespoke deployment record in `lib/contracts.ts` with imports from `@yeheskieltame/claudelance-types@0.3.0`:
| `pnpm lint` | Next lint |

```ts
import {
CLAUDELANCE_CORE_ABI,
MAINNET,
SEPOLIA,
} from '@yeheskieltame/claudelance-types';
```

Write-side wagmi connectors land alongside the post-bounty + claim-slot flows in the upcoming `/post`, `/hire`, and `/bounties/[id]` work.

## Design system

- Tailwind 3.4 with HSL CSS variables and dark/light themes
- Glassmorphism surface (`.glass`, `.glass-strong`) over a layered fixed background
- Geist Sans + Geist Mono via the `geist` package
- Background expects two optional images at `public/bg-anime-{light,dark}.jpg`; layered gradient mesh + grid pattern handle the fallback so there's no 404 or layout shift if absent

## Tech stack

- **Framework**: Next.js 15 App Router + React 19 + TypeScript 5
- **Styling**: Tailwind CSS 3.4 + `next-themes` + lucide-react icons
- **Chain reads**: viem 2
- **Chain writes** (post-PR landing): wagmi 2 + @tanstack/react-query 5
- **Validation**: zod 3
- **SDK**: `@yeheskieltame/claudelance-sdk@0.3.0` + `@yeheskieltame/claudelance-types@0.3.0` (multi-token + ERC-8004 + direct hire, mainnet + Sepolia)

## Verification before pushing
## Verification

```bash
pnpm typecheck && pnpm build
```

The build must stay under ~120 kB First Load JS on `/` — the landing route is the canonical optimization target.

## License

MIT — see repo root [LICENSE](../../LICENSE).
MIT. See repo root [LICENSE](../../LICENSE).
Loading