Skip to content

fix(abstract-substrate): skip recipient validation for token enablement txns#9288

Merged
nvrakesh06 merged 1 commit into
masterfrom
nvrakeshreddy/cecho-1471-fix-token-enablement-verify
Jul 18, 2026
Merged

fix(abstract-substrate): skip recipient validation for token enablement txns#9288
nvrakesh06 merged 1 commit into
masterfrom
nvrakeshreddy/cecho-1471-fix-token-enablement-verify

Conversation

@nvrakesh06

Copy link
Copy Markdown
Contributor

Summary

  • verifyTransaction in abstract-substrate reads txBuilder['_to'] to validate the recipient address against txParams.recipients. This works for transfer transactions (TransferBuilder sets _to), but PreApproveAssetBuilder / V8PreApproveAssetBuilder (used for token enablement / preApproveAsset) only has _assetId — so _to is undefined.
  • Since buildTokenEnablements populates buildParams.recipients for TSS wallets, the recipient check fires and throws TxIntentMismatchRecipientError comparing the wallet's root address against undefined.
  • Guard the recipients block on txTo !== undefined so non-transfer transaction types are correctly skipped.

Root trigger: The v8 transfer routing fix (CECHO-1471, 36d878be05) made factory.from(txHex) correctly route v8-encoded preApproveAsset txns to V8PreApproveAssetBuilder, which surfaced this missing guard. Without the routing fix, v8 token enablement txns would fail at decode rather than reaching this check.

Test plan

  • New unit tests added in sdk-coin-polyx/test/unit/polyx.ts under verifyTransaction > token enablement (preApproveAsset) transaction
  • All existing verifyTransaction tests continue to pass (11 passing)
  • Manually reproduced on staging wallet 6a5b5835b08b0b019fe89a7313b3cbaa — token enablement for tpolyx:nvbitgot was failing with TxIntentMismatchRecipientError before this fix

CECHO-1471

🤖 Generated with Claude Code

@linear-code

linear-code Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

CECHO-1471

@nvrakesh06
nvrakesh06 force-pushed the nvrakeshreddy/cecho-1471-fix-token-enablement-verify branch from f42cd51 to 8f4b765 Compare July 18, 2026 11:45
…nt txns

verifyTransaction reads _to from the decoded builder to verify the
recipient address. TransferBuilder sets _to, but PreApproveAssetBuilder
(used for enabletoken / preApproveAsset) only has _assetId — so _to is
undefined, causing a spurious TxIntentMismatchRecipientError against the
wallet's own root address.

Guard the recipients check on txTo !== undefined so non-transfer
transaction types (token enablement) are not falsely rejected.

CECHO-1471
@nvrakesh06
nvrakesh06 force-pushed the nvrakeshreddy/cecho-1471-fix-token-enablement-verify branch from 8f4b765 to afe68aa Compare July 18, 2026 11:48

@nayandas190 nayandas190 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@nvrakesh06
nvrakesh06 marked this pull request as ready for review July 18, 2026 12:26
@nvrakesh06
nvrakesh06 requested a review from a team as a code owner July 18, 2026 12:26
@nvrakesh06
nvrakesh06 merged commit 32fd092 into master Jul 18, 2026
25 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.

2 participants