Skip to content

cargo contract info: show local contract info #2083

@evilrobot-01

Description

@evilrobot-01

Is your feature request related to a problem? Please describe.

The metadata emitted from cargo contract build, at least for Solidity ABI, does not include the resulting selectors as it is assumed that tooling would derive/calculate this - e.g. using auto-parse from https://abi.hashex.org/. It would be useful however to see such information at development time, say via cargo contract info. This command however currently expects an onchain address rather than providing info for the local contract, even if specifying the path to a contract artifact.

❯ cargo contract info --contract contract.abi
ERROR: RPC error: RPC error: client error: Error when opening the TCP socket: Connection refused (os error 61)

Describe the solution you'd like
A clear and concise description of what you want to happen.

The cargo contract info should ideally infer that the local directory contains a contract and show its information, building the contract if required. Alternatively the --contract option could be updated to support either an onchain address or a local file.

The output should be consistent when viewing either a local contract or onchain contract, and should show the missing selectors in the case of Solidity ABI so that users do not have to use an additional tool.

Describe alternatives you've considered
As outlined above, https://abi.hashex.org/ works but it requires uploading the abi, then selecting a function and then entering values to see the selector.

Additional context
None.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions