Skip to content

Unused class/interface in flattened code #4629

@vittominacori

Description

@vittominacori

Using flattener (both truffle or hardhat) all the custom errors from draft-IERC6093.sol are imported into the flattened file also if unused.
I mean using the ERC20 contract we will find also the IERC721Errors and IERC1155Errors into the code.
It should import only the required (and necessary) file in import {IERC20Errors} from "../../interfaces/draft-IERC6093.sol"; instead of importing the whole file.

Is there a way to avoid this behavior?
Is this a flattener issue and should we reference it there?

To reproduce simply run:

npx hardhat flatten contracts/token/ERC20/ERC20.sol > ERC20.flat.sol

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions