Forc call help for callable functions #6935
Labels
enhancement
New feature or request
forc
forc-call
Everything related to the `forc-call` plugin in `forc-client` package
team:tooling
Tooling Team
Description
Since the ABI must be provided for forc call; it would be great if forc call
--help
could print out all the callable functions of the contract.This would make it much easier for the user to know what functions are available on the callable contract.
^ All this data is available in the ABI; running the help would also need to parse/process the ABI (if provided).
Additional Improvements
It would be even better if we can provide an example of how to call the function - with each listed function.
For this, we'd need to parse the input params from the ABI - for the respective function; and construct a a string-parsable input for the function (assuming function accepts args).
Example
Running
forc call --abi <..> <CONTRACT-ID> --help
should parse the ABI; read the functions, and give examples on how to call them; below the current help output.These should be something which can simply be copy-pasted by the user themselves for execution.
E.g.
> forc call --abi ./out/debug/counter-contract-abi.json 0xe18de7c7c8c61a1c706dccb3533caa00ba5c11b5230da4428582abf1b6831b4d --help
Doesn't have to be perfect; i can imagine some complexity with complex structs/enums/generics - but something along these lines is what's expected.
The text was updated successfully, but these errors were encountered: