Repository navigation
fix(sdk-coin-trx): validate TRC20 transfers on native Trx TSS path - #9800
Draft
ralph-bitgo[bot] wants to merge 1 commit into
Draft
ralph-bitgo[bot] wants to merge 1 commit into
ralph-bitgo[bot] wants to merge 1 commit into
Conversation
Token wallets are sometimes constructed with the native coin instance, so TriggerSmartContract prebuilds were rejected by Trx.verifyTransaction and briefly shown as errors in the UI even when the withdrawal later confirmed. Validate TRC20 transfers on native Trx instead of throwing: require the transfer selector a9059cbb, bind the contract to the intended token (tokenName/tokenAddress or TrxToken config), and compare recipient and amount. Fail closed on approve(), wrong token, or missing token identity. Ticket: CECHO-2248 Session-Id: 40ede34c-a7a5-431f-b293-e97a24c2c391 Task-Id: 6294f511-db62-4b82-b0fd-84fb618f7d64
ralph-bitgo
Bot
force-pushed
the
cecho-2248-prevent-transient-trx-verification-errors
branch
from
September 23, 2026 10:34
4a10ff0 to
59c2158
Compare
Contributor
Contributor
|
|
This branch has not been deployed
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.
What
TrxToken.verifyTransactioninto a sharedTrx.validateTriggerSmartContract.Trx.verifyTransactionnow validatesTriggerSmartContractprebuilds on the TSS path instead of throwing "verification is not supported by native TRX".a9059cbb(transfer), the decodedcontract_addressmatches the intended token (tokenName/tokenAddressorTrxTokenconfig), and recipient/amount match.approve(), a different token contract, or missing token identity still reject.TrxToken.verifyTransactiondelegates to the same validator (no behavior change for correctly routed token wallets).Why
Customers briefly saw a non-blocking error during TRC20 withdrawals (including API-initiated ones) even though the withdrawal later confirmed. Token wallets are sometimes constructed with the native TRX coin instance, so a valid TRC20 transfer hit the CHALO-448 fail-closed throw on
Trx.verifyTransaction. Validating the transfer on that path removes the transient UI error without weakening the guard.Test plan
@bitgo/sdk-coin-trxunit tests: nativeTrxTriggerSmartContract cases (valid transfer, amount mismatch, destination mismatch, missing token identity, wrong contract, approve selector) and existingTrxTokenTSS cases.Ticket: CECHO-2248