Skip to content

Conversation

@rodrigopavezi
Copy link
Member

@rodrigopavezi rodrigopavezi commented Feb 10, 2026

Summary by CodeRabbit

  • New Features
    • Added support for USDT (Tether USD) and USDC (USD Coin) on the Tron network.
  • Schema / Types
    • Introduced Tron network and TRC20 token type to token definitions.
  • Bug Fixes / Validation
    • Added Tron-specific address validation to ensure Tron addresses are correctly recognized.

@coderabbitai
Copy link

coderabbitai bot commented Feb 10, 2026

Walkthrough

Version bump from 4 to 5 and addition of two TRC20 Tron tokens (USDT-tron, USDC-tron); schema, types, and validation updated to recognize the Tron network and TRC20 token type.

Changes

Cohort / File(s) Summary
Token List Configuration
tokens/token-list.json
Version increment to 5 and append two TRC20 tokens on the Tron network: USDT-tron (Tether USD) and USDC-tron (USD Coin), decimals 6, chainId 728126428.
JSON Schema
src/schemas/token-list-schema.json
Added "tron" to network enum and "TRC20" to token type enum values.
Type Definitions
src/types/index.ts
Added TRC20 to TokenType enum, TRON = "tron" to NetworkType enum, and tron: 728126428 to CHAIN_IDS.
Validation Logic
src/validation/validate.ts
Introduced TRON-specific address validation branch (Base58-style regex) for tokens with network === "tron", preserving existing validation for other networks.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately summarizes the main change: adding USDT and USDC tokens for the TRON network, which is the primary focus of all modifications across the codebase.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/usdt-usdc-tron-support

No actionable comments were generated in the recent 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.

@greptile-apps
Copy link

greptile-apps bot commented Feb 10, 2026

Greptile Overview

Greptile Summary

This PR appends two TRON stablecoin entries (USDT and USDC) to tokens/token-list.json.

However, the repository’s current token-list schema and CI validation logic appear to only support EVM-style networks/tokens (plus ISO4217 fiat). The new tokens introduce network: "tron", type: "TRC20", TRON base58 addresses, and a TRON chainId that are not recognized by src/schemas/token-list-schema.json, src/types/index.ts, or src/validation/validate.ts, so the PR should fail validation checks until TRON/TRC20 is formally added to the supported schema/types/validation rules.

Confidence Score: 2/5

  • Not safe to merge as-is because CI validation should fail on the newly added TRON tokens.
  • The added tokens use network: tron / type: TRC20 and TRON base58 addresses, but the JSON schema and validation/types logic only recognize specific EVM networks and token types and validate addresses with ethers.isAddress(). This makes the failure deterministic unless the schema/types/validator are updated in the same PR.
  • tokens/token-list.json (and the TRON support additions that would be required in src/schemas/token-list-schema.json, src/types/index.ts, and src/validation/validate.ts if TRON is intended)

Important Files Changed

Filename Overview
tokens/token-list.json Adds USDT/USDC entries for TRON, but current schema/types/validation only support EVM + ISO4217; new tokens use network="tron", type="TRC20", TRON base58 addresses, and an unknown chainId, so CI validation will fail.

Sequence Diagram

sequenceDiagram
  participant Dev as Contributor
  participant TokenList as tokens/token-list.json
  participant CI as GitHub Actions (pr.yml)
  participant Validator as src/validation/validate.ts
  participant Schema as src/schemas/token-list-schema.json
  participant Types as src/types/index.ts

  Dev->>TokenList: Add USDT-tron + USDC-tron entries
  CI->>Validator: Run npm run validate
  Validator->>Schema: AJV compile + validate(tokenList)
  Schema-->>Validator: Reject (network/type enums)
  Validator-->>CI: Exit 1 (schema errors)
  CI-->>Dev: Checks fail

  note over Validator,Types: Even if schema updated,
  Validator->>Types: isValidNetwork / isValidTokenType / CHAIN_IDS lookup
  Types-->>Validator: No tron/TRC20/chainId mapping
  Validator->>Validator: ethers.isAddress(TRON base58)
  Validator-->>CI: Exit 1 (token validation)
Loading

Copy link

@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.

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment on lines +8173 to +8176
"id": "USDT-tron",
"name": "Tether USD",
"symbol": "USDT",
"decimals": 6,
Copy link

Choose a reason for hiding this comment

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

Fails existing validation

These new entries won’t pass the repo’s current validation rules: network: "tron" and type: "TRC20" are not in the allowed enums in src/schemas/token-list-schema.json (and also not in NetworkType/TokenType in src/types/index.ts). Additionally, TRON base58 addresses like TR7NH.../TEkx... will fail ethers.isAddress() in src/validation/validate.ts, and chainId: 728126428 won’t match any CHAIN_IDS mapping. As-is, CI validation should fail until TRON/TRC20 support is added to the schema/types/validator (or the entries are adapted to the currently supported networks/types).

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.

1 participant