pub struct Configuration { /* private fields */ }
Expand description

Represents the current system configuration.

Implementations§

source§

impl Configuration

source

pub fn set_bind_ballot_for_successful_voting( &mut self, bind_ballot_for_successful_voting: bool )

source

pub fn set_unbound_ballot_address( &mut self, unbound_ballot_address: Option<Address> )

source

pub fn set_is_bid_escrow(&mut self, is_bid_escrow: bool)

source

pub fn set_only_va_can_create(&mut self, only_va_can_create: bool)

source

pub fn set_contract_calls(&mut self, contract_calls: Vec<ContractCall>)

source

pub fn should_bind_ballot_for_successful_voting(&self) -> bool

Indicates if the creator ballot should be bounded at the voting ends.

source

pub fn get_unbound_ballot_address(&self) -> Option<Address>

Gets the address of the user who cast an unbound ballot.

source

pub fn new( dao_configuration: DaoConfiguration, voting_configuration: VotingConfiguration, total_onboarded: Balance ) -> Configuration

source

pub fn set_fiat_rate(&mut self, fiat_rate: Option<Balance>)

source

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.

source

pub fn double_time_between_votings(&mut self)

Sets the flag double_time_between_votings. See Self::should_double_time_between_votings().

source

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).

source

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).

source

pub fn formal_voting_quorum(&self) -> u32

Gets formal voting quorum.

See Variable Repository BidEscrowFormalQuorumRatio/FormalQuorumRatio (available keys).

source

pub fn informal_voting_quorum(&self) -> u32

Gets informal voting quorum.

See Variable Repository BidEscrowInformalQuorumRatio/InformalQuorumRatio (available keys).

source

pub fn informal_voting_time(&self) -> BlockTime

Gets informal voting time.

See Variable Repository BidEscrowInformalVotingTime/InformalVotingTime (available keys).

source

pub fn formal_voting_time(&self) -> BlockTime

Gets formal voting time.

See Variable Repository BidEscrowInformalVotingTime/InformalVotingTime (available keys).

source

pub fn informal_stake_reputation(&self) -> bool

Gets formal voting time.

See Variable Repository InformalStakeReputation (available keys).

source

pub fn time_between_informal_and_formal_voting(&self) -> BlockTime

Gets the time between informal and formal voting.

See Variable Repository TimeBetweenInformalAndFormalVoting (available keys).

source

pub fn bid_escrow_wallet_address(&self) -> Address

Gets the address of a multisig wallet of the DAO.

See Variable Repository BidEscrowWalletAddress (available keys).

source

pub fn default_reputation_slash(&self) -> Balance

Gets the default reputation slash ratio.

See Variable Repository DefaultReputationSlash (available keys).

source

pub fn voting_clearness_delta(&self) -> Balance

Gets the voting clearness delta.

See Variable Repository VotingClearnessDelta (available keys).

source

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).

source

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).

source

pub fn internal_auction_time(&self) -> BlockTime

Gets the time of an internal auction.

source

pub fn public_auction_time(&self) -> BlockTime

Gets the time of a public auction.

source

pub fn va_bid_acceptance_timeout(&self) -> BlockTime

Gets the bid acceptance timeout.

See Variable Repository VABidAcceptanceTimeout (available keys).

source

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).

source

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).

source

pub fn total_onboarded(&self) -> Balance

Returns the number of onboarded users (VA’s).

source

pub fn contract_calls(&self) -> &Vec<ContractCall>

Returns a vec of calls to be performed once voting is finished.

source

pub fn only_va_can_create(&self) -> bool

Indicates only a VA can create voting.

source

pub fn is_bid_escrow(&self) -> bool

Indicates if the voting is an instance of BidEscrow.

source

pub fn voting_ids_address(&self) -> Address

Returns the address of the voting id generator contract.

source

pub fn should_cast_first_vote(&self) -> bool

Indicates if the stake of the voting creator should be converted to a ballot.

source

pub fn apply_default_policing_rate_to(&self, amount: Balance) -> Balance

Applies the value of DefaultPolicingRate variable to a given amount.

source

pub fn apply_bid_escrow_payment_ratio_to(&self, amount: Balance) -> Balance

Applies the value of BidEscrowPaymentRatio variable to a given amount.

source

pub fn apply_reputation_conversion_rate_to(&self, amount: Balance) -> Balance

Applies the value of ReputationConversionRate variable to a given amount.

source

pub fn apply_default_reputation_slash_to(&self, amount: Balance) -> Balance

Applies the value of DefaultReputationSlash variable to a given amount.

source

pub fn fiat_rate(&self) -> Option<Balance>

Gets the current CSPR:Fiat rate.

source

pub fn convert_to_fiat(&self, cspr_amount: Balance) -> Result<Balance, Error>

Calculates the value CSPRs in Fiat currency.

source

pub fn cancel_finished_voting_timeout(&self) -> BlockTime

Trait Implementations§

source§

impl BorshDeserialize for Configuration

source§

fn deserialize(buf: &mut &[u8]) -> Result<Self>

Deserializes this instance from a given slice of bytes. Updates the buffer to point at the remaining bytes.
§

fn try_from_slice(v: &[u8]) -> Result<Self, Error>

Deserialize this instance from a slice of bytes.
source§

impl BorshSerialize for Configuration

source§

fn serialize<W: Write>(&self, writer: &mut W) -> Result<()>

§

fn try_to_vec(&self) -> Result<Vec<u8>, Error>

Serialize this instance into a vector of bytes.
source§

impl Clone for Configuration

source§

fn clone(&self) -> Configuration

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl OdraItem for Configuration

source§

fn is_module() -> bool

§

fn events() -> Vec<Event>

source§

impl Typed for Configuration

source§

fn ty() -> Type

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> OdraType for T
where T: MockSerializable + MockDeserializable,

§

fn serialize(&self) -> Option<Vec<u8>>

Serializes the value.
§

fn deserialize(bytes: &[u8]) -> Option<Self>

Deserializes the value.
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.