Struct zenith_types::Zenith::ZenithInstance
source · pub struct ZenithInstance<T, P, N = Ethereum> { /* private fields */ }Expand description
A Zenith instance.
Contains type-safe methods for interacting with an on-chain instance of the
Zenith 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<T: Transport + Clone, P: Provider<T, N>, N: Network> ZenithInstance<T, P, N>
impl<T: Transport + Clone, P: Provider<T, N>, N: Network> ZenithInstance<T, 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 Zenith contract instance.
See the wrapper’s documentation for more details.
sourcepub fn set_address(&mut self, address: Address)
pub fn set_address(&mut self, address: Address)
Sets the address.
source§impl<T, P: Clone, N> ZenithInstance<T, &P, N>
impl<T, P: Clone, N> ZenithInstance<T, &P, N>
sourcepub fn with_cloned_provider(self) -> ZenithInstance<T, P, N>
pub fn with_cloned_provider(self) -> ZenithInstance<T, P, N>
Clones the provider and returns a new instance with the cloned provider.
source§impl<T: Transport + Clone, P: Provider<T, N>, N: Network> ZenithInstance<T, P, N>
impl<T: Transport + Clone, P: Provider<T, N>, N: Network> ZenithInstance<T, P, N>
Function calls.
sourcepub fn call_builder<C: SolCall>(&self, call: &C) -> SolCallBuilder<T, &P, C, N>
pub fn call_builder<C: SolCall>(&self, call: &C) -> SolCallBuilder<T, &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 addSequencer(
&self,
sequencer: Address,
) -> SolCallBuilder<T, &P, addSequencerCall, N>
pub fn addSequencer( &self, sequencer: Address, ) -> SolCallBuilder<T, &P, addSequencerCall, N>
Creates a new call builder for the [addSequencer] function.
sourcepub fn blockCommitment(
&self,
header: <BlockHeader as SolType>::RustType,
) -> SolCallBuilder<T, &P, blockCommitmentCall, N>
pub fn blockCommitment( &self, header: <BlockHeader as SolType>::RustType, ) -> SolCallBuilder<T, &P, blockCommitmentCall, N>
Creates a new call builder for the [blockCommitment] function.
sourcepub fn defaultRollupChainId(
&self,
) -> SolCallBuilder<T, &P, defaultRollupChainIdCall, N>
pub fn defaultRollupChainId( &self, ) -> SolCallBuilder<T, &P, defaultRollupChainIdCall, N>
Creates a new call builder for the [defaultRollupChainId] function.
sourcepub fn enter_0(
&self,
rollupRecipient: Address,
) -> SolCallBuilder<T, &P, enter_0Call, N>
pub fn enter_0( &self, rollupRecipient: Address, ) -> SolCallBuilder<T, &P, enter_0Call, N>
Creates a new call builder for the [enter_0] function.
sourcepub fn enter_1(
&self,
rollupChainId: U256,
rollupRecipient: Address,
) -> SolCallBuilder<T, &P, enter_1Call, N>
pub fn enter_1( &self, rollupChainId: U256, rollupRecipient: Address, ) -> SolCallBuilder<T, &P, enter_1Call, N>
Creates a new call builder for the [enter_1] function.
sourcepub fn enterTransact(
&self,
rollupChainId: U256,
etherRecipient: Address,
to: Address,
data: Bytes,
value: U256,
gas: U256,
maxFeePerGas: U256,
) -> SolCallBuilder<T, &P, enterTransactCall, N>
pub fn enterTransact( &self, rollupChainId: U256, etherRecipient: Address, to: Address, data: Bytes, value: U256, gas: U256, maxFeePerGas: U256, ) -> SolCallBuilder<T, &P, enterTransactCall, N>
Creates a new call builder for the [enterTransact] function.
sourcepub fn isSequencer(
&self,
_0: Address,
) -> SolCallBuilder<T, &P, isSequencerCall, N>
pub fn isSequencer( &self, _0: Address, ) -> SolCallBuilder<T, &P, isSequencerCall, N>
Creates a new call builder for the [isSequencer] function.
sourcepub fn lastSubmittedAtBlock(
&self,
_0: U256,
) -> SolCallBuilder<T, &P, lastSubmittedAtBlockCall, N>
pub fn lastSubmittedAtBlock( &self, _0: U256, ) -> SolCallBuilder<T, &P, lastSubmittedAtBlockCall, N>
Creates a new call builder for the [lastSubmittedAtBlock] function.
sourcepub fn nextSequence(
&self,
_rollupChainId: U256,
) -> SolCallBuilder<T, &P, nextSequenceCall, N>
pub fn nextSequence( &self, _rollupChainId: U256, ) -> SolCallBuilder<T, &P, nextSequenceCall, N>
Creates a new call builder for the [nextSequence] function.
sourcepub fn removeSequencer(
&self,
sequencer: Address,
) -> SolCallBuilder<T, &P, removeSequencerCall, N>
pub fn removeSequencer( &self, sequencer: Address, ) -> SolCallBuilder<T, &P, removeSequencerCall, N>
Creates a new call builder for the [removeSequencer] function.
sourcepub fn sequencerAdmin(&self) -> SolCallBuilder<T, &P, sequencerAdminCall, N>
pub fn sequencerAdmin(&self) -> SolCallBuilder<T, &P, sequencerAdminCall, N>
Creates a new call builder for the [sequencerAdmin] function.
sourcepub fn submitBlock(
&self,
header: <BlockHeader as SolType>::RustType,
v: u8,
r: FixedBytes<32>,
s: FixedBytes<32>,
_4: Bytes,
) -> SolCallBuilder<T, &P, submitBlockCall, N>
pub fn submitBlock( &self, header: <BlockHeader as SolType>::RustType, v: u8, r: FixedBytes<32>, s: FixedBytes<32>, _4: Bytes, ) -> SolCallBuilder<T, &P, submitBlockCall, N>
Creates a new call builder for the [submitBlock] function.
sourcepub fn transact_0(
&self,
to: Address,
data: Bytes,
value: U256,
gas: U256,
maxFeePerGas: U256,
) -> SolCallBuilder<T, &P, transact_0Call, N>
pub fn transact_0( &self, to: Address, data: Bytes, value: U256, gas: U256, maxFeePerGas: U256, ) -> SolCallBuilder<T, &P, transact_0Call, N>
Creates a new call builder for the [transact_0] function.
sourcepub fn transact_1(
&self,
rollupChainId: U256,
to: Address,
data: Bytes,
value: U256,
gas: U256,
maxFeePerGas: U256,
) -> SolCallBuilder<T, &P, transact_1Call, N>
pub fn transact_1( &self, rollupChainId: U256, to: Address, data: Bytes, value: U256, gas: U256, maxFeePerGas: U256, ) -> SolCallBuilder<T, &P, transact_1Call, N>
Creates a new call builder for the [transact_1] function.
sourcepub fn withdraw(
&self,
token: Address,
recipient: Address,
amount: U256,
) -> SolCallBuilder<T, &P, withdrawCall, N>
pub fn withdraw( &self, token: Address, recipient: Address, amount: U256, ) -> SolCallBuilder<T, &P, withdrawCall, N>
Creates a new call builder for the [withdraw] function.
sourcepub fn withdrawalAdmin(&self) -> SolCallBuilder<T, &P, withdrawalAdminCall, N>
pub fn withdrawalAdmin(&self) -> SolCallBuilder<T, &P, withdrawalAdminCall, N>
Creates a new call builder for the [withdrawalAdmin] function.
source§impl<T: Transport + Clone, P: Provider<T, N>, N: Network> ZenithInstance<T, P, N>
impl<T: Transport + Clone, P: Provider<T, N>, N: Network> ZenithInstance<T, P, N>
Event filters.
sourcepub fn event_filter<E: SolEvent>(&self) -> Event<T, &P, E, N>
pub fn event_filter<E: SolEvent>(&self) -> Event<T, &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 BlockSubmitted_filter(&self) -> Event<T, &P, BlockSubmitted, N>
pub fn BlockSubmitted_filter(&self) -> Event<T, &P, BlockSubmitted, N>
Creates a new event filter for the BlockSubmitted event.
sourcepub fn Enter_filter(&self) -> Event<T, &P, Enter, N>
pub fn Enter_filter(&self) -> Event<T, &P, Enter, N>
Creates a new event filter for the Enter event.
sourcepub fn SequencerSet_filter(&self) -> Event<T, &P, SequencerSet, N>
pub fn SequencerSet_filter(&self) -> Event<T, &P, SequencerSet, N>
Creates a new event filter for the SequencerSet event.
sourcepub fn Transact_filter(&self) -> Event<T, &P, Transact, N>
pub fn Transact_filter(&self) -> Event<T, &P, Transact, N>
Creates a new event filter for the Transact event.
sourcepub fn Withdrawal_filter(&self) -> Event<T, &P, Withdrawal, N>
pub fn Withdrawal_filter(&self) -> Event<T, &P, Withdrawal, N>
Creates a new event filter for the Withdrawal event.
Trait Implementations§
Auto Trait Implementations§
impl<T, P, N> Freeze for ZenithInstance<T, P, N>where
P: Freeze,
impl<T, P, N> RefUnwindSafe for ZenithInstance<T, P, N>
impl<T, P, N> Send for ZenithInstance<T, P, N>
impl<T, P, N> Sync for ZenithInstance<T, P, N>
impl<T, P, N> Unpin for ZenithInstance<T, P, N>
impl<T, P, N> UnwindSafe for ZenithInstance<T, P, N>
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)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