pub struct ISlasherInstance<T, P, N = Ethereum> { /* private fields */ }
Expand description
A ISlasher
instance.
Contains type-safe methods for interacting with an on-chain instance of the
ISlasher
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> ISlasherInstance<T, P, N>
impl<T: Transport + Clone, P: Provider<T, N>, N: Network> ISlasherInstance<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 ISlasher
contract instance.
See the wrapper’s documentation for more details.
sourcepub async fn deploy(provider: P) -> Result<ISlasherInstance<T, P, N>>
pub async fn deploy(provider: P) -> Result<ISlasherInstance<T, 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) -> RawCallBuilder<T, P, N>
pub fn deploy_builder(provider: P) -> RawCallBuilder<T, 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<T, P: Clone, N> ISlasherInstance<T, &P, N>
impl<T, P: Clone, N> ISlasherInstance<T, &P, N>
sourcepub fn with_cloned_provider(self) -> ISlasherInstance<T, P, N>
pub fn with_cloned_provider(self) -> ISlasherInstance<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> ISlasherInstance<T, P, N>
impl<T: Transport + Clone, P: Provider<T, N>, N: Network> ISlasherInstance<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 canSlash(
&self,
toBeSlashed: Address,
slashingContract: Address,
) -> SolCallBuilder<T, &P, canSlashCall, N>
pub fn canSlash( &self, toBeSlashed: Address, slashingContract: Address, ) -> SolCallBuilder<T, &P, canSlashCall, N>
Creates a new call builder for the [canSlash
] function.
sourcepub fn canWithdraw(
&self,
operator: Address,
withdrawalStartBlock: u32,
middlewareTimesIndex: U256,
) -> SolCallBuilder<T, &P, canWithdrawCall, N>
pub fn canWithdraw( &self, operator: Address, withdrawalStartBlock: u32, middlewareTimesIndex: U256, ) -> SolCallBuilder<T, &P, canWithdrawCall, N>
Creates a new call builder for the [canWithdraw
] function.
sourcepub fn contractCanSlashOperatorUntilBlock(
&self,
operator: Address,
serviceContract: Address,
) -> SolCallBuilder<T, &P, contractCanSlashOperatorUntilBlockCall, N>
pub fn contractCanSlashOperatorUntilBlock( &self, operator: Address, serviceContract: Address, ) -> SolCallBuilder<T, &P, contractCanSlashOperatorUntilBlockCall, N>
Creates a new call builder for the [contractCanSlashOperatorUntilBlock
] function.
sourcepub fn delegation(&self) -> SolCallBuilder<T, &P, delegationCall, N>
pub fn delegation(&self) -> SolCallBuilder<T, &P, delegationCall, N>
Creates a new call builder for the [delegation
] function.
sourcepub fn freezeOperator(
&self,
toBeFrozen: Address,
) -> SolCallBuilder<T, &P, freezeOperatorCall, N>
pub fn freezeOperator( &self, toBeFrozen: Address, ) -> SolCallBuilder<T, &P, freezeOperatorCall, N>
Creates a new call builder for the [freezeOperator
] function.
sourcepub fn getCorrectValueForInsertAfter(
&self,
operator: Address,
updateBlock: u32,
) -> SolCallBuilder<T, &P, getCorrectValueForInsertAfterCall, N>
pub fn getCorrectValueForInsertAfter( &self, operator: Address, updateBlock: u32, ) -> SolCallBuilder<T, &P, getCorrectValueForInsertAfterCall, N>
Creates a new call builder for the [getCorrectValueForInsertAfter
] function.
sourcepub fn getMiddlewareTimesIndexServeUntilBlock(
&self,
operator: Address,
index: u32,
) -> SolCallBuilder<T, &P, getMiddlewareTimesIndexServeUntilBlockCall, N>
pub fn getMiddlewareTimesIndexServeUntilBlock( &self, operator: Address, index: u32, ) -> SolCallBuilder<T, &P, getMiddlewareTimesIndexServeUntilBlockCall, N>
Creates a new call builder for the [getMiddlewareTimesIndexServeUntilBlock
] function.
sourcepub fn getMiddlewareTimesIndexStalestUpdateBlock(
&self,
operator: Address,
index: u32,
) -> SolCallBuilder<T, &P, getMiddlewareTimesIndexStalestUpdateBlockCall, N>
pub fn getMiddlewareTimesIndexStalestUpdateBlock( &self, operator: Address, index: u32, ) -> SolCallBuilder<T, &P, getMiddlewareTimesIndexStalestUpdateBlockCall, N>
Creates a new call builder for the [getMiddlewareTimesIndexStalestUpdateBlock
] function.
sourcepub fn isFrozen(
&self,
staker: Address,
) -> SolCallBuilder<T, &P, isFrozenCall, N>
pub fn isFrozen( &self, staker: Address, ) -> SolCallBuilder<T, &P, isFrozenCall, N>
Creates a new call builder for the [isFrozen
] function.
sourcepub fn latestUpdateBlock(
&self,
operator: Address,
serviceContract: Address,
) -> SolCallBuilder<T, &P, latestUpdateBlockCall, N>
pub fn latestUpdateBlock( &self, operator: Address, serviceContract: Address, ) -> SolCallBuilder<T, &P, latestUpdateBlockCall, N>
Creates a new call builder for the [latestUpdateBlock
] function.
sourcepub fn middlewareTimesLength(
&self,
operator: Address,
) -> SolCallBuilder<T, &P, middlewareTimesLengthCall, N>
pub fn middlewareTimesLength( &self, operator: Address, ) -> SolCallBuilder<T, &P, middlewareTimesLengthCall, N>
Creates a new call builder for the [middlewareTimesLength
] function.
sourcepub fn operatorToMiddlewareTimes(
&self,
operator: Address,
arrayIndex: U256,
) -> SolCallBuilder<T, &P, operatorToMiddlewareTimesCall, N>
pub fn operatorToMiddlewareTimes( &self, operator: Address, arrayIndex: U256, ) -> SolCallBuilder<T, &P, operatorToMiddlewareTimesCall, N>
Creates a new call builder for the [operatorToMiddlewareTimes
] function.
sourcepub fn operatorWhitelistedContractsLinkedListEntry(
&self,
operator: Address,
node: Address,
) -> SolCallBuilder<T, &P, operatorWhitelistedContractsLinkedListEntryCall, N>
pub fn operatorWhitelistedContractsLinkedListEntry( &self, operator: Address, node: Address, ) -> SolCallBuilder<T, &P, operatorWhitelistedContractsLinkedListEntryCall, N>
Creates a new call builder for the [operatorWhitelistedContractsLinkedListEntry
] function.
sourcepub fn operatorWhitelistedContractsLinkedListSize(
&self,
operator: Address,
) -> SolCallBuilder<T, &P, operatorWhitelistedContractsLinkedListSizeCall, N>
pub fn operatorWhitelistedContractsLinkedListSize( &self, operator: Address, ) -> SolCallBuilder<T, &P, operatorWhitelistedContractsLinkedListSizeCall, N>
Creates a new call builder for the [operatorWhitelistedContractsLinkedListSize
] function.
sourcepub fn optIntoSlashing(
&self,
contractAddress: Address,
) -> SolCallBuilder<T, &P, optIntoSlashingCall, N>
pub fn optIntoSlashing( &self, contractAddress: Address, ) -> SolCallBuilder<T, &P, optIntoSlashingCall, N>
Creates a new call builder for the [optIntoSlashing
] function.
sourcepub fn recordFirstStakeUpdate(
&self,
operator: Address,
serveUntilBlock: u32,
) -> SolCallBuilder<T, &P, recordFirstStakeUpdateCall, N>
pub fn recordFirstStakeUpdate( &self, operator: Address, serveUntilBlock: u32, ) -> SolCallBuilder<T, &P, recordFirstStakeUpdateCall, N>
Creates a new call builder for the [recordFirstStakeUpdate
] function.
sourcepub fn recordLastStakeUpdateAndRevokeSlashingAbility(
&self,
operator: Address,
serveUntilBlock: u32,
) -> SolCallBuilder<T, &P, recordLastStakeUpdateAndRevokeSlashingAbilityCall, N>
pub fn recordLastStakeUpdateAndRevokeSlashingAbility( &self, operator: Address, serveUntilBlock: u32, ) -> SolCallBuilder<T, &P, recordLastStakeUpdateAndRevokeSlashingAbilityCall, N>
Creates a new call builder for the [recordLastStakeUpdateAndRevokeSlashingAbility
] function.
sourcepub fn recordStakeUpdate(
&self,
operator: Address,
updateBlock: u32,
serveUntilBlock: u32,
insertAfter: U256,
) -> SolCallBuilder<T, &P, recordStakeUpdateCall, N>
pub fn recordStakeUpdate( &self, operator: Address, updateBlock: u32, serveUntilBlock: u32, insertAfter: U256, ) -> SolCallBuilder<T, &P, recordStakeUpdateCall, N>
Creates a new call builder for the [recordStakeUpdate
] function.
sourcepub fn resetFrozenStatus(
&self,
frozenAddresses: Vec<Address>,
) -> SolCallBuilder<T, &P, resetFrozenStatusCall, N>
pub fn resetFrozenStatus( &self, frozenAddresses: Vec<Address>, ) -> SolCallBuilder<T, &P, resetFrozenStatusCall, N>
Creates a new call builder for the [resetFrozenStatus
] function.
sourcepub fn strategyManager(&self) -> SolCallBuilder<T, &P, strategyManagerCall, N>
pub fn strategyManager(&self) -> SolCallBuilder<T, &P, strategyManagerCall, N>
Creates a new call builder for the [strategyManager
] function.
source§impl<T: Transport + Clone, P: Provider<T, N>, N: Network> ISlasherInstance<T, P, N>
impl<T: Transport + Clone, P: Provider<T, N>, N: Network> ISlasherInstance<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 FrozenStatusReset_filter(&self) -> Event<T, &P, FrozenStatusReset, N>
pub fn FrozenStatusReset_filter(&self) -> Event<T, &P, FrozenStatusReset, N>
Creates a new event filter for the FrozenStatusReset
event.
sourcepub fn MiddlewareTimesAdded_filter(
&self,
) -> Event<T, &P, MiddlewareTimesAdded, N>
pub fn MiddlewareTimesAdded_filter( &self, ) -> Event<T, &P, MiddlewareTimesAdded, N>
Creates a new event filter for the MiddlewareTimesAdded
event.
sourcepub fn OperatorFrozen_filter(&self) -> Event<T, &P, OperatorFrozen, N>
pub fn OperatorFrozen_filter(&self) -> Event<T, &P, OperatorFrozen, N>
Creates a new event filter for the OperatorFrozen
event.
sourcepub fn OptedIntoSlashing_filter(&self) -> Event<T, &P, OptedIntoSlashing, N>
pub fn OptedIntoSlashing_filter(&self) -> Event<T, &P, OptedIntoSlashing, N>
Creates a new event filter for the OptedIntoSlashing
event.
sourcepub fn SlashingAbilityRevoked_filter(
&self,
) -> Event<T, &P, SlashingAbilityRevoked, N>
pub fn SlashingAbilityRevoked_filter( &self, ) -> Event<T, &P, SlashingAbilityRevoked, N>
Creates a new event filter for the SlashingAbilityRevoked
event.
Trait Implementations§
Auto Trait Implementations§
impl<T, P, N> Freeze for ISlasherInstance<T, P, N>where
P: Freeze,
impl<T, P, N> RefUnwindSafe for ISlasherInstance<T, P, N>
impl<T, P, N> Send for ISlasherInstance<T, P, N>
impl<T, P, N> Sync for ISlasherInstance<T, P, N>
impl<T, P, N> Unpin for ISlasherInstance<T, P, N>
impl<T, P, N> UnwindSafe for ISlasherInstance<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§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