Skip to content

feat(forge): new config option for filtering the contract artifacts which get generated #4979

@PaulRBerg

Description

@PaulRBerg

Component

Forge

Describe the feature you would like

The idea is to introduce a new config option called filter (or sift) that accepts a list of whitelisted contracts:

[profile.artifacts]
filter = [
  "Foo",
  "Bar",
]

When it sees this config, Forge generates artifacts only for the members listed under filter, regardless of whatever other members may be present in the repository. Note that by "members" in this context, I mean any of the following:

  • contract
  • interface
  • abstract
  • library

The primary use case is shipping a Node.js package that should include only the production contracts' artifacts - though there may be more use cases than just that. Anything related to artifact generation may benefit from such a feature.

Additional context

In our project, we wrote a Bash script because we couldn't find a way to filter contracts with Foundry itself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Next Up

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions