Skip to content

[Mike] 01. Implement escrow state persistence#143

Merged
mikewheeleer merged 2 commits intoTalenttrust:mainfrom
Chucks1093:feature/contracts-01-escrow-state-persistence
Apr 1, 2026
Merged

[Mike] 01. Implement escrow state persistence#143
mikewheeleer merged 2 commits intoTalenttrust:mainfrom
Chucks1093:feature/contracts-01-escrow-state-persistence

Conversation

@Chucks1093
Copy link
Copy Markdown
Contributor

@Chucks1093 Chucks1093 commented Mar 25, 2026

Closes #51

Summary

  • replace the inconsistent escrow placeholder implementation with a single persisted state model for escrow lifecycle and participant metadata
  • persist escrow records with client and freelancer addresses, milestone state, funded and released accounting, lifecycle status, timestamps, and one-time reputation issuance tracking
  • add persisted governance parameters and pause or emergency controls that survive across calls and guard state-changing payment flows
  • add a dedicated persistence regression module plus updated lifecycle, governance, security, emergency, and performance coverage
  • remove obsolete legacy test modules and tracked snapshot fixtures tied to the previous conflicting escrow test surface
  • update reviewer documentation in the root README and docs/escrow/ with storage layout, invariants, and security assumptions

Security Notes

  • contract creation requires authenticated client consent and rejects invalid participant or milestone metadata before any escrow state is stored
  • funding is bounded so funded_amount cannot exceed total_amount
  • milestone releases are one-way and require enough funded but unreleased balance to prevent double-release or balance bypass
  • completed contracts grant one pending reputation credit to the recorded freelancer, and that credit is consumed exactly once when reputation is issued
  • governance setup is single-use and governance admin transfer is two-step
  • pause and emergency flags fail closed for all mutating escrow payment paths

Testing

  • cargo fmt --all -- --check
  • cargo test -p escrow

Notes

  • tracked snapshot files from the old escrow test surface were removed because they no longer match the rewritten persistence-focused contract and test suite

@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 25, 2026

@Chucks1093 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

@Chucks1093
Copy link
Copy Markdown
Contributor Author

@mikewheeleer can you please review and close this pr?

@mikewheeleer
Copy link
Copy Markdown
Contributor

@Chucks1093 please resolve the conflicts

@Chucks1093 Chucks1093 force-pushed the feature/contracts-01-escrow-state-persistence branch from 5e3dbf0 to cb3778a Compare March 30, 2026 16:15
@mikewheeleer mikewheeleer merged commit fed4ceb into Talenttrust:main Apr 1, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Mike] 01. Escrow state persistence

2 participants