foundry icon indicating copy to clipboard operation
foundry copied to clipboard

feat: cast decode-error

Open nhtyy opened this issue 1 year ago • 4 comments

Motivation

When debugging eth integrations across platforms sometimes the only thing you can work with is the revert data, this can turn into searching thru forge inspect or manually checking if its an error that can be decoded as a string

Solution

Introduce forge decode-error, which searches the project (if any), checks against revert/panic types and prints any results

nhtyy avatar Apr 24 '24 23:04 nhtyy

This seems like it would be better as a cast command

tynes avatar Apr 29 '24 02:04 tynes

Hi @nhtyy thanks for your PR! I can see how this feature could be useful. Would you be interested in porting your changes to cast as cast decode-error?

zerosnacks avatar Jul 31 '24 12:07 zerosnacks

Hey @zerosnacks.

Apologies for the delay but will give this a shot in the next week or two

nhtyy avatar Aug 12 '24 10:08 nhtyy

@zerosnacks

Im going to work on this during this upcoming week, just wanted your opinion because cast doesn't have any "project awareness" in the since that it doesn't ever look for a foundry.toml

my thinking is either if were in a foundry project we search there, or if not we search the .foundry cache?

do you think either of these approaches is ok?

nhtyy avatar Aug 19 '24 01:08 nhtyy