Skip to content

Global dispute analytics and transparency log 206#236

Merged
Cybermaxi7 merged 5 commits into
MarketXpress:mainfrom
Stanley-Owoh:global-dispute-analytics-and-transparency-log-206
Apr 29, 2026
Merged

Global dispute analytics and transparency log 206#236
Cybermaxi7 merged 5 commits into
MarketXpress:mainfrom
Stanley-Owoh:global-dispute-analytics-and-transparency-log-206

Conversation

@Stanley-Owoh
Copy link
Copy Markdown
Contributor

Summary
Implemented Global Dispute Analytics and Transparency Log (Theme: Part 11: Dispute Resolution V2) and fixed critical fund release logic issues.
Changes Made

  1. Global Dispute Analytics (types.rs)
  • Added new DataKey entries: TotalReleasedCount, TotalRefundedCount, TotalCancelledCount
  • Added GlobalDisputeAnalytics struct with fields for tracking escrow outcomes and failure rates
  1. Analytics Functions (lib.rs)
  • Added analytics_summary() - returns global dispute analytics including failure rate in basis points
  • Added getter functions: get_total_released_count(), get_total_refunded_count(), get_total_disputed_count(), get_total_cancelled_count()
  1. Fund Release Logic Fixes
  • Critical Fix: verify_delivery was NOT updating TotalReleasedAmount - now correctly tracks cumulative released amounts
  • Critical Fix: execute_mediation_settlement was using seller_amount (before fees) instead of net_seller (after fees) - fixed to prevent overcounting
  • Added TotalRefundedCount increment to mediation settlement path
  • Added FundsReleasedEvent to execute_mediation_settlement for event consistency
    Verification Checklist
  • TotalReleasedAmount updated cumulatively, not overwritten
  • Partial releases correctly increment the released total
  • No double-counting across multiple release paths
  • Released amounts use net amounts (after fees deducted)
  • State updates and events reflect correct totals

Closes #206

@Cybermaxi7 Cybermaxi7 merged commit d470ad4 into MarketXpress:main Apr 29, 2026
1 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.

Global Dispute Analytics and Transparency Log

2 participants