-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Open
Labels
Cmd-forge-selectorsCommand: forge selectorsCommand: forge selectorsT-featureType: featureType: feature
Description
Component
Forge
Describe the feature you would like
What
- Add the possibility to add selectors to the foundry cache from a folder of JSON ABIs
Why
- We had a situation at work where we wanted to decode an error from a complex contract flow, but the error could possibly be in any of multiple contracts and repos, and this decoding needed to happen in a CLI tool. So forcing the CLI user to compile all the possible repos was not a reasonable option. We ended up storing all ABIs in one place and developing a decoder tool. If this would have been possible with
castwe would have really appreciated it.
How
- At first I thought about extending
cast decode-errorto accept an optional--extra-abisflag that would add the selectors to the in-memory cache by callingcache.extend_from_abi(json_abi)from all the files in the folder path. - George in the telegram group suggested instead to achieve the same result by extending
forge selectors cachewith a new flag that would add all the selectors in the ABIs to the foundry cache. This method makes more sense since it will also be usable for other tools.
Anything Else?
I will be implementing this feature and submitting a PR soon
Additional context

Metadata
Metadata
Assignees
Labels
Cmd-forge-selectorsCommand: forge selectorsCommand: forge selectorsT-featureType: featureType: feature
Type
Projects
Status
Backlog