Conversation
Signed-off-by: Marin Petrunic <marin.petrunic@gmail.com>
Some tests will keep failing until feat/polygon-pos-bridge is merged
Scripts update WIP
| amountLD: amount, | ||
| minAmountLD: minAmountLD, | ||
| extraOptions: new bytes(0), | ||
| composeMsg: new bytes(0), |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
this should go to its separate issue
There was a problem hiding this comment.
🔵 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
thisAddressesconfiguration forRepayer/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. PrefersameAddress()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. UsingsameAddress()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.
Closes: #309