Skip to content

contractAddress null in the receipt of a contract creation tx #12837

@ARR552

Description

@ARR552

Component

Anvil

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge Version: 1.5.0-stable Commit SHA: 1c57854 Build Timestamp: 2025-11-26T09:14:24.173470686Z (1764148464) Build Profile: maxperf

What version of Foundryup are you on?

foundryup: 1.1.0

What command(s) is the bug in?

anvil --host 0.0.0.0 --chain-id 1337

Operating System

Linux

Describe the bug

First run anvil:

 anvil --host 0.0.0.0 --chain-id 1337

Then run in other terminal:

cast send --rpc-url http://localhost:8545 --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 0x3fab184622dc19b6109349b94811493bf2a45362 --value 50ether

cast rpc --rpc-url http://localhost:8545 eth_sendRawTransaction 0xf8a58085174876e800830186a08080b853604580600e600039806000f350fe7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf31ba02222222222222222222222222222222222222222222222222222222222222222a02222222222222222222222222222222222222222222222222222222222222222 | jq -r '.'

The response is:
0xeddf9e61fb9d8f5111840daef55e5fde0041f5702856532cdbb5a02998033d26
Then, run:

cast receipt 0xeddf9e61fb9d8f5111840daef55e5fde0041f5702856532cdbb5a02998033d26 --json | jq -r .contractAddress

This return null even when it is a contract creation.

cast receipt 0xeddf9e61fb9d8f5111840daef55e5fde0041f5702856532cdbb5a02998033d26 --json

{"status":"0x0","cumulativeGasUsed":"0x186a0","logs":[],"logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","type":"0x0","transactionHash":"0xeddf9e61fb9d8f5111840daef55e5fde0041f5702856532cdbb5a02998033d26","transactionIndex":"0x0","blockHash":"0x4e8dbe068c5e2e9d0ec2982f3a55d0aae50f85b79eb7cda4fa20c8a68fdbb2ff","blockNumber":"0x2","gasUsed":"0x186a0","effectiveGasPrice":"0x174876e800","blobGasPrice":"0x1","from":"0x3fab184622dc19b6109349b94811493bf2a45362","to":null,"contractAddress":null}

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-bugType: bugT-needs-triageType: this issue needs to be labelled

    Type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions