pub struct ApplicationInstance<P, N = Ethereum> { /* private fields */ }Expand description
A Application instance.
Contains type-safe methods for interacting with an on-chain instance of the
Application contract located at a given address, using a given
provider P.
If the contract bytecode is available (see the sol!
documentation on how to provide it), the deploy and deploy_builder methods can
be used to deploy a new instance of the contract.
See the module-level documentation for all the available methods.
Implementations§
Source§impl<P: Provider<N>, N: Network> ApplicationInstance<P, N>
Instantiation and getters/setters.
impl<P: Provider<N>, N: Network> ApplicationInstance<P, N>
Instantiation and getters/setters.
Sourcepub const fn new(address: Address, __provider: P) -> Self
pub const fn new(address: Address, __provider: P) -> Self
Creates a new wrapper around an on-chain Application contract instance.
See the wrapper’s documentation for more details.
Sourcepub async fn deploy(
__provider: P,
outputsMerkleRootValidator: Address,
initialOwner: Address,
templateHash: FixedBytes<32>,
dataAvailability: Bytes,
) -> Result<ApplicationInstance<P, N>>
pub async fn deploy( __provider: P, outputsMerkleRootValidator: Address, initialOwner: Address, templateHash: FixedBytes<32>, dataAvailability: Bytes, ) -> Result<ApplicationInstance<P, N>>
Deploys this contract using the given provider and constructor arguments, if any.
Returns a new instance of the contract, if the deployment was successful.
For more fine-grained control over the deployment process, use deploy_builder instead.
Sourcepub fn deploy_builder(
__provider: P,
outputsMerkleRootValidator: Address,
initialOwner: Address,
templateHash: FixedBytes<32>,
dataAvailability: Bytes,
) -> RawCallBuilder<P, N>
pub fn deploy_builder( __provider: P, outputsMerkleRootValidator: Address, initialOwner: Address, templateHash: FixedBytes<32>, dataAvailability: Bytes, ) -> RawCallBuilder<P, N>
Creates a RawCallBuilder for deploying this contract using the given provider
and constructor arguments, if any.
This is a simple wrapper around creating a RawCallBuilder with the data set to
the bytecode concatenated with the constructor’s ABI-encoded arguments.
Sourcepub fn set_address(&mut self, address: Address)
pub fn set_address(&mut self, address: Address)
Sets the address.
Source§impl<P: Clone, N> ApplicationInstance<&P, N>
impl<P: Clone, N> ApplicationInstance<&P, N>
Sourcepub fn with_cloned_provider(self) -> ApplicationInstance<P, N>
pub fn with_cloned_provider(self) -> ApplicationInstance<P, N>
Clones the provider and returns a new instance with the cloned provider.
Source§impl<P: Provider<N>, N: Network> ApplicationInstance<P, N>
Function calls.
impl<P: Provider<N>, N: Network> ApplicationInstance<P, N>
Function calls.
Sourcepub fn call_builder<C: SolCall>(&self, call: &C) -> SolCallBuilder<&P, C, N>
pub fn call_builder<C: SolCall>(&self, call: &C) -> SolCallBuilder<&P, C, N>
Creates a new call builder using this contract instance’s provider and address.
Note that the call can be any function call, not just those defined in this contract. Prefer using the other methods for building type-safe contract calls.
Sourcepub fn executeOutput(
&self,
output: Bytes,
proof: <OutputValidityProof as SolType>::RustType,
) -> SolCallBuilder<&P, executeOutputCall, N>
pub fn executeOutput( &self, output: Bytes, proof: <OutputValidityProof as SolType>::RustType, ) -> SolCallBuilder<&P, executeOutputCall, N>
Creates a new call builder for the [executeOutput] function.
Sourcepub fn getDataAvailability(
&self,
) -> SolCallBuilder<&P, getDataAvailabilityCall, N>
pub fn getDataAvailability( &self, ) -> SolCallBuilder<&P, getDataAvailabilityCall, N>
Creates a new call builder for the [getDataAvailability] function.
Sourcepub fn getDeploymentBlockNumber(
&self,
) -> SolCallBuilder<&P, getDeploymentBlockNumberCall, N>
pub fn getDeploymentBlockNumber( &self, ) -> SolCallBuilder<&P, getDeploymentBlockNumberCall, N>
Creates a new call builder for the [getDeploymentBlockNumber] function.
Sourcepub fn getNumberOfExecutedOutputs(
&self,
) -> SolCallBuilder<&P, getNumberOfExecutedOutputsCall, N>
pub fn getNumberOfExecutedOutputs( &self, ) -> SolCallBuilder<&P, getNumberOfExecutedOutputsCall, N>
Creates a new call builder for the [getNumberOfExecutedOutputs] function.
Sourcepub fn getOutputsMerkleRootValidator(
&self,
) -> SolCallBuilder<&P, getOutputsMerkleRootValidatorCall, N>
pub fn getOutputsMerkleRootValidator( &self, ) -> SolCallBuilder<&P, getOutputsMerkleRootValidatorCall, N>
Creates a new call builder for the [getOutputsMerkleRootValidator] function.
Sourcepub fn getTemplateHash(&self) -> SolCallBuilder<&P, getTemplateHashCall, N>
pub fn getTemplateHash(&self) -> SolCallBuilder<&P, getTemplateHashCall, N>
Creates a new call builder for the [getTemplateHash] function.
Sourcepub fn migrateToOutputsMerkleRootValidator(
&self,
newOutputsMerkleRootValidator: Address,
) -> SolCallBuilder<&P, migrateToOutputsMerkleRootValidatorCall, N>
pub fn migrateToOutputsMerkleRootValidator( &self, newOutputsMerkleRootValidator: Address, ) -> SolCallBuilder<&P, migrateToOutputsMerkleRootValidatorCall, N>
Creates a new call builder for the [migrateToOutputsMerkleRootValidator] function.
Sourcepub fn onERC1155BatchReceived(
&self,
_0: Address,
_1: Address,
_2: Vec<U256>,
_3: Vec<U256>,
_4: Bytes,
) -> SolCallBuilder<&P, onERC1155BatchReceivedCall, N>
pub fn onERC1155BatchReceived( &self, _0: Address, _1: Address, _2: Vec<U256>, _3: Vec<U256>, _4: Bytes, ) -> SolCallBuilder<&P, onERC1155BatchReceivedCall, N>
Creates a new call builder for the [onERC1155BatchReceived] function.
Sourcepub fn onERC1155Received(
&self,
_0: Address,
_1: Address,
_2: U256,
_3: U256,
_4: Bytes,
) -> SolCallBuilder<&P, onERC1155ReceivedCall, N>
pub fn onERC1155Received( &self, _0: Address, _1: Address, _2: U256, _3: U256, _4: Bytes, ) -> SolCallBuilder<&P, onERC1155ReceivedCall, N>
Creates a new call builder for the [onERC1155Received] function.
Sourcepub fn onERC721Received(
&self,
_0: Address,
_1: Address,
_2: U256,
_3: Bytes,
) -> SolCallBuilder<&P, onERC721ReceivedCall, N>
pub fn onERC721Received( &self, _0: Address, _1: Address, _2: U256, _3: Bytes, ) -> SolCallBuilder<&P, onERC721ReceivedCall, N>
Creates a new call builder for the [onERC721Received] function.
Sourcepub fn owner(&self) -> SolCallBuilder<&P, ownerCall, N>
pub fn owner(&self) -> SolCallBuilder<&P, ownerCall, N>
Creates a new call builder for the [owner] function.
Sourcepub fn renounceOwnership(&self) -> SolCallBuilder<&P, renounceOwnershipCall, N>
pub fn renounceOwnership(&self) -> SolCallBuilder<&P, renounceOwnershipCall, N>
Creates a new call builder for the [renounceOwnership] function.
Sourcepub fn supportsInterface(
&self,
interfaceId: FixedBytes<4>,
) -> SolCallBuilder<&P, supportsInterfaceCall, N>
pub fn supportsInterface( &self, interfaceId: FixedBytes<4>, ) -> SolCallBuilder<&P, supportsInterfaceCall, N>
Creates a new call builder for the [supportsInterface] function.
Sourcepub fn transferOwnership(
&self,
newOwner: Address,
) -> SolCallBuilder<&P, transferOwnershipCall, N>
pub fn transferOwnership( &self, newOwner: Address, ) -> SolCallBuilder<&P, transferOwnershipCall, N>
Creates a new call builder for the [transferOwnership] function.
Sourcepub fn validateOutput(
&self,
output: Bytes,
proof: <OutputValidityProof as SolType>::RustType,
) -> SolCallBuilder<&P, validateOutputCall, N>
pub fn validateOutput( &self, output: Bytes, proof: <OutputValidityProof as SolType>::RustType, ) -> SolCallBuilder<&P, validateOutputCall, N>
Creates a new call builder for the [validateOutput] function.
Sourcepub fn validateOutputHash(
&self,
outputHash: FixedBytes<32>,
proof: <OutputValidityProof as SolType>::RustType,
) -> SolCallBuilder<&P, validateOutputHashCall, N>
pub fn validateOutputHash( &self, outputHash: FixedBytes<32>, proof: <OutputValidityProof as SolType>::RustType, ) -> SolCallBuilder<&P, validateOutputHashCall, N>
Creates a new call builder for the [validateOutputHash] function.
Sourcepub fn wasOutputExecuted(
&self,
outputIndex: U256,
) -> SolCallBuilder<&P, wasOutputExecutedCall, N>
pub fn wasOutputExecuted( &self, outputIndex: U256, ) -> SolCallBuilder<&P, wasOutputExecutedCall, N>
Creates a new call builder for the [wasOutputExecuted] function.
Source§impl<P: Provider<N>, N: Network> ApplicationInstance<P, N>
Event filters.
impl<P: Provider<N>, N: Network> ApplicationInstance<P, N>
Event filters.
Sourcepub fn event_filter<E: SolEvent>(&self) -> Event<&P, E, N>
pub fn event_filter<E: SolEvent>(&self) -> Event<&P, E, N>
Creates a new event filter using this contract instance’s provider and address.
Note that the type can be any event, not just those defined in this contract. Prefer using the other methods for building type-safe event filters.
Sourcepub fn OutputExecuted_filter(&self) -> Event<&P, OutputExecuted, N>
pub fn OutputExecuted_filter(&self) -> Event<&P, OutputExecuted, N>
Creates a new event filter for the OutputExecuted event.
Sourcepub fn OutputsMerkleRootValidatorChanged_filter(
&self,
) -> Event<&P, OutputsMerkleRootValidatorChanged, N>
pub fn OutputsMerkleRootValidatorChanged_filter( &self, ) -> Event<&P, OutputsMerkleRootValidatorChanged, N>
Creates a new event filter for the OutputsMerkleRootValidatorChanged event.
Sourcepub fn OwnershipTransferred_filter(&self) -> Event<&P, OwnershipTransferred, N>
pub fn OwnershipTransferred_filter(&self) -> Event<&P, OwnershipTransferred, N>
Creates a new event filter for the OwnershipTransferred event.
Trait Implementations§
Source§impl<P: Clone, N: Clone> Clone for ApplicationInstance<P, N>
impl<P: Clone, N: Clone> Clone for ApplicationInstance<P, N>
Source§fn clone(&self) -> ApplicationInstance<P, N>
fn clone(&self) -> ApplicationInstance<P, N>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<P, N> Freeze for ApplicationInstance<P, N>where
P: Freeze,
impl<P, N> RefUnwindSafe for ApplicationInstance<P, N>where
P: RefUnwindSafe,
N: RefUnwindSafe,
impl<P, N> Send for ApplicationInstance<P, N>
impl<P, N> Sync for ApplicationInstance<P, N>
impl<P, N> Unpin for ApplicationInstance<P, N>
impl<P, N> UnwindSafe for ApplicationInstance<P, N>where
P: UnwindSafe,
N: 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more