I know for sure I have enough eth on account. Some prelims:
I am signing a raw transaction with web3.py, like so:
transaction = {
'to': '0xSENDHEREFINALLYPLEASE',
'value': 1000,
'gas': 2000000,
'gasPrice': 20000000000,
'nonce': 0,
'chainId': 1,
}
I am using INFURA project id env variable in conjunction with this import:
from web3.auto.infura import w3
I sign successfully and attempt to send like so:
signed_tx = w3.eth.account.sign_transaction(transaction, 0xMYPRIVKEY)
w3.eth.sendRawTransaction(signed_tx.rawTransaction)
web3.py
version is: 5.10.0
And then bam this error. Any idea what might be causing it?
Running get balance on the sender address I get its balance:
w3.eth.getBalance("0xd93800B7290B37a3ac36e4cDd3F881a929acD4A3")
>> 11000000000000000
Suppose I am writing incorrect units for gas, gasPrice or value ?
2000000 * 20000000000 + 1000 < 11000000000000000
is False, thus the error?
But when I use these params, it says the transaction is underpriced, what the... how does this work
value = 1000
gas = int(2000000 / 4)
gasPrice = 20000000000
The transaction is underpriced
- this is typically because you've already executed a transaction with the same account and the same nonce, but with a higher gas price.gas = int(2000000 / 4)
- this doesn't seem to have any logical reason behind it.