Skip to content

feat(rln): replace manual smart contract classes/functions with generate typings #2630

@adklempner

Description

@adklempner

Description

Current code for interacting with RLN smart contracts leaves too much room for errors between the Typescript code for interacting with the smart contracts and the smart contracts themselves.

User Story

As a developer, I want to have access to generated, strictly typed code using the relevant commit from the https://github.com/waku-org/waku-rlnv2-contract repo

I do NOT want to have to spend ANY time writing boilerplate code for reading from and interacting with smart contracts

I do NOT want to have to manually update ABIs or any other dependency when the smart contract code changes

Proposed Solution / Feature Design

  • always get latest ABIs from https://github.com/waku-org/waku-rlnv2-contract , do NOT track the files in this repo separately
  • either add a forge plugin to the above repo or use a script/lib in our repo to generate the Typescript code from the ABI/Solidity
  • add an npm script and perhaps build/ci step to generate the typings
  • use the typings (with a provider if necessary) to handle smart contract interaction in the code

Optional: Diagram or Draft of Design

Notes

  • This may be more relevant for the rln website, but given the fact that we now rely on a smart contract read in order to get data necessary for generating the proof, it's likely high ROI to implement this in the waku/rln package as well

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions