Sorry about the formatting, I’m on mobile
I'm trying to push an ERC20 Token transaction with 0 gas price using web3.py. Although when I set the gas price to 0, I receive the following error:
{'code': -32000, 'message': 'transaction underpriced'}
I know 0 gas price transactions are possible because I’ve seen plenty of them.
Code:
nonce = web3.eth.getTransactionCount(account)
txn = contract.functions.transfer(to_address, amount).buildTransaction(
{
'chainId': 1,
'gas': 1000000,
'gasPrice': web3.toWei("0", "gwei"),
'nonce': nonce,
}
)
signed_txn = web3.eth.account.signTransaction(txn, private_key=account_priv_key)
tx_hash = web3.eth.sendRawTransaction(signed_txn.rawTransaction)
And I need the transaction to be a 0 gas price. Any help would be great thanks.