-
-
Notifications
You must be signed in to change notification settings - Fork 920
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
bug: TransactionExecutionError nativeCurrency undefined #1457
Comments
This also removes an issue with error messages in wagmi https://github.com/wagmi-dev/wagmi/issues/3155
I tried to reproduce your issue from the repository, but nothing happened. The transaction was processed successfully. |
Thanks for looking into it 🙌 Actually we removed To reproduce just checkout to this commit scaffold-eth/scaffold-eth-2@ab6c9c3 i.e after |
Transferring over to Viem |
useContractWrite
This issue has been locked since it has been closed for more than 14 days. If you found a concrete bug or regression related to it, please open a new bug report with a reproduction against the latest Viem version. If you have any questions or comments you can create a new discussion thread. |
Is there an existing issue for this?
Package Version
1.4.4
Current Behavior
This error happens when you try to send
value
and you don't have enough value in your wallet.As we can see in above image the wallet has approx 2eth and trying to send 5th. The error thrown by
viem
is "Connot read properties of undefined (reading symbol)"Expected Behavior
Ideally, the error should have been :
"sender doesn't have enough funds to send tx. The max upfront cost is: 5000066191091876292 and the sender's account only has: 1999803004163219134"
Steps To Reproduce
Please check the "Anything else?" section for a quick summary since I feel the error is obvious.....but here is how to reproduce it :
After this just try to go to
Debug
tab and trysetGreeting
with a value that is greater than your wallet valueLink to Minimal Reproducible Example (StackBlitz, CodeSandbox, GitHub repo etc.)
https://github.com/scaffold-eth/scaffold-eth-2
Anything else?
Did some digging and it seems the problem is caused due to this line :
https://github.com/wagmi-dev/wagmi/blob/b12248167636e413ec2b6f477e3961b190468c04/packages/core/src/actions/contracts/writeContract.ts#L92
Here we can see if
chainId
is passed as args it makes chain aschain : {id : number}
And now if you check at TransactionExecutionError class from viem from it has :
checkout this line
Here are some SS from while debugging :
Checkout
chain = {id : 31337}
since it only haveid
property it throws while doingchain.nativeCurrencty.symbol
The text was updated successfully, but these errors were encountered: