Error when Writing Smart Contract with Value (Safe App + wagmi) #4324
Unanswered
liemnguyenthanh
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I wrote a smart contract using the following code:
writeContract({ abi: PassABI, functionName: "buyPasses", args: [managerAddress, BigInt(amount)], value: dataPrice as bigint, });
The intended functionality is that if the transaction doesn't exist (no value), my app can retrieve the hash data and execute it. However, when a transaction exists (with a value), my app encounters the following error message:
"err: insufficient funds for gas * price + value: address 0xB0351dE2e04E233e444E91da972533c03E35C372 have 0 want 6791767800000000 (supplied gas 600000000)"
I'm wondering if this function checks the balance of the safe address.
How can I fix this issue?
Beta Was this translation helpful? Give feedback.
All reactions