keep-starknet-strange/zaun

dev : Refactoring the crate deploy implementations

Open

#19 opened on Jun 27, 2024

 (0 comments) (0 reactions) (0 assignees)Rust (19 forks)auto 404
good first issue

Repository metrics

Stars
 (12 stars)
PR merge metrics
 (PR metrics pending)

Description

Refactoring the crate deploy implementations

Currently the code structure is something like this :

--- crates 
     --- l2
           --- client_crate
                  --- src
                         --- artifacts
                         --- clients
                         --- interfaces
                         --- lib.rs

Here lib.rs file contains the deploy functions for contracts behind safe or unsafe proxy. But in the case of Core Contract Client we have two implementations :

  • Starknet Sovereign : For deploying starknet core contract without proof validation.
  • Starknet Validity : For deploying starknet core contract with proof validation (used by starknet in prod).

So what we expect here is that we have a separate crate For eg : helper. Now helper crate will contain a trait for deployment of contracts and all other contract client crates will implement it. For core contract client we need a structure where deploy functions for both the implementations is separate not in lib.rs.

--- crates/
     --- l2/
           --- core_contract_client_crate/
                  --- src/
                         --- artifacts/
                         --- clients/
                               --- validity/
                               --- sovereign/
                               --- mod.rs
                         --- interfaces/
                         --- lib.rs (import deploy functions and export in this file.)
           --- helpers/
                         --- deploy/
                               --- mod.rs (implements deploy trait which is used by other deploy functions in other crates)

This is supposed to be a cleaner better design. Any suggestions are accepted.

Feel free to work on this issue : )

Contributor guide