Skip to content

feat: tron + layerzero prover support#111

Merged
nknavkal merged 6 commits into
mainfrom
feat/tron
May 21, 2026
Merged

feat: tron + layerzero prover support#111
nknavkal merged 6 commits into
mainfrom
feat/tron

Conversation

@nknavkal

@nknavkal nknavkal commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

No description provided.

- Add tronShasta testnet chain definition with LayerZeroEndpointV2
- Add USDT stable to tron mainnet
- Add layerZeroEndpointV2 to ethereum, optimism, polygon, base, arbitrum

🤖 Generated with [Claude Code](https://claude.ai/code)
@aromanoEco

Copy link
Copy Markdown
Contributor

🔍 Claude Code Test Coverage Analysis

Spec Analysis: Tron + LayerZero Prover Support

Verdict

APPROVE WITH SUGGESTIONS

All core requirements have implementation coverage, but lack test coverage for configuration validation and integration verification.


Action Items

Tests that MUST be added before this PR can safely merge.

P0 — Required Before Merge

No P0 items. The changes are purely additive configuration without financial logic.

P1 — Recommended

Requirement Missing Test Why Recommended
Tron chain configuration is correctly exported Unit test verifying tron export structure Prevents configuration errors in consuming code
TronShasta testnet configuration is correctly exported Unit test verifying tronShasta export structure Prevents testnet integration failures
LayerZero EndpointV2 addresses are valid Integration test validating contract addresses Catches misconfigured addresses before production
USDT stable token configuration on Tron Unit test verifying USDT address and decimals Prevents token interaction errors
Chain registry includes new Tron chains Test verifying EcoRoutesChains array includes both chains Ensures chains are discoverable by routing logic

Details:

P1-1: Tron chain configuration validation

Requirement: "Tron mainnet must be correctly configured with LayerZero EndpointV2 and USDT stable token"

GIVEN: The tron chain configuration from definitions
WHEN: Accessing chain properties
THEN: 
  - chainId matches viem's tron.id
  - layerZeroEndpointV2.address is '0x0Af59750D5dB5460E5d89E268C474d5F7407c061'
  - USDT.address is '0xa614f803B6FD780986A42c78Ec9c7f77e6DeD13C'
  - USDT.decimals is 6
  - isCalderaChain is false

Risk if missing: Configuration errors could cause routing failures or incorrect token handling

P1-2: TronShasta testnet configuration validation

Requirement: "Tron Shasta testnet must be correctly configured with LayerZero EndpointV2"

GIVEN: The tronShasta chain configuration from definitions
WHEN: Accessing chain properties
THEN:
  - chainId matches viem's tronShasta.id
  - layerZeroEndpointV2.address is '0x1b356f3030CE0c1eF9D3e1E250Bf0BB11D81b2d1'
  - isCalderaChain is false

Risk if missing: Testnet integration could fail with misconfigured addresses

P1-3: Chain registry inclusion

Requirement: "Both Tron chains must be included in the EcoRoutesChains array for routing discovery"

GIVEN: The EcoRoutesChains array from index.ts
WHEN: Filtering for Tron chains
THEN:
  - Array includes a chain with tron's chainId
  - Array includes a chain with tronShasta's chainId
  - Both chains have layerZeroEndpointV2 contracts defined

Risk if missing: Chains won't be available for cross-chain routing operations

P1-4: LayerZero EndpointV2 consistency across chains

Requirement: "All EVM chains should have LayerZero EndpointV2 configured where applicable"

GIVEN: Chain configurations for arbitrum, base, ethereum, optimism, polygon
WHEN: Checking layerZeroEndpointV2 contract addresses
THEN:
  - All mainnet EVM chains have address '0x1a44076050125825900e736c501f859c50fE728c'
  - Tron mainnet has address '0x0Af59750D5dB5460E5d89E268C474d5F7407c061'
  - No undefined or null addresses

Risk if missing: Incorrect LayerZero endpoint could break cross-chain messaging


Coverage Status

Requirement Status Notes
Add Tron chain definition Implemented src/definitions/tron.ts
Add TronShasta testnet definition Implemented src/definitions/tron.ts
Export Tron chains from definitions Implemented src/definitions/index.ts
Include Tron chains in EcoRoutesChains Implemented src/index.ts
Configure LayerZero EndpointV2 on Tron Implemented Contract address added
Configure LayerZero EndpointV2 on existing chains Implemented Added to 5 chains
Configure USDT stable on Tron Implemented Address and decimals defined
Unit tests for chain configurations Gap P1 — recommended
Integration tests for LayerZero addresses Gap P1 — recommended
Registry inclusion tests Gap P1 — recommended

Context (Informational)

Spec Summary
  • What's being implemented: Addition of Tron blockchain support and LayerZero V2 endpoint configuration across multiple chains
  • Key requirements:
    • Add Tron mainnet and Shasta testnet chain definitions
    • Configure LayerZero EndpointV2 addresses for cross-chain messaging
    • Add USDT stable token configuration for Tron
    • Export chains through the registry for routing discovery
  • Risk Level: LOW — Pure configuration changes without financial logic; addresses are read-only metadata
Files Changed
  • src/definitions/tron.ts — New chain definitions for Tron mainnet and testnet
  • src/definitions/arbitrum.ts — Added LayerZero EndpointV2 address
  • src/definitions/base.ts — Added LayerZero EndpointV2 address
  • src/definitions/ethereum.ts — Added LayerZero EndpointV2 address
  • src/definitions/optimism.ts — Added LayerZero EndpointV2 address
  • src/definitions/polygon.ts — Added LayerZero EndpointV2 address
  • src/definitions/index.ts — Export Tron chain definitions
  • src/index.ts — Add Tron chains to EcoRoutesChains array
Implementation Notes

Testing Recommendations:

  1. Chain Configuration Tests — Verify each chain object has required properties:

    • Mock viem chain imports or use actual exports
    • Assert contract addresses are properly formatted
    • Verify stable token configurations
  2. Integration Tests — If contract address validation is feasible:

    • Test that LayerZero endpoints are reachable (optional, may require network access)
    • Verify USDT contract exists at specified Tron address (optional)
  3. Registry Tests — Verify chain discovery:

    • Assert all exported chains are in EcoRoutesChains
    • Filter chains by property (e.g., has layerZeroEndpointV2) and verify expected count
    • Test that chain IDs are unique

Mock Requirements:

  • No complex mocking needed for configuration tests
  • Use actual viem chain objects if available in test environment

Special Considerations:

  • Tron uses different address format (base58 in documentation, but code shows hex)
  • LayerZero V2 endpoint addresses are critical for cross-chain messaging
  • No financial operations in this PR, only configuration metadata

Generated by QA Command Center • View Service

@aromanoEco aromanoEco added qa:test-plan-reviewed Test coverage analyzed and test cases specified in PR comments qa:needs-test-implementation Test cases specified but not yet implemented - ready for developer labels Apr 10, 2026
aromanoEco
aromanoEco previously approved these changes Apr 10, 2026
- Add portal and layerZeroProver to base and tron mainnet
- Add layerZeroProver to ethereum, optimism, arbitrum, and polygon

🤖 Generated with [Claude Code](https://claude.ai/code)

@dirkpage dirkpage left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good overall, the thing that we need to make sure of with tron (the first non-EVM chain added here) is that it's clearly typed or marked as a non-EVM chain and ideally doesn't break existing functions for users who are not expecting a non-EVM chain to be in the list without asking for it.

Comment thread src/definitions/base.ts Outdated
Comment thread src/definitions/tron.ts
nknavkal and others added 3 commits April 23, 2026 17:35
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add toTronBase58/fromTronBase58 utilities (bs58check v4)
- Add getEvmChains, getEvmMainnetChains, getEvmTestnetChains
- Add getTronChains, getTronMainnetChain, getTronTestnetChain
- Annotate tron contract/stable addresses with base58 equivalents

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Comment thread src/definitions/tron.ts
@linear-code

linear-code Bot commented May 21, 2026

Copy link
Copy Markdown

ECO-793

@nknavkal nknavkal requested a review from dirkpage May 21, 2026 13:57
@nknavkal nknavkal merged commit 7c5f052 into main May 21, 2026
2 checks passed
@nknavkal nknavkal deleted the feat/tron branch May 21, 2026 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

orange-tron qa:needs-test-implementation Test cases specified but not yet implemented - ready for developer qa:test-plan-reviewed Test coverage analyzed and test cases specified in PR comments

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants