Skip to content

Conversation

silvekkk
Copy link
Contributor

When using cast run --debug to debug transactions, if one of the Etherscan contracts fails to compile, it's really hard to tell which one caused the problem.
The compiler output is super long and scrolls past the initial "Compiling: ContractName" messages.

Adds the contract index and name directly to the error message so you can immediately know which contract is the problem.

Before(which contract? no idea):

Before:
Compiling: UniswapV2Router02 0x7a25...
Compiling: WETH9 0xC02a...
Compiling: UniswapV2Pair 0xB4e1...
Compiling: SomeOldContract 0x1234...
Compiling: AnotherContract 0x5678...

Error: compilation failed
Error (3853): Stack too deep...

After(ah, it's the 4th one - SomeOldContract):

Compiling [1/5]: UniswapV2Router02 0x7a25...
Compiling [2/5]: WETH9 0xC02a...
Compiling [3/5]: UniswapV2Pair 0xB4e1...
Compiling [4/5]: SomeOldContract 0x1234...
Compiling [5/5]: AnotherContract 0x5678...

Error: Failed to compile contract [4/5]: SomeOldContract at 0x1234...
Error (3853): Stack too deep...

Copy link
Contributor

@onbjerg onbjerg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please check ci & can we remove the enumeration? (x/y)

@silvekkk silvekkk requested a review from onbjerg October 17, 2025 20:10
@silvekkk
Copy link
Contributor Author

please check ci & can we remove the enumeration? (x/y)

Sure, removed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants