Initial work on EVM type generation
@metmirr is already working on this.
Since Dec 8, 2020.
- Dominant language
- TypeScript
- Stars
- 50
- Forks
- 43
- PR merge metrics
- No merged PRs in 30d
Description
Background
We currently expect that the Hydra tooling will be expanded to allow developers wanting to write APIs for Smart Contracts running on the EVM (on Substrate) to write their event and method handlers in a type safe way. This will likely be facilitated by making Hydra itself work with plugins that can run custom code generation code at the time of setup.
Goal
It is still not totally nailed down exactly how Hydra will run plugins, hence the interface between Hydra and the EVM plugin described above is not available at this time. However, the fundamental task of being able to generate Typescript types for methods and events using the ABI of a contract on the Substrate EVM can still be tackled right now.
In fact, @Lezek123 has already provided some initial guidance on how this could work in the issue https://github.com/Joystream/joystream/issues/1816 under the section Query node (and general event/metadata handling).
Using this as a starting point it should be possible to come up with the internal parts of the future plugin.
Specifically, what is needed is some Typescript library that can take
- a list of event names
- a list of method names
- a Solidity ABI for a contract
and can spit out a set of Typescript types modeling these.
Remember unit tests with example contract.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.