Skip to content
This repository was archived by the owner on Mar 24, 2025. It is now read-only.

Conversation

@tifrel
Copy link
Member

@tifrel tifrel commented Oct 17, 2024

PR Type

enhancement


Description

  • Renamed existing stablecoin address enums to USDCe_ADDRESS and USDTe_ADDRESS.
  • Introduced new USDC_ADDRESS and USDT_ADDRESS enums with specific mainnet and testnet addresses.
  • Ensured FungibleToken enum includes USDC and USDT.

Changes walkthrough 📝

Relevant files
Enhancement
types.ts
Add and rename stablecoin address enums                                   

packages/sdk/src/types.ts

  • Renamed USDC_ADDRESS to USDCe_ADDRESS and USDT_ADDRESS to
    USDTe_ADDRESS.
  • Added new USDC_ADDRESS and USDT_ADDRESS enums with mainnet and testnet
    addresses.
  • Updated FungibleToken enum to include USDC and USDT.
  • +12/-2   

    💡 PR-Agent usage:
    Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions

    @mintbase-codium-pr-agent
    Copy link

    PR Reviewer Guide 🔍

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Key issues to review

    Address Verification
    Ensure that the new addresses for USDC_ADDRESS and USDT_ADDRESS are correct and correspond to the intended networks. This is crucial as incorrect addresses could lead to misrouted transactions.

    @mintbase-codium-pr-agent
    Copy link

    PR Code Suggestions ✨

    CategorySuggestion                                                                                                                                    Score
    Possible issue
    Ensure consistent address formats across different environments

    Ensure that the address formats are consistent across all environments. The mainnet
    addresses for USDC_ADDRESS and USDT_ADDRESS are significantly different from those
    in USDCe_ADDRESS and USDTe_ADDRESS. This inconsistency could lead to confusion or
    errors in address handling. Consider standardizing the address format or verifying
    that the addresses are correct.

    packages/sdk/src/types.ts [100-107]

     export enum USDC_ADDRESS {
    -  mainnet = '17208628f84f5d6ad33f0da3bbbeb27ffcb398eac501a31bd6ad2011e36133a1',
    -  testnet = '3e2210e1184b45b64c8a434c0a7e7b23cc04ea7eb7a6c3c32520d03d4afcb8af',
    +  mainnet = 'a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48.factory.bridge.near',
    +  testnet = 'usdc.fakes.testnet',
     }
     export enum USDT_ADDRESS {
    -  mainnet = 'usdt.tether-token.near',
    +  mainnet = 'dac17f958d2ee523a2206206994597c13d831ec7.factory.bridge.near',
       testnet = 'usdt.fakes.testnet',
     }
     
    Suggestion importance[1-10]: 8

    Why: The suggestion addresses a potential issue with address format consistency, which is important for preventing errors in address handling. This is a significant concern, thus a higher score is warranted.

    8
    Maintainability
    Standardize the naming of stablecoin address enums for consistency

    Consider using consistent naming for the enums related to stablecoin addresses to
    avoid confusion and maintain consistency. The enums USDCe_ADDRESS and USDTe_ADDRESS
    use a suffix 'e', which is not used in USDC_ADDRESS and USDT_ADDRESS. It would be
    clearer to either include 'e' in all related enums or remove it where it's currently
    used.

    packages/sdk/src/types.ts [90-97]

    -export enum USDCe_ADDRESS {
    +export enum USDC_ADDRESS {
       mainnet = 'a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48.factory.bridge.near',
       testnet = 'usdc.fakes.testnet',
     }
    -export enum USDTe_ADDRESS {
    +export enum USDT_ADDRESS {
       mainnet = 'dac17f958d2ee523a2206206994597c13d831ec7.factory.bridge.near',
       testnet = 'usdt.fakes.testnet',
     }
     
    Suggestion importance[1-10]: 7

    Why: The suggestion to standardize enum naming is valid for maintainability and clarity, as inconsistent naming can lead to confusion. However, it is not critical to functionality, hence a moderate score.

    7

    @tifrel tifrel merged commit 35a8244 into beta Oct 17, 2024
    @tifrel tifrel deleted the unbridged-stablecoins branch October 17, 2024 11:12
    Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

    Labels

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    3 participants