Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: evm create null to #1243

Merged
merged 7 commits into from
Feb 21, 2025
Merged

fix: evm create null to #1243

merged 7 commits into from
Feb 21, 2025

Conversation

songwongtp
Copy link
Collaborator

@songwongtp songwongtp commented Feb 21, 2025

Summary by CodeRabbit

  • Bug Fixes

    • Updated CHANGELOG to document a fix related to EVM Create checks.
  • New Features

    • Enhanced transaction detail views to now display additional destination information for clarity.
    • Improved ERC20 transfer displays with refined token amount formatting and clear indication of contract creation.
  • Refactor

    • Streamlined transaction data processing and caching, resulting in a more reliable and consistent user experience.
    • Introduced new methods for extracting and processing ERC20 transfer input data, enhancing code clarity and functionality.

Copy link

vercel bot commented Feb 21, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
celatone-frontend-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 21, 2025 6:25am
6 Skipped Deployments
Name Status Preview Comments Updated (UTC)
celatone-frontend-main ⬜️ Ignored (Inspect) Visit Preview Feb 21, 2025 6:25am
initia-celatone-frontend ⬜️ Ignored (Inspect) Visit Preview Feb 21, 2025 6:25am
neutron-celatone-frontend ⬜️ Ignored (Inspect) Visit Preview Feb 21, 2025 6:25am
osmosis-celatone-frontend ⬜️ Ignored (Inspect) Visit Preview Feb 21, 2025 6:25am
sei-celatone-frontend ⬜️ Ignored (Inspect) Visit Preview Feb 21, 2025 6:25am
terra-celatone-frontend ⬜️ Ignored (Inspect) Visit Preview Feb 21, 2025 6:25am

Copy link

coderabbitai bot commented Feb 21, 2025

Walkthrough

This pull request updates multiple EVM transaction components and utilities. A new bug fix entry is added to the changelog for an EVM Create null check issue (PR #1243). Several components now pass an additional property txTo (alongside the existing txInput) to functions that determine the EVM method, prompting updates in interfaces and function signatures (notably in EvmMethodChip, EvmInputData, and related components). Additionally, the rendering logic of conditional components, query caching options, and ERC20 transfer data extraction are refactored, while a new type (EvmToAddress) is introduced in the types file.

Changes

Files Change Summary
CHANGELOG.md Added a new bug fix entry for EVM Create, documenting a null value check fix (PR #1243).
src/lib/components/EvmMethodChip.tsx,
src/lib/components/table/evm-transactions/EvmTransactionsTableMobileCard.tsx,
src/lib/components/table/evm-transactions/EvmTransactionsTableRow.tsx,
src/lib/pages/evm-tx-details/components/evm-tx-method/EvmTxTransfer.tsx,
src/lib/pages/tx-details/components/evm-related-tx-section/index.tsx
Updated the EvmMethodChip component to include a new txTo property and adjusted its invocation, passing both txInput and txTo from parent components.
src/lib/components/EvmToCell.tsx Modified conditional rendering logic and updated the ExplorerLink types, ensuring consistent checks for toAddress and proper handling when toAddress is falsy.
src/lib/pages/evm-tx-details/components/EvmInputData.tsx,
src/lib/pages/evm-tx-details/components/EvmTxMsgDetails.tsx,
src/lib/pages/evm-tx-details/components/EvmTxMsgDetailsBody.tsx
Renamed inputData to txInput, added a new txTo property in the interface, and updated function calls to pass both parameters to getEvmMethod.
src/lib/pages/evm-tx-details/components/evm-tx-method/EvmTxCreateContract.tsx Added a TODO comment (// TODO: fix contract addresses) to denote a pending task for handling contract addresses.
src/lib/pages/evm-tx-details/components/evm-tx-method/EvmTxTransferErc20.tsx Refactored the ERC20 transfer logic by consolidating input extraction into the new helper function extractErc20TransferInput, renaming amount to amountToken, and updating the ExplorerLink and EvmMethodChip usage accordingly.
src/lib/services/tx/index.ts,
src/lib/services/tx/jsonRpc.ts
Modified query options to include staleTime: Infinity for EVM/Cosmos transaction hash fetching and added a blank line in the JSON RPC service for improved readability.
src/lib/types/evm.ts,
src/lib/utils/evm.ts
Introduced a new type EvmToAddress and removed the Create enum value. Updated function signatures: getEvmMethod now accepts an additional txTo parameter and getEvmToAddress’s parameter type is refined. Also added the new helper extractErc20TransferInput for processing ERC20 transfers.

Sequence Diagram(s)

sequenceDiagram
    participant UI as Frontend Component
    participant Chip as EvmMethodChip
    participant Data as EvmInputData / TxMsgDetails
    participant Utils as Utility Functions (getEvmMethod, extractErc20TransferInput)

    UI->>Chip: Pass txInput, txTo
    Chip->>Utils: Call getEvmMethod(txInput, txTo)
    Utils-->>Chip: Return method details
    Chip->>UI: Render UI based on method

    UI->>Data: Provide txInput and txTo for transaction details
    Data->>Utils: Get EVM method and, if ERC20, extract transfer input
    Utils-->>Data: Return processed data for rendering
Loading

Suggested reviewers

  • evilpeach
  • Poafs1

Poem

I'm a little rabbit, coding on the run,
Hopping through changes, having lots of fun.
txInput and txTo now lead the way,
In every component, brightening the day.
Bugs vanish as I twirl in code light,
A bunny's cheer making everything right!
🐰✨

Warning

There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

src/lib/pages/evm-tx-details/data.ts

Oops! Something went wrong! :(

ESLint: 8.57.1

ESLint couldn't find the plugin "eslint-plugin-react".

(The package "eslint-plugin-react" was not found when loaded as a Node module from the directory "".)

It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:

npm install eslint-plugin-react@latest --save-dev

The plugin "eslint-plugin-react" was referenced from the config file in ".eslintrc.json".

If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.

src/lib/pages/tx-details/components/evm-related-tx-section/index.tsx

Oops! Something went wrong! :(

ESLint: 8.57.1

ESLint couldn't find the plugin "eslint-plugin-react".

(The package "eslint-plugin-react" was not found when loaded as a Node module from the directory "".)

It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:

npm install eslint-plugin-react@latest --save-dev

The plugin "eslint-plugin-react" was referenced from the config file in ".eslintrc.json".

If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.

src/lib/components/EvmToCell.tsx

Oops! Something went wrong! :(

ESLint: 8.57.1

ESLint couldn't find the plugin "eslint-plugin-react".

(The package "eslint-plugin-react" was not found when loaded as a Node module from the directory "".)

It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:

npm install eslint-plugin-react@latest --save-dev

The plugin "eslint-plugin-react" was referenced from the config file in ".eslintrc.json".

If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.

  • 5 others
✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (5)
src/lib/utils/evm.ts (1)

17-18: Consider handling creation transactions with txInput === "0x".
If txTo is null and txInput equals "0x", it may still represent a contract creation with no code. Clarify if that scenario should be handled or distinguished.

src/lib/components/EvmToCell.tsx (1)

20-61: Refactor duplicate code for created contract rendering.

The JSX structure for both Create and CallErc20Factory methods is identical. Consider extracting this into a reusable component.

+const CreatedContractCell = ({ address }: { address: string }) => (
+  <Flex direction="column">
+    <Text variant="body3" color="text.disabled">
+      Created Contract
+    </Text>
+    <Flex gap={1} align="center">
+      <CustomIcon
+        name="contract-address"
+        boxSize={3}
+        color="primary.main"
+      />
+      <ExplorerLink
+        value={address}
+        type="evm_contract_address"
+        showCopyOnHover
+      />
+    </Flex>
+  </Flex>
+);
+
 export const EvmToCell = ({ toAddress }: EvmToCellProps) => {
   if (!toAddress)
     return (
       <Text variant="body2" color="text.dark">
         -
       </Text>
     );

   if (toAddress.Method === EvmMethodName.Create ||
       toAddress.Method === EvmMethodName.CallErc20Factory)
-    return (
-      <Flex direction="column">
-        <Text variant="body3" color="text.disabled">
-          Created Contract
-        </Text>
-        <Flex gap={1} align="center">
-          <CustomIcon
-            name="contract-address"
-            boxSize={3}
-            color="primary.main"
-          />
-          <ExplorerLink
-            value={toAddress.address}
-            type="evm_contract_address"
-            showCopyOnHover
-          />
-        </Flex>
-      </Flex>
-    );
+    return <CreatedContractCell address={toAddress.address} />;
src/lib/pages/evm-tx-details/components/EvmInputData.tsx (1)

43-48: Remove redundant case clause.

The Raw case is redundant as it performs the same action as the default clause.

      case EvmDataFormatTabs.UTF8:
        return Buffer.from(txInput.slice(2), "hex").toString("binary");
-     case EvmDataFormatTabs.Raw:
      default:
        return txInput;
🧰 Tools
🪛 Biome (1.9.4)

[error] 45-45: Useless case clause.

because the default clause is present:

Unsafe fix: Remove the useless case.

(lint/complexity/noUselessSwitchCase)

src/lib/types/evm.ts (1)

22-35: Consider removing the redundant address property.

The TODO comment suggests that the address property should be removed. Since each variant of the union type includes this property, it appears to be redundant or no longer needed.

Additionally, consider adding JSDoc comments to document the purpose of each variant in the union type, especially to explain when each variant is used.

src/lib/services/tx/index.ts (1)

665-668: Simplify the enabled condition.

The enabled condition is redundant as it checks !!cosmosTxHash twice:

  1. Once in the enabled property.
  2. Again in the query function where it throws an error if !cosmosTxHash.
-      enabled: evm.enabled && !!evm.jsonRpc && !!cosmosTxHash,
+      enabled: evm.enabled && !!evm.jsonRpc,
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 834a908 and 3893bfd.

📒 Files selected for processing (16)
  • CHANGELOG.md (1 hunks)
  • src/lib/components/EvmMethodChip.tsx (1 hunks)
  • src/lib/components/EvmToCell.tsx (3 hunks)
  • src/lib/components/table/evm-transactions/EvmTransactionsTableMobileCard.tsx (1 hunks)
  • src/lib/components/table/evm-transactions/EvmTransactionsTableRow.tsx (1 hunks)
  • src/lib/pages/evm-tx-details/components/EvmInputData.tsx (3 hunks)
  • src/lib/pages/evm-tx-details/components/EvmTxMsgDetails.tsx (1 hunks)
  • src/lib/pages/evm-tx-details/components/EvmTxMsgDetailsBody.tsx (1 hunks)
  • src/lib/pages/evm-tx-details/components/evm-tx-method/EvmTxCreateContract.tsx (1 hunks)
  • src/lib/pages/evm-tx-details/components/evm-tx-method/EvmTxTransfer.tsx (1 hunks)
  • src/lib/pages/evm-tx-details/components/evm-tx-method/EvmTxTransferErc20.tsx (5 hunks)
  • src/lib/pages/tx-details/components/evm-related-tx-section/index.tsx (1 hunks)
  • src/lib/services/tx/index.ts (2 hunks)
  • src/lib/services/tx/jsonRpc.ts (1 hunks)
  • src/lib/types/evm.ts (2 hunks)
  • src/lib/utils/evm.ts (5 hunks)
✅ Files skipped from review due to trivial changes (3)
  • src/lib/pages/evm-tx-details/components/evm-tx-method/EvmTxCreateContract.tsx
  • src/lib/services/tx/jsonRpc.ts
  • CHANGELOG.md
🧰 Additional context used
🪛 Biome (1.9.4)
src/lib/pages/evm-tx-details/components/EvmInputData.tsx

[error] 45-45: Useless case clause.

because the default clause is present:

Unsafe fix: Remove the useless case.

(lint/complexity/noUselessSwitchCase)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (20)
src/lib/utils/evm.ts (8)

2-8: Imports look consistent with usage.
No concerns at this time.


35-39: Ensure evmTxData is always defined upstream.
getEvmToAddress no longer accepts Option<TxDataJsonRpc>. Verify that calling code never passes an undefined or null transaction.


45-47: Added Method and evmTxHash fields for Create method.
Looks good.


56-59: Return structure for CallErc20Factory appears consistent.
No issues noted.


61-64: Confirm setting Method to null is intentional.
If method === EvmMethodName.TransferErc20, returning Method: null might be confusing. Verify that consumers of this output can handle a null method.


70-70: Returning Method: null for standard calls.
This is a valid choice as long as downstream logic expects a null for non-special transactions.


82-82: Updated usage of getEvmMethod.
Your method call matches the new signature.


86-86: Add checks for ERC20 input validity.
Similar to earlier feedback, verify that input is large enough before slicing for the amount.

src/lib/components/EvmMethodChip.tsx (2)

3-9: Extending props with txTo.
Providing txTo in the props aligns with the updated function signature. No immediate issues.


15-19: Integration of txTo into getEvmMethod.
Properly passing txTo to getEvmMethod ensures the method is accurately determined.

src/lib/pages/evm-tx-details/components/EvmTxMsgDetails.tsx (1)

37-37: Passing both txInput and txTo to EvmInputData.
This change enhances clarity and supports the expanded signature in the utility functions.

src/lib/pages/evm-tx-details/components/EvmTxMsgDetailsBody.tsx (1)

24-24: LGTM! Enhanced method determination with to address.

The addition of evmTxData.tx.to as a second argument to getEvmMethod aligns with the PR objective to fix EVM Create null to handling.

src/lib/components/EvmToCell.tsx (1)

13-18: LGTM! Improved null check handling.

The explicit check for !toAddress followed by a clear fallback UI improves the code's robustness.

src/lib/pages/evm-tx-details/components/EvmInputData.tsx (1)

11-14: LGTM! Improved prop naming and added txTo parameter.

The renaming of inputData to txInput improves clarity, and the addition of txTo aligns with the PR objective.

src/lib/pages/tx-details/components/evm-related-tx-section/index.tsx (1)

44-44: LGTM! Added txTo prop to EvmMethodChip.

The addition of txTo prop is consistent with other components and aligns with the PR objective.

src/lib/pages/evm-tx-details/components/evm-tx-method/EvmTxTransfer.tsx (1)

48-48: LGTM! Consistent prop addition.

The addition of txTo={to} prop is consistent with the PR's objective and properly handles the transaction's destination address.

src/lib/pages/evm-tx-details/components/evm-tx-method/EvmTxTransferErc20.tsx (1)

31-32: LGTM! Improved code organization.

The refactoring improves code organization by:

  • Using a dedicated utility function for ERC20 transfer data extraction
  • Centralizing the address and amount extraction logic
  • Maintaining consistent usage of extracted values

Also applies to: 33-37

src/lib/components/table/evm-transactions/EvmTransactionsTableRow.tsx (1)

75-79:

❓ Verification inconclusive

Verify address consistency.

The component uses both evmTransaction.tx.to (for EvmMethodChip) and getEvmToAddress(evmTransaction) (for display). Ensure these values are used appropriately and consistently.


🏁 Script executed:

#!/bin/bash
# Search for all usages of getEvmToAddress to understand its purpose
rg "getEvmToAddress" -A 3

Length of output: 2699


Verify address handling consistency.

In this file (src/lib/components/table/evm-transactions/EvmTransactionsTableRow.tsx), the raw evmTransaction.tx.to is directly passed to <EvmMethodChip>, while elsewhere (e.g., in EvmTransactionsTableMobileCard.tsx and other parts of the codebase) the address is computed using getEvmToAddress(evmTransaction). Please verify that this discrepancy is intentional. If the computed address from getEvmToAddress provides necessary formatting or validation, consider passing that value to <EvmMethodChip> for consistency.

src/lib/components/table/evm-transactions/EvmTransactionsTableMobileCard.tsx (1)

69-72: Similar address consistency concern as in EvmTransactionsTableRow.

This component has the same pattern of using both evmTransaction.tx.to and getEvmToAddress(evmTransaction).

src/lib/services/tx/index.ts (1)

744-747: LGTM!

The changes look good:

  • Setting staleTime: Infinity prevents unnecessary refetching of data that rarely changes.
  • The enabled condition is correctly simplified.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3893bfd and b02bbff.

📒 Files selected for processing (3)
  • src/lib/components/EvmToCell.tsx (3 hunks)
  • src/lib/types/evm.ts (2 hunks)
  • src/lib/utils/evm.ts (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/lib/components/EvmToCell.tsx
  • src/lib/utils/evm.ts
🔇 Additional comments (3)
src/lib/types/evm.ts (3)

5-5: LGTM!

The new imports are correctly added and follow the project's import style.

Also applies to: 8-8


24-37: LGTM! Well-designed type definition.

The new EvmToAddress type is well-structured:

  • Uses discriminated unions for type safety
  • Properly handles nullable fields
  • Clear separation of concerns between different address types

13-13:

✅ Verification successful

Verify the impact of renaming Create to BasicCreate.

The rename in EvmMethodId might affect other parts of the codebase that reference this enum value.

Run the following script to find potential references:


🏁 Script executed:

#!/bin/bash
# Description: Find references to EvmMethodId.Create or EvmMethodId.BasicCreate

# Search for potential references to the old name
echo "Searching for potential references to the old name 'EvmMethodId.Create':"
rg "EvmMethodId\.Create" -A 2

# Search for references to the new name
echo -e "\nSearching for references to the new name 'EvmMethodId.BasicCreate':"
rg "EvmMethodId\.BasicCreate" -A 2

Length of output: 579


Renaming Verified: EvmMethodId.BasicCreate is correctly propagated

The search confirms that references to the old name EvmMethodId.Create no longer exist while the new name is appropriately used (e.g., in src/lib/utils/evm.ts with txInput.startsWith(EvmMethodId.BasicCreate)). No further impacts are apparent.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
src/lib/types/evm.ts (2)

13-16: Improve comment format for better readability.

Consider restructuring the comments to better document the contract creation patterns:

-  // Note: Create multiple contracts
-  // 2 -> 0x60A06040
-  // 3 -> 0x60C06040
+  // Contract creation patterns:
+  // - Single contract: 0x60806040 (current)
+  // - Two contracts:   0x60A06040
+  // - Three contracts: 0x60C06040
   SingleCreate = "0x60806040",

27-40: Add JSDoc comments to document the EvmToAddress type.

Consider adding documentation to explain the purpose and usage of this type:

+/**
+ * Represents the destination address of an EVM transaction with its type.
+ * - For contract creation transactions, includes the contract address and transaction hash
+ * - For factory calls, includes the created token address
+ * - For regular transactions, includes just the recipient address
+ */
 export type EvmToAddress =
   | {
       toType: EvmMethodName.Create;
       address: HexAddr20;
       evmTxHash: Nullable<string>;
     }
   | {
       toType: EvmMethodName.CallErc20Factory;
       address: HexAddr20;
     }
   | {
       toType: null;
       address: HexAddr20;
     };
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b02bbff and dce4bbc.

📒 Files selected for processing (2)
  • src/lib/types/evm.ts (2 hunks)
  • src/lib/utils/evm.ts (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/lib/utils/evm.ts
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (1)
src/lib/types/evm.ts (1)

20-25: Maintain consistency between EvmMethodId and EvmMethodName enums.

The method is named SingleCreate in EvmMethodId but Create in EvmMethodName. This inconsistency could lead to confusion.

  export enum EvmMethodName {
    Transfer = "Transfer",
    TransferErc20 = "Transfer ERC20",
-   Create = "Create",
+   Create = "Single Create",
    CallErc20Factory = "Call ERC20 Factory",
  }

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
src/lib/components/EvmToCell.tsx (2)

23-23: Address the TODO comment about contract addresses.

The TODO comment suggests there might be an issue with contract addresses that needs to be fixed.

Would you like me to help investigate and fix the contract addresses issue? Please provide more context about the problem.


13-18: Remove unused prop evmTxHash.

The evmTxHash prop is defined in the component's props interface but is not used within the component.

 const EvmToCellCreate = ({
   address,
 }: {
   address: HexAddr20;
-  evmTxHash?: string;
 }) => (
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dce4bbc and d6d8323.

📒 Files selected for processing (8)
  • src/lib/components/EvmToCell.tsx (2 hunks)
  • src/lib/pages/evm-contract-details/data.ts (2 hunks)
  • src/lib/pages/evm-tx-details/data.ts (2 hunks)
  • src/lib/pages/tx-details/components/evm-related-tx-section/index.tsx (3 hunks)
  • src/lib/services/searchService.ts (2 hunks)
  • src/lib/services/tx/index.ts (5 hunks)
  • src/lib/types/evm.ts (2 hunks)
  • src/lib/utils/evm.ts (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
  • src/lib/types/evm.ts
  • src/lib/utils/evm.ts
  • src/lib/pages/tx-details/components/evm-related-tx-section/index.tsx
  • src/lib/services/tx/index.ts
🔇 Additional comments (6)
src/lib/pages/evm-contract-details/data.ts (1)

5-5: LGTM! Clean refactoring to EVM-specific hook.

The change consistently updates the import and usage to the new EVM-specific data fetching hook while maintaining the existing functionality.

Also applies to: 41-41

src/lib/pages/evm-tx-details/data.ts (1)

9-9: LGTM! Clean refactoring to EVM-specific hook.

The change consistently updates the import and usage to the new EVM-specific data fetching hook while maintaining the existing functionality.

Also applies to: 44-44

src/lib/services/searchService.ts (1)

34-34: LGTM! Clean refactoring to EVM-specific hook.

The change consistently updates the import and usage to the new EVM-specific data fetching hook while maintaining the existing validation logic for EVM transaction hashes.

Also applies to: 222-222

src/lib/components/EvmToCell.tsx (3)

3-4: LGTM!

The imports and types are well-defined and properly used.

Also applies to: 9-11


36-41: LGTM!

The null check is well-implemented with an appropriate fallback UI.


43-60: LGTM!

The conditional rendering logic is well-structured and handles all cases appropriately.

@songwongtp songwongtp requested a review from evilpeach February 21, 2025 07:01
@songwongtp songwongtp merged commit 2097efa into develop Feb 21, 2025
13 checks passed
@songwongtp songwongtp deleted the fix/evm-create-null-to branch February 21, 2025 07:21
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.

2 participants