Skip to content

Rwa muxed support - #857

Open
ozgunozerk wants to merge 2 commits into
mainfrom
rwa-muxed-support
Open

Rwa muxed support#857
ozgunozerk wants to merge 2 commits into
mainfrom
rwa-muxed-support

Conversation

@ozgunozerk

@ozgunozerk ozgunozerk commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Fixes #843

PR Checklist

  • Tests
  • Documentation

Credit is shared with @yigitcangokmen, will add him as a Co-Author when this PR is to be merged.

Summary by CodeRabbit

  • New Features
    • Added support for transfers to muxed addresses while preserving their destination identifiers in transfer events.
    • Balances and compliance checks continue to apply to the underlying address.
  • Bug Fixes
    • Prevented issuers that do not support custodial sub-accounts from accepting muxed destinations.
    • Maintained enforcement of freeze and identity-verification rules for muxed transfers.
  • Tests
    • Added coverage for muxed transfer events, aggregate balances, compliance restrictions, and unsupported destination handling.

@ozgunozerk
ozgunozerk requested a review from brozorec August 27, 2026 11:18
@ozgunozerk ozgunozerk self-assigned this Aug 27, 2026
@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 49197bb9-9776-4c27-a7c0-310b0a851587

📥 Commits

Reviewing files that changed from the base of the PR and between fbfde38 and 66fd2e0.

📒 Files selected for processing (3)
  • examples/rwa/token/src/contract.rs
  • packages/tokens/src/rwa/storage.rs
  • packages/tokens/src/rwa/test.rs

Included review availability: 4 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.


Walkthrough

RWA transfers now accept MuxedAddress destinations. Transfer processing uses the base address for balances and validation, while events preserve the muxed ID. The example token rejects muxed destinations, and tests cover these behaviors and related failure paths.

Changes

RWA muxed transfer support

Layer / File(s) Summary
Muxed transfer storage path
packages/tokens/src/rwa/storage.rs
RWA transfer APIs forward muxed destinations, use base addresses for processing, and preserve muxed IDs in transfer events.
Issuer transfer override
examples/rwa/token/src/contract.rs
The example token rejects muxed destinations with IdentityVerificationFailed and delegates accepted transfers to RWA::transfer.
Muxed transfer validation tests
packages/tokens/src/rwa/test.rs
Tests cover event IDs, aggregate balances, compliance checks, frozen and unverified addresses, failure paths, and issuer-specific rejection.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Merge Risk: ⚪ Minimal · up to 66fd2

This change is merge-ready after normal checks and review; no actionable merge-blocking risk remains.

Suggested reviewers: brozorec

Poem

A rabbit sends a token down the lane
The base address keeps the balance plain
The muxed ID rides in the event bright
Frozen gates still guard the transfer right
“Hop!” says the rabbit, “the records are precise!”

🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (3 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description includes the linked issue, completed checklist, and contributor credit. It does not describe the implementation, event behavior, balance handling, or compatibility impact. Add a concise summary of the code changes, explain muxed ID preservation and base-address balance handling, and document any public API or behavior changes.
Linked Issues check ⚠️ Warning The pull request addresses muxed destinations and adds related tests. However, it changes the public RWA::transfer signature even though issue #843 requires that signature to remain unchanged and the … Keep the public RWA::transfer signature unchanged, add a private helper that accepts the optional muxed ID, and limit the override to forwarding to.id(). Move destination rejection to a separately linked issue or provide explicit scope for …
Out of Scope Changes check ⚠️ Warning The public RWA::transfer API change and issuer-specific rejection of muxed destinations extend beyond issue #843, which focuses on preserving muxed IDs in transfer events while keeping balances and ot… Remove or separately scope the public API change and muxed-destination rejection. Implement only private muxed-ID propagation for the event while retaining base-address processing and existing plain-address behavior.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies RWA muxed-address support, which is the central change in the pull request.
Docstring Coverage ✅ Passed Docstring coverage is 83.33% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 18 functions across 3 files.
Full details: Linked Issues check

Explanation

The pull request addresses muxed destinations and adds related tests. However, it changes the public RWA::transfer signature even though issue #843 requires that signature to remain unchanged and the muxed ID handling to move into a private helper. The example override also rejects muxed destinations instead of preserving their event ID.

Resolution

Keep the public RWA::transfer signature unchanged, add a private helper that accepts the optional muxed ID, and limit the override to forwarding to.id(). Move destination rejection to a separately linked issue or provide explicit scope for it.

Full details: Out of Scope Changes check

Explanation

The public RWA::transfer API change and issuer-specific rejection of muxed destinations extend beyond issue #843, which focuses on preserving muxed IDs in transfer events while keeping balances and other operations unchanged.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch rwa-muxed-support

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@brozorec brozorec left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also propose an update on SEP-57?

@ozgunozerk

Copy link
Copy Markdown
Collaborator Author

Definitely! I was waiting for a review first before suggesting any change on SEP57

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.

2 participants