zksync_web3_rs/zks_wallet/requests/
deploy_request.rs

1use ethers::{abi::Abi, types::Address};
2use std::fmt::Debug;
3
4#[derive(Clone, Debug)]
5pub struct DeployRequest {
6    pub contract_abi: Abi,
7    pub contract_bytecode: Vec<u8>,
8    pub constructor_parameters: Vec<String>,
9    pub from: Address,
10    pub factory_deps: Option<Vec<Vec<u8>>>,
11}
12
13impl DeployRequest {
14    pub fn with(
15        contract_abi: Abi,
16        contract_bytecode: Vec<u8>,
17        constructor_parameters: Vec<String>,
18    ) -> Self {
19        Self {
20            contract_abi,
21            contract_bytecode,
22            constructor_parameters,
23            from: Default::default(),
24            factory_deps: None,
25        }
26    }
27
28    pub fn from(mut self, from: Address) -> Self {
29        self.from = from;
30        self
31    }
32
33    pub fn factory_deps(mut self, factory_deps: Vec<Vec<u8>>) -> Self {
34        self.factory_deps = Some(factory_deps);
35        self
36    }
37}