pub trait StakingModule: ContractBase + Sized {
Show 17 methods
// Required methods
fn staking_token(
&self,
) -> SingleValueMapper<Self::Api, EgldOrEsdtTokenIdentifier<Self::Api>>;
fn required_stake_amount(
&self,
) -> SingleValueMapper<Self::Api, BigUint<Self::Api>>;
fn user_whitelist(
&self,
) -> UnorderedSetMapper<Self::Api, ManagedAddress<Self::Api>>;
fn staked_amount(
&self,
user: &ManagedAddress<Self::Api>,
) -> SingleValueMapper<Self::Api, BigUint<Self::Api>>;
fn slashing_proposal_voters(
&self,
slash_address: &ManagedAddress<Self::Api>,
) -> UnorderedSetMapper<Self::Api, ManagedAddress<Self::Api>>;
fn slash_quorum(&self) -> SingleValueMapper<Self::Api, usize>;
fn slash_amount(&self) -> SingleValueMapper<Self::Api, BigUint<Self::Api>>;
fn total_slashed_amount(
&self,
) -> SingleValueMapper<Self::Api, BigUint<Self::Api>>;
// Provided methods
fn init_staking_module(
&self,
staking_token: &EgldOrEsdtTokenIdentifier<Self::Api>,
staking_amount: &BigUint<Self::Api>,
slash_amount: &BigUint<Self::Api>,
slash_quorum: usize,
user_whitelist: &ManagedVec<Self::Api, ManagedAddress<Self::Api>>,
) { ... }
fn stake(&self) { ... }
fn unstake(&self, unstake_amount: BigUint<Self::Api>) { ... }
fn vote_slash_member(&self, member_to_slash: ManagedAddress<Self::Api>) { ... }
fn cancel_vote_slash_member(
&self,
member_to_slash: ManagedAddress<Self::Api>,
) { ... }
fn slash_member(&self, member_to_slash: ManagedAddress<Self::Api>) { ... }
fn is_staked_board_member(&self, user: &ManagedAddress<Self::Api>) -> bool { ... }
fn add_board_member(&self, user: ManagedAddress<Self::Api>) { ... }
fn remove_board_member(&self, user: &ManagedAddress<Self::Api>) { ... }
}
Required Methods§
fn staking_token( &self, ) -> SingleValueMapper<Self::Api, EgldOrEsdtTokenIdentifier<Self::Api>>
fn required_stake_amount( &self, ) -> SingleValueMapper<Self::Api, BigUint<Self::Api>>
fn user_whitelist( &self, ) -> UnorderedSetMapper<Self::Api, ManagedAddress<Self::Api>>
fn staked_amount( &self, user: &ManagedAddress<Self::Api>, ) -> SingleValueMapper<Self::Api, BigUint<Self::Api>>
fn slashing_proposal_voters( &self, slash_address: &ManagedAddress<Self::Api>, ) -> UnorderedSetMapper<Self::Api, ManagedAddress<Self::Api>>
fn slash_quorum(&self) -> SingleValueMapper<Self::Api, usize>
fn slash_amount(&self) -> SingleValueMapper<Self::Api, BigUint<Self::Api>>
fn total_slashed_amount( &self, ) -> SingleValueMapper<Self::Api, BigUint<Self::Api>>
Provided Methods§
fn init_staking_module( &self, staking_token: &EgldOrEsdtTokenIdentifier<Self::Api>, staking_amount: &BigUint<Self::Api>, slash_amount: &BigUint<Self::Api>, slash_quorum: usize, user_whitelist: &ManagedVec<Self::Api, ManagedAddress<Self::Api>>, )
fn stake(&self)
fn unstake(&self, unstake_amount: BigUint<Self::Api>)
fn vote_slash_member(&self, member_to_slash: ManagedAddress<Self::Api>)
fn cancel_vote_slash_member(&self, member_to_slash: ManagedAddress<Self::Api>)
fn slash_member(&self, member_to_slash: ManagedAddress<Self::Api>)
fn is_staked_board_member(&self, user: &ManagedAddress<Self::Api>) -> bool
fn add_board_member(&self, user: ManagedAddress<Self::Api>)
fn remove_board_member(&self, user: &ManagedAddress<Self::Api>)
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.