Skip to content

feat(forge): script should not default to run() if contract has only one function with another signature #5282

@klkvr

Description

@klkvr

Component

Forge

Describe the feature you would like

Let's take following script as an example:

contract MintTokens is Script {
    function run(address token, uint256 amountToMint) {
        ...
    }
}

Right now, to run it I have to run following command:
forge script MintTokens <token_address> <amount_to_mint> --sig 'run(address,uint256)'

If I run just forge script MintTokens <token_address> <amount_to_mint> it fails with error Function run() is not implemented in your script.

It would be handy if in case when script contract has only one function, forge defaulted to it and not to run()

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions