pub struct ContractFactory<A> { /* private fields */ }
Expand description
A contract factory that acts as a blueprint for deploying Starknet smart contracts using the Universal Deployer Contract.
Implementations§
Source§impl<A> ContractFactory<A>
impl<A> ContractFactory<A>
Sourcepub const fn new(class_hash: Felt, account: A) -> Self
👎Deprecated: this method uses the legacy UDC; use new_with_udc
instead
pub const fn new(class_hash: Felt, account: A) -> Self
new_with_udc
insteadConstructs a new ContractFactory
from a class hash and an account.
The ContractFactory
created uses the default address for the Universal Deployer
Contract. To use a custom UDC deployment, use new_with_udc
instead.
Sourcepub const fn new_with_udc(
class_hash: Felt,
account: A,
udc: UdcSelector,
) -> Self
pub const fn new_with_udc( class_hash: Felt, account: A, udc: UdcSelector, ) -> Self
Constructs a new ContractFactory
with a custom Universal Deployer Contract instance.
Source§impl<A> ContractFactory<A>where
A: Account,
impl<A> ContractFactory<A>where
A: Account,
Sourcepub const fn deploy_v3(
&self,
constructor_calldata: Vec<Felt>,
salt: Felt,
unique: bool,
) -> DeploymentV3<'_, A>
pub const fn deploy_v3( &self, constructor_calldata: Vec<Felt>, salt: Felt, unique: bool, ) -> DeploymentV3<'_, A>
Generates an instance of DeploymentV3
for sending INVOKE
v3 transactions for the
contract deployment. Pays transaction fees in STRK
.
Sourcepub const fn deploy(
&self,
constructor_calldata: Vec<Felt>,
salt: Felt,
unique: bool,
) -> DeploymentV3<'_, A>
👎Deprecated: transaction version used might change unexpectedly; use deploy_v3
instead
pub const fn deploy( &self, constructor_calldata: Vec<Felt>, salt: Felt, unique: bool, ) -> DeploymentV3<'_, A>
deploy_v3
insteadGenerates an instance of DeploymentV3
for sending INVOKE
v3 transactions for the
contract deployment. Pays transaction fees in STRK
.
Trait Implementations§
Auto Trait Implementations§
impl<A> Freeze for ContractFactory<A>where
A: Freeze,
impl<A> RefUnwindSafe for ContractFactory<A>where
A: RefUnwindSafe,
impl<A> Send for ContractFactory<A>where
A: Send,
impl<A> Sync for ContractFactory<A>where
A: Sync,
impl<A> Unpin for ContractFactory<A>where
A: Unpin,
impl<A> UnwindSafe for ContractFactory<A>where
A: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more