Skip to content

Conversation

@JuaniRios
Copy link
Contributor

@JuaniRios JuaniRios commented Dec 5, 2025

What

Closes #12702
Enables forge selectors cache to populate the selector cache from a specific directory of JSON ABIs.

Why

This addresses scenarios where error or transaction decoding is required across multiple contracts or repositories without requiring full compilation of every project.

For example, when building CLI tools or debugging complex flows, users may need to decode data from contracts where they possess the artifacts (ABIs) but do not wish to (or cannot) compile the full source code. This feature allows cast and other tools to utilize a centralized folder of ABIs for resolution.

How

  • Adds a new optional flag: --extra-abis-path <PATH>.
  • When provided, the command parses all JSON ABIs in the specified folder and adds their selectors to the cache.
  • Behavior: This is additive. The command first loads selectors from the provided path, then proceeds with the standard behavior of caching selectors from the current Foundry project.

Open Questions

  • Interaction with default behavior: Currently, the command creates a union of the "extra" ABIs and the local project ABIs. Should this flag be mutually exclusive (i.e., only use the folder when the flag is present), or remain additive?

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@JuaniRios JuaniRios changed the title Feat(forge selectors): cache selectors from abis feat(forge selectors): cache selectors from abis Dec 5, 2025
@JuaniRios JuaniRios marked this pull request as ready for review December 8, 2025 14:13
Copy link
Collaborator

@grandizzy grandizzy left a comment

Choose a reason for hiding this comment

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

thank you, makes sense, please fix fmt and add comment for the new function
@DaniPopes could you pls have a look too?

DaniPopes
DaniPopes previously approved these changes Dec 9, 2025
@grandizzy grandizzy self-requested a review December 9, 2025 16:59
Copy link
Collaborator

@grandizzy grandizzy left a comment

Choose a reason for hiding this comment

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

thank you!

@grandizzy grandizzy enabled auto-merge December 9, 2025 17:00
@grandizzy grandizzy added this pull request to the merge queue Dec 9, 2025
Merged via the queue into foundry-rs:master with commit a06ef9d Dec 9, 2025
15 checks passed
@github-project-automation github-project-automation bot moved this to Done in Foundry Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

feature(forge selectors): Add selectors to cache from a folder of ABIs

3 participants