fix(tron): handle native TRX deposit value and balance#1044
Merged
Conversation
Native TRX (the zero-address sentinel) was mishandled as a TRC-20 token on both the write and read paths: - relay-tron-wallet-adapter: the triggersmartcontract body omitted call_value, so a native depositNative call executed with 0 TRX attached (deposit mined SUCCESS but the swap never funded, fill failed). Forward parameter.call_value as the tx value. - sdk: add call_value to the Tron TransactionStepItem parameter type. - useTronBalance: the native sentinel was hardcoded to a wrong address, so native TRX fell through to a balanceOf contract call (which fails with "Smart contract is not exist" since the sentinel is not a contract). Use the correct native sentinel and guard an empty result.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
Claude finished @cozy-hn's task in 52s —— View job Code Review — PR #1044
Code Review -- No issues found. Reviewed 4 files, 30 lines changed. Checked for correctness, security, error handling, and repo guidelines compliance. A few notes confirming the changes hold up (not issues):
|
Contributor
Contributor
|
Claude finished @cozy-hn's task in 50s —— View job Code Review — PR #1044
Code Review -- No issues found. Reviewed 4 files, 30 lines changed. Checked for correctness, security, error handling, and repo guidelines compliance. Notes confirming the changes hold up (not issues):
|
Contributor
pedromcunha
approved these changes
Jun 26, 2026
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
Native TRX (zero-address sentinel) was treated like a TRC-20 token on both the write and read paths.
Write path (
relay-tron-wallet-adapter): thetriggersmartcontractbody omittedcall_value, sodepositNativeran with 0 TRX attached — deposit minedSUCCESSbut the swap was never funded. Now forwardsparameter.call_value.SDK types: added
call_value?: numberto the TronTransactionStepItemparameter.Read path (
useTronBalance):T9yD14Nj9j7xAB4dbGeiX9h8unkKHxuWwb(decodes to the zero address). The old value pointed at a real contract, so native TRX wrongly fell through to abalanceOfcall.getaccountresponse (it was readingdata.result.balance, which is always empty → 0).triggerconstantcontractfailures instead of silently returning a 0 balance.Verified the sentinel against the prod currency row +
/chainsAPI, andcall_valueagainst the solver backend source.