Skip to content

feat(compliance): enforce KYC whitelist and escrow holding for restricted assets (#1158) - #1191

Open
xtep103 wants to merge 4 commits into
Fracverse:masterfrom
xtep103:feat/beneficiary-whitelist-guard
Open

feat(compliance): enforce KYC whitelist and escrow holding for restricted assets (#1158)#1191
xtep103 wants to merge 4 commits into
Fracverse:masterfrom
xtep103:feat/beneficiary-whitelist-guard

Conversation

@xtep103

@xtep103 xtep103 commented Aug 29, 2026

Copy link
Copy Markdown

Description

Closes #1158

This pull request implements regulatory-compliant token transfer enforcement across the InheritX smart contracts suite on testnet. It introduces cross-contract KYC whitelist verification via AccessControlContract::is_kyc_approved and an escrow holding mechanism for restricted asset payouts when beneficiaries have not yet satisfied KYC compliance.

Key Changes

Area Summary
Access Control Contract (contracts/access-control) Implemented full AccessControlContract Soroban contract with is_kyc_approved, submit_kyc, approve_kyc, reject_kyc, assign_role, revoke_role, has_role, get_roles, and pause state management.
Cross-Contract KYC Verification (contracts/inheritance-contract) Added set_access_contract / get_access_contract peer linking with version compatibility checks; updated is_kyc_approved and check_beneficiary_kyc_approved to query AccessControlContract dynamically via try_invoke_contract.
Restricted Asset & Plan Guards (contracts/inheritance-contract) Added set_restricted_asset, is_asset_restricted, set_plan_restricted, and is_plan_restricted methods to mark tokens and inheritance plans subject to KYC enforcement.
Escrow Holding & Release Mechanism (contracts/inheritance-contract) When unwhitelisted beneficiaries attempt to claim restricted assets, funds are held securely in an EscrowRecord and EscrowHeldEvent is published. Once KYC is approved in AccessControlContract, release_escrow_payout releases funds, finalizes claim, and assigns Role::Beneficiary.
Storage Optimization (contracts/inheritance-contract) Encapsulated whitelist/escrow storage keys into a compact WhitelistKey enum to preserve Soroban #[contracttype] variant limits and gas efficiency.

Verification & Testing

  • Added unit tests covering:
    • Access control contract linking and version mismatch prevention.
    • Cross-contract KYC status checks against AccessControlContract.
    • Restricted asset and plan flag management.
    • Escrowing payouts for unapproved beneficiaries on restricted plans.
    • Releasing escrow payouts upon KYC verification approval.
    • Rejection of unauthorized release attempts and prevention of double release.
  • Ran all test suites:
    • cargo test --workspace passed 491 tests with 0 failures across all crates (inheritance-contract: 343 passed, lending-contract: 133 passed, loan-nft: 10 passed, mock-token: 5 passed).

@drips-wave

drips-wave Bot commented Aug 29, 2026

Copy link
Copy Markdown

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

@ONEONUORA

Copy link
Copy Markdown
Contributor

@xtep103
Pls make implementation to pass ci checks
@xtep103

@ONEONUORA

Copy link
Copy Markdown
Contributor

@xtep103
Pls update on this PR

@ONEONUORA

Copy link
Copy Markdown
Contributor

@xtep103
Run cargo fmt --all -- --check and clippy

@ONEONUORA

Copy link
Copy Markdown
Contributor

@xtep103
Ci still failing

@xtep103

xtep103 commented Sep 6, 2026

Copy link
Copy Markdown
Author

@Fracverse Hi! This PR is open and ready for review — happy to address any feedback. Thanks!

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.

Contract: Implement Beneficiary Whitelist Guard for Restricted Inheritance Assets

2 participants