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): add event-decode command to parsing and formatting log data #6511

Closed
Tracked by #8794
mitchmindtree opened this issue Dec 4, 2023 · 0 comments · Fixed by #9413
Closed
Tracked by #8794

feat(cast): add event-decode command to parsing and formatting log data #6511

mitchmindtree opened this issue Dec 4, 2023 · 0 comments · Fixed by #9413
Assignees
Labels
C-cast Command: cast P-low Priority: low T-feature Type: feature
Milestone

Comments

@mitchmindtree
Copy link

Component

Cast

Describe the feature you would like

With cast, we can fetch the logs with:

cast logs

We can filter down to the events that we care about by providing a signature:

cast logs "MyEvent(uint256 foo, uint256 bar)"

However the stdout still gives us unformatted, raw data (despite knowing the Event signature):

...
data: 0x000000000000000000000000000000000000000000000000000000000000004d000000000000000000000000000000000000000000000000000000000000004d
...

This makes sense for ensuring cast logs has consistent behaviour. That said it would be nice if there was a way that cast could use the signature to output the fields in a formatted manner. E.g. something like:

cast decode-event --json "MyEvent(uint256 foo, uint256 bar)" 0x000000000000000000000000000000000000000000000000000000000000004d000000000000000000000000000000000000000000000000000000000000004d

Which outputs something like:

{
    "foo": "0x000000000000000000000000000000000000000000000000000000000000004d",
    "bar": "0x000000000000000000000000000000000000000000000000000000000000004d",
}

Perhaps there's already a command along these lines that I'm missing? What is the command line workflow you use for this? I'm new to foundry - any advice appreciated!

Additional context

No response

@mitchmindtree mitchmindtree added the T-feature Type: feature label Dec 4, 2023
@gakonst gakonst added this to Foundry Dec 4, 2023
@github-project-automation github-project-automation bot moved this to Todo in Foundry Dec 4, 2023
@zerosnacks zerosnacks changed the title Parsing and formatting log data on the CLI feat(cast): add event-decode command to parsing and formatting log data Jul 5, 2024
@zerosnacks zerosnacks added the C-cast Command: cast label Jul 5, 2024
@zerosnacks zerosnacks added this to the v1.0.0 milestone Jul 26, 2024
@grandizzy grandizzy self-assigned this Oct 8, 2024
@grandizzy grandizzy added the P-low Priority: low label Nov 12, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in Foundry Nov 26, 2024
@grandizzy grandizzy moved this from Done to Completed in Foundry Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cast Command: cast P-low Priority: low T-feature Type: feature
Projects
Status: Completed
Development

Successfully merging a pull request may close this issue.

3 participants