Struct dao::configuration::Configuration
source · pub struct Configuration { /* private fields */ }
Expand description
Represents the current system configuration.
Implementations§
source§impl Configuration
impl Configuration
pub fn set_bind_ballot_for_successful_voting( &mut self, bind_ballot_for_successful_voting: bool )
pub fn set_unbound_ballot_address( &mut self, unbound_ballot_address: Option<Address> )
pub fn set_is_bid_escrow(&mut self, is_bid_escrow: bool)
pub fn set_only_va_can_create(&mut self, only_va_can_create: bool)
pub fn set_contract_calls(&mut self, contract_calls: Vec<ContractCall>)
sourcepub fn should_bind_ballot_for_successful_voting(&self) -> bool
pub fn should_bind_ballot_for_successful_voting(&self) -> bool
Indicates if the creator ballot should be bounded at the voting ends.
sourcepub fn get_unbound_ballot_address(&self) -> Option<Address>
pub fn get_unbound_ballot_address(&self) -> Option<Address>
Gets the address of the user who cast an unbound ballot.
pub fn new( dao_configuration: DaoConfiguration, voting_configuration: VotingConfiguration, total_onboarded: Balance ) -> Configuration
pub fn set_fiat_rate(&mut self, fiat_rate: Option<Balance>)
sourcepub fn bind_ballot_for_successful_voting(&mut self, address: Address)
pub fn bind_ballot_for_successful_voting(&mut self, address: Address)
Sets the flag bind_ballot_for_successful_voting
and the address of the voter.
sourcepub fn double_time_between_votings(&mut self)
pub fn double_time_between_votings(&mut self)
Sets the flag double_time_between_votings
. See Self::should_double_time_between_votings().
sourcepub fn should_double_time_between_votings(&self) -> bool
pub fn should_double_time_between_votings(&self) -> bool
Indicates if the time between informal and formal voting should be doubled.
See Variable Repository TimeBetweenInformalAndFormalVoting (available keys).
sourcepub fn fiat_conversion_rate_address(&self) -> Address
pub fn fiat_conversion_rate_address(&self) -> Address
Gets the address of the contract holding the current fiat conversion rate.
See Variable Repository FiatConversionRateAddress (available keys).
sourcepub fn formal_voting_quorum(&self) -> u32
pub fn formal_voting_quorum(&self) -> u32
Gets formal voting quorum.
See Variable Repository BidEscrowFormalQuorumRatio/FormalQuorumRatio (available keys).
sourcepub fn informal_voting_quorum(&self) -> u32
pub fn informal_voting_quorum(&self) -> u32
Gets informal voting quorum.
See Variable Repository BidEscrowInformalQuorumRatio/InformalQuorumRatio (available keys).
sourcepub fn informal_voting_time(&self) -> BlockTime
pub fn informal_voting_time(&self) -> BlockTime
Gets informal voting time.
See Variable Repository BidEscrowInformalVotingTime/InformalVotingTime (available keys).
sourcepub fn formal_voting_time(&self) -> BlockTime
pub fn formal_voting_time(&self) -> BlockTime
Gets formal voting time.
See Variable Repository BidEscrowInformalVotingTime/InformalVotingTime (available keys).
sourcepub fn informal_stake_reputation(&self) -> bool
pub fn informal_stake_reputation(&self) -> bool
Gets formal voting time.
See Variable Repository InformalStakeReputation (available keys).
sourcepub fn time_between_informal_and_formal_voting(&self) -> BlockTime
pub fn time_between_informal_and_formal_voting(&self) -> BlockTime
Gets the time between informal and formal voting.
See Variable Repository TimeBetweenInformalAndFormalVoting (available keys).
sourcepub fn bid_escrow_wallet_address(&self) -> Address
pub fn bid_escrow_wallet_address(&self) -> Address
Gets the address of a multisig wallet of the DAO.
See Variable Repository BidEscrowWalletAddress (available keys).
sourcepub fn default_reputation_slash(&self) -> Balance
pub fn default_reputation_slash(&self) -> Balance
Gets the default reputation slash ratio.
See Variable Repository DefaultReputationSlash (available keys).
sourcepub fn voting_clearness_delta(&self) -> Balance
pub fn voting_clearness_delta(&self) -> Balance
Gets the voting clearness delta.
See Variable Repository VotingClearnessDelta (available keys).
sourcepub fn voting_delay(&self) -> BlockTime
pub fn voting_delay(&self) -> BlockTime
Gets the time between voting creation and the actual voting start.
Non-BidEscrow voting always starts instantly.
See Variable Repository VotingClearnessDelta (available keys).
sourcepub fn is_post_job_dos_fee_too_low(&self, fiat_value: Balance) -> bool
pub fn is_post_job_dos_fee_too_low(&self, fiat_value: Balance) -> bool
Indicates if the attached DOS Fee is too low.
See Variable Repository PostJobDOSFee (available keys).
sourcepub fn internal_auction_time(&self) -> BlockTime
pub fn internal_auction_time(&self) -> BlockTime
Gets the time of an internal auction.
sourcepub fn public_auction_time(&self) -> BlockTime
pub fn public_auction_time(&self) -> BlockTime
Gets the time of a public auction.
sourcepub fn va_bid_acceptance_timeout(&self) -> BlockTime
pub fn va_bid_acceptance_timeout(&self) -> BlockTime
Gets the bid acceptance timeout.
See Variable Repository VABidAcceptanceTimeout (available keys).
sourcepub fn va_can_bid_on_public_auction(&self) -> bool
pub fn va_can_bid_on_public_auction(&self) -> bool
Indicates if a VA can bid on a public auction.
See Variable Repository VACanBidOnPublicAuction (available keys).
sourcepub fn distribute_payment_to_non_voters(&self) -> bool
pub fn distribute_payment_to_non_voters(&self) -> bool
Indicates if the payment for the job should be distributed between all VA’s or only to those who voted
See Variable Repository DistributePaymentToNonVoters. (available keys).
sourcepub fn total_onboarded(&self) -> Balance
pub fn total_onboarded(&self) -> Balance
Returns the number of onboarded users (VA’s).
sourcepub fn contract_calls(&self) -> &Vec<ContractCall>
pub fn contract_calls(&self) -> &Vec<ContractCall>
Returns a vec of calls to be performed once voting is finished.
sourcepub fn only_va_can_create(&self) -> bool
pub fn only_va_can_create(&self) -> bool
Indicates only a VA can create voting.
sourcepub fn is_bid_escrow(&self) -> bool
pub fn is_bid_escrow(&self) -> bool
Indicates if the voting is an instance of BidEscrow.
sourcepub fn voting_ids_address(&self) -> Address
pub fn voting_ids_address(&self) -> Address
Returns the address of the voting id generator contract.
sourcepub fn should_cast_first_vote(&self) -> bool
pub fn should_cast_first_vote(&self) -> bool
Indicates if the stake of the voting creator should be converted to a ballot.
sourcepub fn apply_default_policing_rate_to(&self, amount: Balance) -> Balance
pub fn apply_default_policing_rate_to(&self, amount: Balance) -> Balance
Applies the value of DefaultPolicingRate
variable to a given amount.
sourcepub fn apply_bid_escrow_payment_ratio_to(&self, amount: Balance) -> Balance
pub fn apply_bid_escrow_payment_ratio_to(&self, amount: Balance) -> Balance
Applies the value of BidEscrowPaymentRatio
variable to a given amount.
sourcepub fn apply_reputation_conversion_rate_to(&self, amount: Balance) -> Balance
pub fn apply_reputation_conversion_rate_to(&self, amount: Balance) -> Balance
Applies the value of ReputationConversionRate
variable to a given amount.
sourcepub fn apply_default_reputation_slash_to(&self, amount: Balance) -> Balance
pub fn apply_default_reputation_slash_to(&self, amount: Balance) -> Balance
Applies the value of DefaultReputationSlash
variable to a given amount.
sourcepub fn convert_to_fiat(&self, cspr_amount: Balance) -> Result<Balance, Error>
pub fn convert_to_fiat(&self, cspr_amount: Balance) -> Result<Balance, Error>
Calculates the value CSPRs in Fiat currency.
pub fn cancel_finished_voting_timeout(&self) -> BlockTime
Trait Implementations§
source§impl BorshDeserialize for Configuration
impl BorshDeserialize for Configuration
source§fn deserialize(buf: &mut &[u8]) -> Result<Self>
fn deserialize(buf: &mut &[u8]) -> Result<Self>
§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
source§impl BorshSerialize for Configuration
impl BorshSerialize for Configuration
source§impl Clone for Configuration
impl Clone for Configuration
source§fn clone(&self) -> Configuration
fn clone(&self) -> Configuration
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more