Add FX rate snapshot, swap refund routing, dispute splits, receipt hash - #558
Merged
Pvsaint merged 2 commits intoJul 26, 2026
Conversation
- Capture fx_rate/fx_rate_at on PaymentCharge during verify_payment when an FX oracle is configured (set_fx_oracle); emits PAYMENT/FX_RATE_UNAVAILABLE when no rate can be captured - Record original_token/swap_path on swap_and_pay payments and route process_refund back through the configured DEX router (set_dex_router_address), falling back to a plain USDC refund with REFUND/SWAP_FALLBACK on failure - Add Dispute.payout_splits + set_dispute_payout_splits, distributing funds to multiple recipients in resolve_dispute_with_refund when configured, validated against Error::InvalidSplitSum - Add Refund.receipt_hash, accepted by create_refund and optionally enforced by process_refund via set_refund_policy (Error::MissingReceiptHash), emitting REFUND/HASH_VERIFIED - Remove an accidental duplicate DexRouter contract/impl block in dex_router.rs that prevented the crate from compiling Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GV7kHHjcVZur14umd34W28
|
@yosemite01 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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PaymentCharge.fx_rate/fx_rate_atnow populated byverify_paymentwhen an FX oracle is configured via newset_fx_oracle; emitsPAYMENT/FX_RATE_UNAVAILABLEotherwise.swap_and_paynow recordsoriginal_token/swap_path;process_refundroutes the refund back through a configured DEX router (set_dex_router_address), falling back to a plain USDC transfer +REFUND/SWAP_FALLBACKif the swap fails.Dispute.payout_splits(+ newset_dispute_payout_splits) letsresolve_dispute_with_refunddistribute funds to multiple recipients instead of a single refund, validated againstError::InvalidSplitSum.Refund.receipt_hashaccepted bycreate_refund, optionally enforced byprocess_refundviaset_refund_policy(Error::MissingReceiptHash), emittingREFUND/HASH_VERIFIED.Test plan
cargo test -p fluxapayCloses #446
Closes #448
Closes #445
Closes #443
🤖 Generated with Claude Code
https://claude.ai/code/session_01GV7kHHjcVZur14umd34W28