Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: cast decode-error #7775

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

nhtyy
Copy link
Contributor

@nhtyy nhtyy commented Apr 24, 2024

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

@tynes
Copy link
Contributor

tynes commented Apr 29, 2024

This seems like it would be better as a cast command

Copy link
Member

@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 move this to cast if there isn't already a command that does this (e.g. cast abi-decode)

@zerosnacks zerosnacks modified the milestone: v1.0.0 Jul 31, 2024
@zerosnacks
Copy link
Member

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 zerosnacks added the C-cast Command: cast label Jul 31, 2024
@zerosnacks zerosnacks changed the title feat: forge decode-error feat: cast decode-error Jul 31, 2024
@nhtyy
Copy link
Contributor Author

nhtyy commented Aug 12, 2024

Hey @zerosnacks.

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

@nhtyy
Copy link
Contributor Author

nhtyy commented Aug 19, 2024

@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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cast Command: cast
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants