keep-starknet-strange/zaun

dev : Refactoring the crate deploy implementations

オープン

#19 opened on 2024/06/27

 (0 件のコメント) (0 件のリアクション) (0 人の担当者)Rust (19 件のフォーク)auto 404
good first issue

Repository metrics

Stars
 (12 個のスター)
PR merge metrics
 (30d に merged PR はありません)

説明

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 : )

コントリビューターガイド