Getting "insufficient funds" error although it seems like I have funds. #4169
-
I'm trying to replay this transaction using my code:
I always get the error: "[ERROR] Could not execute the transaction: insufficient funds for gas * price + value", although it looks like this account have a balance of 99151525241130818179, while |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @benams. Good question! This is expected behavior. When you start Ganache with the When you use As a workaround you can:
|
Beta Was this translation helpful? Give feedback.
Hi @benams. Good question!
This is expected behavior. When you start Ganache with the
wallet.unlockedAccounts
option, Ganache is "unlocking" the account by creating a fake private key for the account. This works for most cases, but it does not work foreth_signTransaction
. We should probably throw or notify the user of this case, so I've created #4170 to track that.When you use
eth_sendRawTransaction
, the signature portion of the signed transaction data is used to compute the from address of the transaction. Because a fake private key was used to sign the transaction, the resultant from address is not the actual address that you sent the transaction with, it's whatever address is associa…