Skip to content

Conversation

@rodrigopavezi
Copy link
Member

@rodrigopavezi rodrigopavezi commented Jan 26, 2026

Description of the changes

Added support for Tron blockchain and its Nile testnet:

  • Created new Tron chain configuration with USDT and USDC token definitions
  • Added Nile testnet configuration for Tron
  • Implemented TronChains class for handling Tron-specific chain operations
  • Updated type definitions to include Tron chains in the supported VM chains
  • Added Tron chains to the exports for use throughout the application

Closes RequestNetwork/private-issues#223
Closes RequestNetwork/private-issues#224

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 26, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 🔍 Trigger a full review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Member Author

rodrigopavezi commented Jan 26, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 26, 2026

Greptile Overview

Greptile Summary

Added comprehensive support for Tron blockchain to the currency package, enabling the system to handle Tron mainnet and Nile testnet chains.

  • Created TronChains class following the established pattern from EvmChains and NearChains, extending ChainsAbstract with Tron-specific chain operations
  • Defined Tron mainnet with USDT (TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t) and USDC (TEkxiTehnzSmSe2XqrBj4w32RUN966rdz8) TRC20 token addresses
  • Created Nile testnet configuration as a placeholder for test token definitions
  • Added TronChainName type definition and included Tron chains in VMChainName to indicate that payment proxy contracts can be deployed on Tron
  • Properly integrated both Tron chains into the declarative chains system and exported TronChains for use throughout the application
  • Fixed typo in comment ("Virtual machine" instead of "Virtual machin")

The implementation follows the existing architectural patterns and is consistent with how other blockchain networks are integrated into the system.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The implementation follows established patterns from existing chain integrations (EVM, NEAR), uses consistent type definitions, and adds new functionality without modifying existing code. All changes are purely additive and well-structured.
  • No files require special attention

Important Files Changed

Filename Overview
packages/currency/src/chains/declarative/data/tron.ts Added Tron mainnet configuration with USDT and USDC token definitions
packages/currency/src/chains/tron/TronChains.ts Created TronChains class extending ChainsAbstract for Tron chain operations
packages/types/src/currency-types.ts Added TronChainName type and included it in VMChainName, fixed typo in comment

Sequence Diagram

sequenceDiagram
    participant App as Application
    participant TronChains as TronChains
    participant ChainsAbstract as ChainsAbstract
    participant TronDef as Tron/Nile Definitions
    participant Types as Currency Types

    App->>Types: Import TronChainName type
    App->>TronChains: Import TronChains instance
    TronChains->>TronDef: Load chain definitions (tron, nile)
    TronChains->>ChainsAbstract: Initialize with chains & CURRENCY.ETH
    ChainsAbstract->>ChainsAbstract: Register chain names
    ChainsAbstract->>ChainsAbstract: Attempt to add native currencies
    Note over ChainsAbstract: No native TRX currencies defined,<br/>so none are added
    App->>TronChains: isChainSupported('tron')
    TronChains-->>App: true
    App->>TronChains: getChainId('tron')
    TronChains->>TronDef: Access tron.chainId
    TronDef-->>TronChains: 'tron'
    TronChains-->>App: 'tron'
    App->>TronChains: Access currencies for tron
    TronChains->>TronDef: Access tron.currencies
    TronDef-->>App: {USDT, USDC definitions}
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

No files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@rodrigopavezi rodrigopavezi changed the base branch from feat/tron-smart-contracts to graphite-base/1688 January 27, 2026 01:48
@rodrigopavezi rodrigopavezi changed the base branch from graphite-base/1688 to feat/tron-smart-contracts January 27, 2026 01:49
@rodrigopavezi rodrigopavezi force-pushed the feat/tron-currency branch 13 times, most recently from 62d10a1 to 2496888 Compare January 27, 2026 09:29
- Add Tron mainnet and Nile testnet chain configurations
- Add TronChains types and exports
- Update currency-types with Tron chain support
MantisClone

This comment was marked as duplicate.

Copy link
Member

@MantisClone MantisClone left a comment

Choose a reason for hiding this comment

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

Looks good to me so far.

Reviewed with Claude Code Opus 4.5

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.

3 participants