Skip to content

feat(forge flatten): add dead code elimination #253

Open
@sakulstra

Description

@sakulstra

Component

Forge

Describe the feature you would like

When using some libraries, the --flatten output will be gigantic as flatten will inline all imports. It would be neat if flatten would detect & remove unused imports.

When using re-export index files like here https://github.com/bgd-labs/aave-address-book/blob/main/src/AaveAddressBook.sol that makes it essentially impossible to use in foundry as the generated code will be unusable long.

Additional context

In addition to what i mentioned above i guess it might make sense to even eliminate unused code in the actually imported files. Not sure sure about this though.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions