Skip to content

Feature/transfer ownership entrypoint v2#539

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

Feature/transfer ownership entrypoint v2#539
1nonlypiece merged 12 commits into
Commitlabs-Org:masterfrom
Meet-hybrid:feature/transfer-ownership-entrypoint-v2

Conversation

@Meet-hybrid
Copy link
Copy Markdown
Contributor

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

- Created new dependency files for the zeroize crate version 1.8.2, including references to its source files.
- Added new dependency files for the zmij crate version 1.0.21, with references to its source files and additional library files.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 28, 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.

@1nonlypiece 1nonlypiece merged commit 2364c2a 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