Skip to content

Implement escrow deposit/release, add security tests, and reputation submit_rating (fixes #13 #15 #19 #21)#56

Merged
soomtochukwu merged 2 commits into
DXmakers:mainfrom
Cybermaxi7:feat/escrow-reputation-issues
Mar 28, 2026
Merged

Implement escrow deposit/release, add security tests, and reputation submit_rating (fixes #13 #15 #19 #21)#56
soomtochukwu merged 2 commits into
DXmakers:mainfrom
Cybermaxi7:feat/escrow-reputation-issues

Conversation

@Cybermaxi7
Copy link
Copy Markdown
Contributor

Description:

  • Implemented deposit in lib.rs

    • Transfers USDC into contract custody using token::Client.
    • Verifies client authorization.
    • Records created_at and expires_at (30-day seed).
    • Prevents double deposits and deposits into existing/cancelled jobs.
    • Initializes per-milestone bookkeeping.
  • Implemented release_funds and improved release_milestone

    • release_funds(env, job_id, caller, milestone_index) allows the client to release a specific milestone once.
    • Per-milestone completion is tracked with a Vec<bool> to prevent double-spend.
    • Properly updates released_amount, milestones_released, and status when complete.
  • Added 15 edge-case and adversarial unit tests to lib.rs

    • Tests cover unauthorized access, parameter bounds, double-deposit, double-spend, dispute/resolution edge cases, and more.
  • Implemented reputation rating workflow in lib.rs

    • Added set_job_registry(admin, registry_addr) to configure the JobRegistry.
    • Added submit_rating(env, caller, job_id, target, score):
      • Verifies caller authorization and participation in the job via cross-contract get_job.
      • Ensures job is Completed.
      • Prevents duplicate reviews per (job_id, reviewer).
      • Aggregates total_points and reviews, updates score (basis points), total_jobs.
    • Stores review markers to prevent replay/sybil on the same job.

Files changed:

  • lib.rs — deposit, release_milestone, release_funds, tests
  • lib.rs — reputation aggregates, set_job_registry, submit_rating

closes #13
closes #15
closes #19
closes #21

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Mar 28, 2026

@Cybermaxi7 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@soomtochukwu soomtochukwu merged commit 097981f into DXmakers:main Mar 28, 2026
7 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

2 participants