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

Error Handling for Invalid Address Array #2499

Open
MobillsInMobild opened this issue Aug 30, 2024 · 0 comments
Open

Error Handling for Invalid Address Array #2499

MobillsInMobild opened this issue Aug 30, 2024 · 0 comments

Comments

@MobillsInMobild
Copy link

Issue: Error Handling for Invalid Address Array

Description:

When initiating a contract transaction with an invalid address in the form of an Array, the Rabby wallet extension responds by displaying a blank page. This issue persists until the erroneous transaction is rejected. During this period, subsequent transactions are unable to load properly. In contrast, other wallet extensions typically return an error message immediately, allowing normal operations to continue unaffected.

Steps to Reproduce:

  1. Initiate a transaction with an address parameter set as an Array (e.g., ["invalid_address"]). Here's an example code(This bug does not occur when using sendTransaction):
  import { writeContract } from "viem/actions"
  import { useWalletClient, useAccount } from "wagmi"

  const Test = async () => {
      const { data: walletClient } = useWalletClient();
      const account = useAccount();
      if (!account) {
          return;
      } else {
          try {
              console.log('Sending transaction')
              await writeContract(walletClient, {
                  address : ['0x0d4a11d5EEaaC28EC3F61d100daF4d40471f1852'], // Use UniswapV2Pool address as an example
                  abi : [{"constant":false,"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"mint","outputs":[{"internalType":"uint256","name":"liquidity","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"}],
                  functionName : 'mint',
                  args : ['0x0d4a11d5EEaaC28EC3F61d100daF4d40471f1852'],
                  account : account.address
              })
          } catch (error) {
              console.log(error)
          }
      }
  }

  export default Test;
  1. Observe that the wallet extension responds but the page remains blank.
  2. Attempt subsequent transactions which fail to load properly until the erroneous transaction is handled.

Expected Behavior:

The wallet extension should display an appropriate error message for invalid address inputs, ensuring that subsequent transactions can be processed without issue.

Additional Information:

  • Rabby Wallet Extension Version: 0.92.88
  • Browser: Microsoft Edge 128.0.2739.42

Suggestions:

Consider implementing error handling mechanisms to gracefully manage invalid address inputs, thereby preventing disruptions to subsequent transactions.

Thank you for addressing this issue.


Screenshots/Logs:

rabbyIssue

Label:

Bug

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

No branches or pull requests

1 participant