Skip to content

feat: implement transfer ownership functionality for funded commitments#534

Merged
1nonlypiece merged 2 commits into
Commitlabs-Org:masterfrom
Meet-hybrid:feature/transfer-ownership-enterypoint
May 28, 2026
Merged

feat: implement transfer ownership functionality for funded commitments#534
1nonlypiece merged 2 commits into
Commitlabs-Org:masterfrom
Meet-hybrid:feature/transfer-ownership-enterypoint

Conversation

@Meet-hybrid
Copy link
Copy Markdown
Contributor

@Meet-hybrid Meet-hybrid commented May 27, 2026

Title
feat(contracts): add transfer_ownership entrypoint for marketplace trading

Summary
This PR implements a secure transfer_ownership entrypoint in the escrow contract to enable secondary trading of marketplace commitments. It ensures only the current owner can authorize transfers, restricts transfers to funded commitments, and maintains accurate owner indexes for both old and new owners.

What Changed
Added transfer_ownership(commitment_id, new_owner) function in contracts/escrow/src/lib.rs.

Enforced authorization via require_auth() for the current owner.

Restricted transfers to Funded commitments only.

Updated Commitment.owner and maintained OwnerIndex for both addresses.

Added tests in contracts/escrow/src/test.rs covering:

Successful transfers

Unauthorized attempts

Index updates

Non‑Funded commitment edge cases

Documented transfer flow, authorization rules, and Funded‑only restriction in contracts/README.md.

Linked Issue
Closes #470

Type of Change
[x] feat

[x] docs

[ ] fix

[ ] refactor

[x] test

[ ] chore

Validation
[x] Tests passed with ≥95% coverage.

[x] Manual verification of index updates and authorization checks completed.

Documentation
[x] Transfer flow documented in README.md.

Checklist
[x] Branch name uses feat/

[x] Commit messages follow Conventional Commits

[x] PR scope matches issue acceptance criteria

@vercel
Copy link
Copy Markdown

vercel Bot commented May 27, 2026

@Meet-hybrid is attempting to deploy a commit to the 1nonly's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 27, 2026

@Meet-hybrid 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

@Meet-hybrid
Copy link
Copy Markdown
Contributor Author

Closes #470

@1nonlypiece 1nonlypiece merged commit 555c53f into Commitlabs-Org:master May 28, 2026
0 of 3 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

Development

Successfully merging this pull request may close these issues.

Contracts - Add marketplace transfer_ownership entrypoint for secondary trading

2 participants