From 80eb89f010f16cef4d88a7bcf318df1f82b39198 Mon Sep 17 00:00:00 2001 From: jeffyanta Date: Thu, 30 Apr 2026 11:17:34 -0400 Subject: [PATCH] Enforce destination owner exists when create-on-send fee is present --- ocp/rpc/transaction/intent_handler.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ocp/rpc/transaction/intent_handler.go b/ocp/rpc/transaction/intent_handler.go index b4867a7..a454bd6 100644 --- a/ocp/rpc/transaction/intent_handler.go +++ b/ocp/rpc/transaction/intent_handler.go @@ -777,6 +777,12 @@ func (h *SendPublicPaymentIntentHandler) validateActions( return NewIntentValidationError("payments to external destinations must be withdrawals") } + // A fee payment funds creation of the destination ATA, so the destination + // owner must be provided to validate the ATA derivation. + if simResult.HasAnyFeePayments() && metadata.DestinationOwner == nil { + return NewIntentValidationErrorf("destination owner account is required when paying %s fee", transactionpb.FeePaymentAction_CREATE_ON_SEND_WITHDRAWAL.String()) + } + // Ensure the destination is the intent mint ATA for the client-provided owner, // if provided. We'll check later if this is absolutely required. var isDestinationOwnerVmSwapPda bool