Skip to content

Feature/anchor payout events#872

Open
Promzy204-bad wants to merge 2 commits into
Fracverse:masterfrom
Promzy204-bad:feature/anchor-payout-events
Open

Feature/anchor payout events#872
Promzy204-bad wants to merge 2 commits into
Fracverse:masterfrom
Promzy204-bad:feature/anchor-payout-events

Conversation

@Promzy204-bad

Copy link
Copy Markdown

feat(contract): Emit payout and fiat anchor off-ramp events in trigger_payout

Summary

Adds Soroban event emission to the trigger_payout procedure to enable the backend to detect and execute Stellar
Anchor SEP off-ramp flows for fiat beneficiaries.

Changes

trigger_payout in lib.rs

  • Emits a payout event for every beneficiary — topics: (symbol, owner, beneficiary_address), data: share amount
  • Emits an anchor_pay event only when fiat_anchor_info is non-empty — topics: (symbol, owner,
    beneficiary_address), data: (share, fiat_anchor_info) — carries the exact amount and bank/mobile-money routing
    string the backend needs to initiate the SEP-24/31 flow

Tests (test.rs)

  • test_trigger_payout_emits_anchor_event_for_fiat_beneficiary — verifies both events fire when routing info is
    present
  • test_trigger_payout_no_anchor_event_for_non_fiat_beneficiary — verifies no anchor_pay event when
    fiat_anchor_info is empty
  • test_trigger_payout_mixed_fiat_and_non_fiat_beneficiaries — verifies exactly one anchor_pay event when only one
    of two beneficiaries has fiat routing, and that token balances remain correct

Acceptance Criteria

  • ✅ Events emitted with proper topics and structure
  • ✅ Includes exact amount and target address parameters
  • ✅ Fiat anchor detection based on fiat_anchor_info metadata flag

closes #834

- Add POST /api/commitments/validate route with per-field rules
- CreateCommitmentStepConfigure: debounced (500ms) server validation,
  AbortController cancellation, aria-invalid/aria-describedby, blocks
  advance on errors with graceful server-down fallback
- 18 unit tests covering debounce, field-error mapping, blocking advance,
  request cancellation, loading state, and multiple simultaneous errors
- docs/CREATE_DRAFT_VALIDATION.md documents the validate contract
- Emit 'payout' event per beneficiary with topics (symbol, owner, address) and data=share
- Emit 'anchor_pay' event when fiat_anchor_info is non-empty, data=(share, fiat_anchor_info)
- Add 3 tests covering fiat/non-fiat/mixed event emission scenarios
@drips-wave

drips-wave Bot commented Jun 27, 2026

Copy link
Copy Markdown

@Promzy204-bad 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

@Promzy204-bad
Run cargo fmt --all -- --check
and clippy

@ONEONUORA

Copy link
Copy Markdown
Contributor

@Promzy204-bad
Update on this Pr
you will be unassign in 6hrs

@ONEONUORA

Copy link
Copy Markdown
Contributor

@Promzy204-bad
Pls update on this PR

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] Implement Fiat Payout Anchor Event Emitters

2 participants