pub struct Builder<T: Transport> { /* private fields */ }
Expand description
A configuration builder for contract deployment.
Implementations§
Source§impl<T: Transport> Builder<T>
impl<T: Transport> Builder<T>
Sourcepub fn confirmations(self, confirmations: usize) -> Self
pub fn confirmations(self, confirmations: usize) -> Self
Number of confirmations required after code deployment.
Sourcepub fn poll_interval(self, interval: Duration) -> Self
pub fn poll_interval(self, interval: Duration) -> Self
Confirmations poll interval.
Sourcepub async fn execute<P, V>(
self,
code: V,
params: P,
from: Address,
) -> Result<Contract<T>, Error>
pub async fn execute<P, V>( self, code: V, params: P, from: Address, ) -> Result<Contract<T>, Error>
Execute deployment passing code and contructor parameters.
Sourcepub async fn sign_and_execute<P, V>(
self,
code: V,
params: P,
from: Address,
password: &str,
) -> Result<Contract<T>, Error>
pub async fn sign_and_execute<P, V>( self, code: V, params: P, from: Address, password: &str, ) -> Result<Contract<T>, Error>
Execute deployment passing code and constructor parameters.
Unlike the above execute
, this method uses
sign_raw_transaction_with_confirmation
instead of
sign_transaction_with_confirmation
, which requires the account from
which the transaction is sent to be unlocked.
Sourcepub async fn sign_with_key_and_execute<P, V, K>(
self,
code: V,
params: P,
from: K,
chain_id: Option<u64>,
) -> Result<Contract<T>, Error>
pub async fn sign_with_key_and_execute<P, V, K>( self, code: V, params: P, from: K, chain_id: Option<u64>, ) -> Result<Contract<T>, Error>
Execute deployment passing code and constructor parameters.
Unlike the above sign_and_execute
, this method allows the
caller to pass in a private key to sign the transaction with
and therefore allows deploying from an account that the
ethereum node doesn’t need to know the private key for.
An optional chain_id
parameter can be passed to provide
replay protection for transaction signatures. Passing None
would create a transaction WITHOUT replay protection and
should be avoided.
You can obtain chain_id
of the network you are connected
to using web3.eth().chain_id()
method.