Skip to content

Add mark_complete, resolve_dispute, WalletGuard, Tighten RLS, and Redeploy Contract#53

Merged
johneliud merged 39 commits into
mainfrom
fix/bugs
Jun 7, 2026
Merged

Add mark_complete, resolve_dispute, WalletGuard, Tighten RLS, and Redeploy Contract#53
johneliud merged 39 commits into
mainfrom
fix/bugs

Conversation

@johneliud

Copy link
Copy Markdown
Owner

Description

Implements the full freelancer completion gate (mark_complete → approve), admin dispute resolution, a shared WalletGuard component, tighter Supabase RLS policies, and redeployment of the updated contract to testnet.

Type of Change

  • New feature
  • Bug fix
  • Refactor / cleanup
  • Documentation

Changes Made

  • Contract: Added initialize(resolver) one-time setup, mark_complete (Funded → Completed, freelancer-only), and resolve_dispute (Disputed → Released, resolver-only); approve_milestone now requires Completed status instead of Funded
  • Contract: Added Resolver key to DataKey enum; 15 new tests across mark_complete.rs and resolve_dispute.rs (50 total, all passing)
  • Frontend: Added markComplete and resolveDispute functions to lib/contract.ts
  • Frontend: Added WalletGuard component — replaces ~100 lines of duplicated inline wallet prompts across 4 pages
  • Frontend: Freelancer project detail shows "Mark as Complete" button for Funded milestones; client project manage shows "Waiting for freelancer" state and gates Approve behind Completed status
  • Frontend: Added completed (amber) badge variant to Badge.tsx
  • Frontend: Added console.error to all try/catch blocks; added success toast for application rejection
  • Supabase: Migration 20260607000000_tighten_rls_policies.sql — status check constraints, tighter USING clauses on update policies, unique index on (listing_id, freelancer_address)
  • Contract: Redeployed to testnet → CAYB22PI2YRQPW4VGCX34XSCKMHNPERQYXIJ6Z2OZ3YKISW4XG2DSLIU; initialize called with deployer as resolver
  • Env: All three .env files updated with new contract ID
  • Docs: Both READMEs updated — new lifecycle diagram, contract functions table, initialize step, test count, Supabase RLS SQL

Related Issue

Closes #49
Closes #51
Closes #52

Testing

  • Tested locally
  • All existing pages still load correctly
  • No errors in the server log
  • cargo test passes — 50 tests, 0 failed
  • npx tsc --noEmit passes — 0 errors

Checklist

  • Code follows the existing style
  • No hardcoded secrets or credentials
  • .env.example updated if new env vars were added
  • README updated if setup steps changed

johneliud added 30 commits June 7, 2026 09:49
…ilestone badge variant mapping for Completed status.
@vercel

vercel Bot commented Jun 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
mile-stack Ready Ready Preview, Comment Jun 7, 2026 8:57am

@johneliud johneliud changed the title feat: add mark_complete, resolve_dispute, WalletGuard, tighten RLS, and redeploy contract Add mark_complete, resolve_dispute, WalletGuard, Tighten RLS, and Redeploy Contract Jun 7, 2026
@johneliud johneliud self-assigned this Jun 7, 2026
@johneliud johneliud merged commit d7e1e25 into main Jun 7, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant