You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 6, 2023. It is now read-only.
Using prepareWriteContract without an explicit value will work fine with most connectors except within a Safe environment.
Note: I wasn't sure if I should publish this here, but figured it's best to keep it close to where the Safe SDK is being used.
Expected Behavior
prepareWriteContract should count the optional value parameter (or {value: undefined}) as a non-payable transaction and proceed with the setup (e.g. simulateContract, ...) without trying to make use of that param.
Steps To Reproduce
While walletClients provided by regular connectors like Metamask will work fine and process the transaction flow, within Safe the transaction will fail with the following error:
As you can see, it attempts to convert undefined to what probably is an ethers.BigNumber instance used by the Safe SDK.
A quick fix was to explicitly attribute 0n to the value argument (no ETH passing through) in prepareWriteContract.
Link to Minimal Reproducible Example (CodeSandbox, StackBlitz, etc.)
No response
Anything else?
Side-note: I imagine the Safe integration needs to be revisited in light of the viem update, as well as due to other issues such as wevm/wagmi#2461
Is there an existing issue for this?
Current Behavior
Using
prepareWriteContract
without an explicitvalue
will work fine with most connectors except within a Safe environment.Note: I wasn't sure if I should publish this here, but figured it's best to keep it close to where the Safe SDK is being used.
Expected Behavior
prepareWriteContract
should count the optional value parameter (or{value: undefined}
) as a non-payable transaction and proceed with the setup (e.g. simulateContract, ...) without trying to make use of that param.Steps To Reproduce
While
walletClient
s provided by regular connectors like Metamask will work fine and process the transaction flow, within Safe the transaction will fail with the following error:As you can see, it attempts to convert
undefined
to what probably is an ethers.BigNumber instance used by the Safe SDK.A quick fix was to explicitly attribute
0n
to the value argument (no ETH passing through) inprepareWriteContract
.Link to Minimal Reproducible Example (CodeSandbox, StackBlitz, etc.)
No response
Anything else?
Side-note: I imagine the Safe integration needs to be revisited in light of the viem update, as well as due to other issues such as wevm/wagmi#2461
H/T @gavriliumircea
The text was updated successfully, but these errors were encountered: