Skip to content

Add Tron support - #310

Merged
mpetrun5 merged 27 commits into
mainfrom
feat/tron
Sep 8, 2026
Merged

mpetrun5 merged 27 commits into
mainfrom
feat/tron

Conversation

@lastperson

Copy link
Copy Markdown
Collaborator

Closes: #309

@lastperson lastperson self-assigned this Aug 18, 2026
@lastperson lastperson changed the title [WIP] Add Tron support Add Tron support Aug 21, 2026
@lastperson
lastperson marked this pull request as ready for review August 21, 2026 18:06
amountLD: amount,
minAmountLD: minAmountLD,
extraOptions: new bytes(0),
composeMsg: new bytes(0),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think we're missing the whole mesh implementation needed for bridging Tron<->other chains. So data needs to be set for composeMsg and extraOptions I think.

https://docs.layerzero.network/v2/developers/evm/lzasset/overview

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this should go to its separate issue

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

It changes core cross-chain domain identifiers and deployment/runtime assumptions, requiring careful backward-compatibility validation and fixes before it’s safe to merge.

Pull request overview

This PR introduces Tron as a supported network and updates the cross-chain Repayer/Rebalancer architecture to no longer require identical deployment addresses across domains by configuring per-domain “this addresses”.

Changes:

  • Add Tron network/tooling support (Hardhat Tron integration, deploy scripts, configs, CI compile flow, docs).
  • Introduce and wire thisAddresses configuration for Repayer/Rebalancer, updating adapters and extensive tests accordingly.
  • Extend domain/provider handling (e.g., new LayerZero endpoint ID mapping for Tron, USDT0 receiver now bytes32).
File summaries
File Description
tron.node.sh Local Tron TRE runner script
test/USDTAsset.ts Update tests for thisAddresses/USDT0 args
test/Repayer.ts Add thisAddresses tests + init changes
test/Rebalancer.ts Add thisAddresses tests + init changes
test/helpers.ts Add allRemoteDomains + multichain resolver
specific-fork-test/unichain/RepayerUSDT0.ts Update fork test init args
specific-fork-test/polygon/RepayerUSDT0.ts Update fork test init args
specific-fork-test/polygon/RepayerPolygonPos.ts Update fork test + setThisAddresses
specific-fork-test/gnosis/RepayerGnosisOmnibridge.ts Update fork test init args
specific-fork-test/gnosis/RebalancerGnosisOmnibridge.ts Update fork test init args
specific-fork-test/ethereum/RepayerUSDT0.ts Update fork test init args
specific-fork-test/ethereum/RepayerGnosisOmnibridge.ts Update destination address handling
specific-fork-test/ethereum/Repayer.ts Update fork test init args
specific-fork-test/arbitrum/RepayerUSDT0.ts Update fork test init args
specific-fork-test/arbitrum/RebalancerUSDT0.ts Update fork test receiver handling
scripts/helpers.ts Add destination “this address” builders
scripts/helpers.tron.ts Add Tron deploy/upgrade + resource tracking
scripts/deployStandaloneRepayer.ts Pass destination “this addresses” at init
scripts/deployRepayer.ts Pass destination “this addresses” at init
scripts/deployPaxosOracle.ts Improve USDC address validation/logging
scripts/deploy.ts Pass destination “this addresses”; better logging
scripts/common.ts Add TRON domain + helper sameIgnoreCase
README.md Add Tron setup/run instructions
package.json Add Tron compile/deploy scripts + deps
network.config/types.ts Add TRON, Repayer?, Rebalancer? fields
network.config/stage.ts Add stage TRON config + Repayer/Rebalancer fields
network.config/repayer.ts Add standalone repayer addresses
network.config/prod.ts Add prod TRON + expand ROBINHOOD routes
network.config/ids.ts Add Rebalancer proxy IDs
hardhat.config.ts Add Tron plugins/network + new tasks
deployments/TRON/CensoredTransferFromMulticall.json Add Tron deployment artifact
deployments/TRON/.chainId Add Tron chainId marker
deployments/deployments.staging.yml Add Tron stage deployment entries
deployments/deploy-tron-stage.log Add Tron stage deployment log
deploy/04_update.thisaddresses.rebalancer.tron.ts Tron deploy script: update rebalancer thisAddresses
deploy/03_update.thisaddresses.repayer.tron.ts Tron deploy script: update repayer thisAddresses
deploy/02_upgrade.rebalancer.tron.ts Tron deploy script: upgrade rebalancer
deploy/01_upgrade.repayer.tron.ts Tron deploy script: upgrade repayer
deploy/00_deploy.tron.ts Tron deploy script: full deploy flow
coverage-baseline.json Update baseline coverage value
contracts/utils/USDT0Adapter.sol USDT0 receiver now bytes32
contracts/utils/LayerZeroHelper.sol Add TRON endpoint ID
contracts/utils/GnosisOmnibridgeAdapter.sol Use destination “this address”; helper balance
contracts/utils/CCTPV2Adapter.sol Use destinationCaller = destination “this address”
contracts/utils/AdapterHelper.sol Add _bytes32ToAddress + validation
contracts/testing/RepayerUSDT0Tempo.sol Update init args (thisAddresses)
contracts/testing/RepayerUSDT0Stable.sol Update init args (thisAddresses)
contracts/testing/RebalancerUSDT0Tempo.sol Update init args (thisAddresses)
contracts/testing/RebalancerUSDT0Stable.sol Update init args (thisAddresses)
contracts/Repayer.sol Add thisAddress mapping + config + routing logic
contracts/Rebalancer.sol Add thisAddress mapping + config + routing logic
contracts/interfaces/IRoute.sol Add TRON to Domain enum
.gitignore Ignore tron/local deployment artifacts
.github/workflows/test.yml Compile both tron+non-tron in CI
.env.example Add TRON_RPC example
Review details

Suppressed comments (2)

deploy/00_deploy.tron.ts:392

  • More address comparisons use strict string equality (===) for addresses returned from contracts vs config values. This is brittle due to checksum casing and can cause false failures. Prefer sameAddress() for address equality checks.
  assert(await rebalancerAdmin!.owner() === config.Admin, "Rebalancer admin owner mismatch");
  assert(await rebalancer!.DOMAIN() === DomainSolidity[network], "Rebalancer domain mismatch");
  assert(await rebalancer!.ASSETS() === mainAssetInfo.Address, "Rebalancer assets mismatch");
  assert(await rebalancer!.hasRole(DEFAULT_ADMIN_ROLE, config.Admin), "Rebalancer default admin role mismatch");

deploy/00_deploy.tron.ts:401

  • These assertions compare contract addresses using ===, and one error message refers to Rebalancer even though it checks Repayer. Using sameAddress() avoids checksum-casing false negatives and clarifies failures.
  assert(await rebalancer!.USDT0_OFT() === config.USDT0OFT, "Rebalancer USDT0 OFT mismatch");
  assert(await repayerAdmin!.owner() === config.Admin, "Repayer admin owner mismatch");
  assert(await repayer!.DOMAIN() === DomainSolidity[network], "Repayer domain mismatch");
  assert(await repayer!.USDT0_OFT() === config.USDT0OFT, "Rebalancer USDT0 OFT mismatch");
  • Files reviewed: 62/72 changed files
  • Comments generated: 4
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread contracts/interfaces/IRoute.sol Outdated
Comment thread scripts/common.ts
Comment thread deploy/00_deploy.tron.ts
Comment thread tron.node.sh
mpetrunic
mpetrunic previously approved these changes Sep 8, 2026
MakMuftic
MakMuftic previously approved these changes Sep 8, 2026
@mpetrun5
mpetrun5 merged commit 14e69df into main Sep 8, 2026
4 of 6 checks passed
@mpetrun5
mpetrun5 deleted the feat/tron branch September 8, 2026 11:45
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.

Deploy Tron Stage

6 participants