1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Python] How can I get the reason for a failed transaction status 0 from Geth?

Discussão em 'Python' iniciado por Stack, Setembro 12, 2025.

  1. Stack

    Stack Membro Participativo

    After sending a transaction to a payable smart contract (deployed to a geth instance) I receive transaction status 0. I don't understand where I'm going wrong as I followed the documentation.

    Looking at the smart contract it should not revert; What am I missing?

    account = w3.eth.account.from_key(private_key)
    tx = {
    "chainId": w3.eth.chain_id,
    "from": account.address,
    "to": contractAddress,
    "value": w3.to_wei(0.001, "ether"), # send 2 ether
    "nonce": w3.eth.get_transaction_count(account.address),
    "gas": 200000,
    "maxFeePerGas": 2000000000,
    "maxPriorityFeePerGas": 1000000000,
    }


    signed_tx = account.sign_transaction(tx)
    bid_hash = w3.eth.send_raw_transaction(signed_tx.raw_transaction)

    Continue reading...

Compartilhe esta Página