EXAMPLES

Get a receipt by transaction hash. This one is from a transaction on the Ethereum mainnet, sending 1 DAI to vitalik.eth:
cast receipt 0x96164ff7b1f48641ed2168b18c1213dbe0ce2504f870a1187ed8cd2df576bae1 --rpc-url https://eth.llamarpc.com
blockHash 0xc6455167b00399dfbbc0335ccfe465d789dd17d3ad2e091be7575cd45f5105a0 blockNumber 21027977 contractAddress cumulativeGasUsed 9740548 effectiveGasPrice 6103491361 from 0x498098ca1b7447fC5035f95B80be97eE16F82597 gasUsed 34706 logs [{ "address":"0x6b175474e89094c44da98b954eedeac495271d0f", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x000000000000000000000000498098ca1b7447fc5035f95b80be97ee16f82597", "0x000000000000000000000000d8da6bf26964af9d7eed9e03e53415d37aa96045" ], "data":"0x0000000000000000000000000000000000000000000000000de0b6b3a7640000", "blockHash":"0xc6455167b00399dfbbc0335ccfe465d789dd17d3ad2e091be7575cd45f5105a0", "blockNumber":"0x140dc89", "blockTimestamp":"0x6718dd53", "transactionHash":"0x96164ff7b1f48641ed2168b18c1213dbe0ce2504f870a1187ed8cd2df576bae1", "transactionIndex":"0x72", "logIndex":"0x10e", "removed":false }] logsBloom 0x00000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000008200000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000010000000000000004000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000002000000000000000000000000000000000000800000000000000000000000000000010000000000000000000000 root status 1 (success) transactionHash 0x96164ff7b1f48641ed2168b18c1213dbe0ce2504f870a1187ed8cd2df576bae1 transactionIndex 114 type 2 blobGasPrice blobGasUsed authorizationList to 0x6B175474E89094C44Da98b954EedeAC495271d0F
Get a specific field from the receipt. In this case, the gasUsed:
cast receipt 0x96164ff7b1f48641ed2168b18c1213dbe0ce2504f870a1187ed8cd2df576bae1 gasUsed --rpc-url https://eth.llamarpc.com
34706
Get a block number from the receipt:
cast receipt 0x96164ff7b1f48641ed2168b18c1213dbe0ce2504f870a1187ed8cd2df576bae1 blockNumber --rpc-url https://eth.llamarpc.com
21027977

DOCUMENTATION

cast receipt


Get the transaction receipt for a transaction

$ cast receipt --help
Usage: cast receipt [OPTIONS] <TX_HASH> [FIELD]

Arguments:
  <TX_HASH>
          The transaction hash

  [FIELD]
          If specified, only get the given field of the transaction

Options:
      --confirmations <CONFIRMATIONS>
          The number of confirmations until the receipt is fetched
          
          [default: 1]

      --async
          Exit immediately if the transaction was not found
          
          [env: CAST_ASYNC=]

  -r, --rpc-url <URL>
          The RPC endpoint, default value is http://localhost:8545
          
          [env: ETH_RPC_URL=]

  -k, --insecure
          Allow insecure RPC connections (accept invalid HTTPS certificates).
          
          When the provider's inner runtime transport variant is HTTP, this
          configures the reqwest client to accept invalid certificates.

      --flashbots
          Use the Flashbots RPC URL with fast mode
          ([https://rpc.flashbots.net/fast](https://rpc.flashbots.net/fast)).
          
          This shares the transaction privately with all registered builders.
          
          See:
          [https://docs.flashbots.net/flashbots-protect/quick-start#faster-transactions](https://docs.flashbots.net/flashbots-protect/quick-start#faster-transactions)

      --jwt-secret <JWT_SECRET>
          JWT Secret for the RPC endpoint.
          
          The JWT secret will be used to create a JWT for a RPC. For example,
          the following can be used to simulate a CL `engine_forkchoiceUpdated`
          call:
          
          cast rpc --jwt-secret <JWT_SECRET> engine_forkchoiceUpdatedV2
          '["0x6bb38c26db65749ab6e472080a3d20a2f35776494e72016d1e339593f21c59bc",
          "0x6bb38c26db65749ab6e472080a3d20a2f35776494e72016d1e339593f21c59bc",
          "0x6bb38c26db65749ab6e472080a3d20a2f35776494e72016d1e339593f21c59bc"]'
          
          [env: ETH_RPC_JWT_SECRET=]

      --rpc-timeout <RPC_TIMEOUT>
          Timeout for the RPC request in seconds.
          
          The specified timeout will be used to override the default timeout for
          RPC requests.
          
          Default value: 45
          
          [env: ETH_RPC_TIMEOUT=]

      --rpc-headers <RPC_HEADERS>
          Specify custom headers for RPC requests
          
          [env: ETH_RPC_HEADERS=]

  -h, --help
          Print help (see a summary with '-h')

  -j, --threads <THREADS>
          Number of threads to use. Specifying 0 defaults to the number of
          logical cores
          
          [aliases: --jobs]

Display options:
      --color <COLOR>
          The color of the log messages

          Possible values:
          - auto:   Intelligently guess whether to use color output (default)
          - always: Force color output
          - never:  Force disable color output

      --json
          Format log messages as JSON

  -q, --quiet
          Do not print log messages

  -v, --verbosity...
          Verbosity level of the log messages.
          
          Pass multiple times to increase the verbosity (e.g. -v, -vv, -vvv).
          
          Depending on the context the verbosity levels have different meanings.
          
          For example, the verbosity levels of the EVM are:
          - 2 (-vv): Print logs for all tests.
          - 3 (-vvv): Print execution traces for failing tests.
          - 4 (-vvvv): Print execution traces for all tests, and setup traces
          for failing tests.
          - 5 (-vvvvv): Print execution and setup traces for all tests,
          including storage changes.