Skip to content

additional information about transactions displayed in popup/dialog#28

Open
awesamarth wants to merge 3 commits intomainfrom
feat-dialog-improvements
Open

additional information about transactions displayed in popup/dialog#28
awesamarth wants to merge 3 commits intomainfrom
feat-dialog-improvements

Conversation

@awesamarth
Copy link
Copy Markdown

if function detected-> call sourcify api to get function name (similar to cast 4byte)
if selector found in directory-> show that
if error / not found -> hide row and just show the contract address

if no function detected (no op)-> hide function row and instead of "Contract", show "To"

@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
porto-rise-playground Ready Ready Preview, Comment Feb 25, 2026 11:31am
rise-wallet-testnet Ready Ready Preview, Comment Feb 25, 2026 11:31am
rise-wallet-testnet-dialog Ready Ready Preview, Comment Feb 25, 2026 11:31am
rise-wallet-testnet-id Ready Ready Preview, Comment Feb 25, 2026 11:31am

Request Review

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @awesamarth, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the user experience within the action request dialog by providing more comprehensive and understandable transaction details. It introduces a dedicated component to parse and display function names, contract addresses, and network paths, making complex transactions more transparent for users. The changes aim to give users a clearer picture of what a transaction entails before they approve it.

Highlights

  • Enhanced Transaction Details: Introduced a new CallDetails component to display more comprehensive information about transactions within the action request dialog.
  • Function Signature Resolution: Implemented logic to detect function calls, decode ERC20 function names, and query the Sourcify 4byte API for unknown function selectors to provide human-readable function names.
  • Dynamic Labeling: The 'Contract' label for the recipient address dynamically changes to 'To' if no function data is detected for a transaction, improving clarity.
  • Address Copy Functionality: Added a CopyButton next to the transaction's 'to' address, allowing users to easily copy the address.
  • Network Path Display: Included the display of network paths for transactions that involve multiple chains, providing better context for cross-chain operations.
Changelog
  • apps/dialog/src/routes/-components/ActionRequest.tsx
    • Added CallDetails component to display transaction function and address information.
    • Integrated 4byte Sourcify API for function signature lookup.
    • Introduced dynamic labeling for transaction recipient addresses.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

The pull request introduces a new CallDetails component to display additional transaction information, such as the contract address, function name, and network path. It leverages the 4byte API to resolve function names from selectors and includes UI improvements like a copy button for addresses and dynamic loading states. The changes enhance the user experience by providing more context for transactions. However, there are a couple of areas for improvement regarding error handling and configuration.

return firstCall.data.slice(0, 10) as `0x${string}`
}, [firstCall?.data])

const erc20FunctionName = React.useMemo(() => {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

An empty catch block can hide potential errors during decodeFunctionData. While it might be intended for graceful fallback, it's generally better to at least log the error to aid in debugging unexpected issues.

Consider adding a console.error or a more specific error handling mechanism here.

      } catch (error) {
        console.error("Failed to decode ERC20 function data:", error)
      }

Comment on lines +656 to +657
return decoded.functionName
} catch {}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The URL for the 4byte API is hardcoded. This makes the application less flexible and harder to manage if the API endpoint changes or if different environments require different configurations. It's a good practice to manage external service URLs through environment variables or a centralized configuration.

Consider moving this URL to an environment variable or a configuration file.

        const res = await fetch(
          `${process.env.FOUR_BYTE_API_URL || 'https://api.4byte.sourcify.dev'}/signature-database/v1/lookup?function=${selector}`,

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