#10863·foundry

bug(`cast`): `cast run` does not work sometimes with weird errors (lack of funds, nonce too low, etc.)

Author: 0xDEnYOCreated Jun 27, 2025Updated Sep 27, 2026
LabelsT-bugC-cast

Component

Forge, Cast

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

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge Version: 1.2.3-stable

What version of Foundryup are you on?

foundryup: 0.3.3

What command(s) is the bug in?

Cast run

Operating System

macOS (Apple Silicon)

Describe the bug

Sometimes when I run cast run I do not get any stack trace. Here is one example:

Case 1: cast run 0xe5dff9c3f5ec5b1af5f641f1c1f1829b38713641b4401b2affeaf794d7b48e0b --rpc-url https://zksync2-mainnet.zksync.io -vvv

Explorer URL 1: https://era.zksync.network/tx/0xe5dff9c3f5ec5b1af5f641f1c1f1829b38713641b4401b2affeaf794d7b48e0b Explorer URL 2: https://explorer.zksync.io/tx/0xe5dff9c3f5ec5b1af5f641f1c1f1829b38713641b4401b2affeaf794d7b48e0b (in this explorer we get some data back that helps to extract the revert reason) Also Phalcon is able to produce a full stack trace: https://app.blocksec.com/explorer/tx/zksync-era/0xe5dff9c3f5ec5b1af5f641f1c1f1829b38713641b4401b2affeaf794d7b48e0b

This transaction uses a precompile which in Telegram was pointed out could be an issue. Is there a way this could be improved so that also those stack traces are shown?

Image


Case 2: Here is a second transaction that does not work:

cast run 0x715e633fc1ae98bfda07a52b11758acb9bd5bf73cd4c386708e694ec42da5924 --rpc-url https://rpc.hyperliquid.xyz/evm -vvv

Explorer URL: https://www.hyperscan.com/tx/0x715e633fc1ae98bfda07a52b11758acb9bd5bf73cd4c386708e694ec42da5924

This one is more difficult to debug since HyperEVM is not supported by Tenderly or Phalcon which is why I would love to see a full stack trace for it. But using cast run we get a nonce too low error (that i've seen a few times before):

Image

adding the flag --trace-printer also does not yield any more output.

Is this a bug? Can this be improved somehow?