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: incorrect error when sending txn with insufficient funds #584

Merged
merged 1 commit into from
Oct 25, 2023

Conversation

technophile-04
Copy link
Collaborator

Description

In summary, we get this error :

Screenshot 2023-10-24 at 3 18 46 PM

While sending value i.e greater than our wallet balance, Ideally it should have given us "Sender doesn't have enought fund...." error

Check out wevm/viem#1457 for full context

Removing chainId from useContractWrite solves this problem, We could also wait until wevm/viem#1457 is fixed and close this 🙌

Copy link
Member

@damianmarti damianmarti left a comment

Choose a reason for hiding this comment

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

Nice catch @technophile-04 !!!

The fix looks good, but maybe we can wait a little if Wagmi fixes the bug.

@carletex
Copy link
Member

Thanks @technophile-04 ! And thanks for the review.

Yep, maybe we don't need chainId in the write hook after all: #584 (comment)

I guess we do need it on the Read hooks (in case no wallet is connected) and ofc in the ENS ones (where we always want to look up mainnet)

@carletex carletex merged commit e88419a into main Oct 25, 2023
1 check passed
@carletex carletex deleted the fix/wrong-error-insufficent-funds branch October 25, 2023 09:29
@carletex carletex mentioned this pull request Nov 2, 2023
@github-actions github-actions bot mentioned this pull request Nov 2, 2023
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.

4 participants