AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Moderate 64 Monero

feat: add walletconnect support for tron wallets (#3598)

Public commit record

What the developer wrote

Authored by David Adegoke

93/100 · Strong
feat: add walletconnect support for tron wallets (#3598)

* feat: add walletconnect support for tron wallets

* feat: enhance Tron transaction summary for WC and localization updates

* feat: make approval sheet more readable, update permission refusal and add fail soft for history

* feat: add dapp transctions to history and fix other minor issues pending

* fix(tron): keep the network fee when a TRC20 row replaces a TRX row

The TRC20 history loop now replaces a saved TRX row for the same hash (e.g. a
dApp swap), but TronTRC20TransactionModel.fee is always 0, never null, so the
saved?.fee fallback never ran and the real fee was overwritten with 0 TRX.
Prefer the saved row's fee.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(walletconnect): only sign requests on chains the open wallet has keys for

Every EVM, Solana and Tron request handler is registered on every wallet, and a
dApp can get a chain approved with no account on it (a required namespace keyed
by the chain id, e.g. "eip155:1"). The handlers only checked that the session
holds the open wallet's address, so such a request was signed with the open
wallet's key, e.g. EVM personal_sign / typed data with a Tron wallet's key, or
tron_signMessage with an EVM or Solana wallet's key.

Refuse a request unless the open wallet's key covers the handler's chain. Every
chain a wallet registers accounts for is in its key, so normal requests are
unaffected; Solana devnet/testnet requests (only reachable through such an
account-less namespace) are now refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Omar <omarh.ismail1@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit adds WalletConnect support for Tron wallets to Cake Wallet. It also fixes two security issues: one where a dApp could trick the app into signing messages or transactions with the wrong wallet's private key (for example, using a Tron wallet's key to sign an Ethereum request), and another where Tron transaction fees could be incorrectly displayed or overwritten. The commit is mostly a feature addition, but the included fixes address real authorization weaknesses in the WalletConnect integration.

Recommended action

Review the new TronChainService for consistent authorization checks, ensure the chain coverage check is applied to all future chain handlers, and verify that the TRC20 history filtering does not drop legitimate transactions users expect to see. Consider adding tests for the cross-chain signing refusal behavior.

Security signals we found

01

Cross-chain key misuse prevented by checking keys.first.chains.contains(getChainId()) in EVM, Solana, and Tron handlers

02

WalletConnect request handlers registered globally could previously sign for chains the open wallet does not cover

03

Tron transaction fee preservation fix when TRC20 row replaces TRX row

04

TRC20 history filtered to Transfer type to avoid overwriting TRX rows with non-transfer contract calls

05

New Tron signing surface added (tronSignMessage, tronSignTransaction) with contract-type allowlist

Risk score

Why this scored 64/100

Our methodology →
Potential impact 18/30
Exploitability 12/25
Stealth signal 10/15
Affected reach 12/15
Confidence 8/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.