[][src]Struct web3::contract::Contract

pub struct Contract<T: Transport> { /* fields omitted */ }

Ethereum Contract Interface

Implementations

impl<T: Transport> Contract<T>[src]

pub async fn signed_call_with_confirmations<'_, '_>(
    &'_ self,
    func: &'_ str,
    params: impl Tokenize,
    options: Options,
    confirmations: usize,
    key: impl Key
) -> Result<TransactionReceipt>
[src]

Execute a signed contract function and wait for confirmations

impl<T: Transport> Contract<T>[src]

pub fn deploy(eth: Eth<T>, json: &[u8]) -> Result<Builder<T>>[src]

Creates deployment builder for a contract given it's ABI in JSON.

pub fn deploy_from_truffle<S>(
    eth: Eth<T>,
    json: &[u8],
    linker: HashMap<S, Address>
) -> Result<Builder<T>> where
    S: AsRef<str> + Eq + Hash
[src]

test

impl<T: Transport> Contract<T>[src]

pub fn new(eth: Eth<T>, address: Address, abi: Contract) -> Self[src]

Creates new Contract Interface given blockchain address and ABI

pub fn from_json(eth: Eth<T>, address: Address, json: &[u8]) -> Result<Self>[src]

Creates new Contract Interface given blockchain address and JSON containing ABI

pub fn abi(&self) -> &Contract[src]

Get the underlying contract ABI.

pub fn address(&self) -> Address[src]

Returns contract address

pub async fn call<P, '_, '_>(
    &'_ self,
    func: &'_ str,
    params: P,
    from: Address,
    options: Options
) -> Result<H256> where
    P: Tokenize
[src]

Execute a contract function

pub async fn call_with_confirmations<'_, '_>(
    &'_ self,
    func: &'_ str,
    params: impl Tokenize,
    from: Address,
    options: Options,
    confirmations: usize
) -> Result<TransactionReceipt>
[src]

Execute a contract function and wait for confirmations

pub async fn estimate_gas<P, '_, '_>(
    &'_ self,
    func: &'_ str,
    params: P,
    from: Address,
    options: Options
) -> Result<U256> where
    P: Tokenize
[src]

Estimate gas required for this function call.

pub async fn query<R, A, B, P, '_, '_>(
    &'_ self,
    func: &'_ str,
    params: P,
    from: A,
    options: Options,
    block: B
) -> Result<R> where
    R: Detokenize,
    A: Into<Option<Address>>,
    B: Into<Option<BlockId>>,
    P: Tokenize
[src]

Call constant function

pub async fn events<A, B, C, R, '_, '_>(
    &'_ self,
    event: &'_ str,
    topic0: A,
    topic1: B,
    topic2: C
) -> Result<Vec<R>> where
    A: Tokenize,
    B: Tokenize,
    C: Tokenize,
    R: Detokenize
[src]

Find events matching the topics.

Trait Implementations

impl<T: Clone + Transport> Clone for Contract<T>[src]

impl<T: Debug + Transport> Debug for Contract<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Contract<T> where
    T: RefUnwindSafe

impl<T> Send for Contract<T> where
    T: Send

impl<T> Sync for Contract<T> where
    T: Sync

impl<T> Unpin for Contract<T> where
    T: Unpin

impl<T> UnwindSafe for Contract<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,