useWriteContract
attempts to create a contract if the address
field contains an empty string
#4502
Open
1 task done
Check existing issues
Describe the bug
I'm writing a demo app that saves ~128*128 images onchain as base64 encoded strings. It allows users to create several galleries. A frontend bug caused cases where the
address
field was an empty string. Instead of erroring, the tx is sent, which is interpreted by the EVM as an attempt to create a contract -data
but noto
address.Link to Minimal Reproducible Example
https://github.com/briandoyle81/image-gallery-fe/blob/3b7d43f1098ea87a86f276a7123fe928505f7947/app/components/Content.tsx
Steps To Reproduce
Clone and npm install repo.
You'll need a Flow wallet or any EVM wallet with about $0.01 (1 cent) of Flow in it.
On line 118 of Content.tsx, change to: address: '' as
0x${string}
,Run the app
Sign in and complete the transaction to create a gallery.
Upload an image smaller than ~28 KB
Click
Save Onchain
Watch the console and observe
Content.tsx:54 CallExecutionError: Missing or invalid parameters. Double check you have provided the correct parameters.
followed bynet::ERR_CONNECTION_RESET 431 (Request Header Fields Too Large)
Open network and find one of the "eth_getTransactionByHash" calls and copy the tx hash.
Find on evm.flowscan.com and observe a failed attempt to create a transaction.
Similar to: https://evm.flowscan.io/tx/0xcc21f1bf6410c93122bdb71629b8783a8c00029233e546242b0b32ee63be01d1
What Wagmi package(s) are you using?
wagmi
Wagmi Package(s) Version(s)
^2.14.6
Viem Version
^2.22.3
TypeScript Version
^5
Anything else?
Flow is fully EVM equivalent, but it does have some differences compared to a standard network. It's very unlikely, but possible this impacts the bug.
The text was updated successfully, but these errors were encountered: