[−][src]Struct vostok_dao::Contract
Implementations
impl Contract
[src]
pub fn new(
members: Vec<Voter>,
min_support: u32,
min_duration: u32,
max_duration: u32,
min_bond: U128
) -> Self
[src]
members: Vec<Voter>,
min_support: u32,
min_duration: u32,
max_duration: u32,
min_bond: U128
) -> Self
Creates a new multisig NEAR wallet.
Parameters:
+ members
: list of signers (voters) for this multisig wallet.
+ min_support
: minimum support a proposal have to get (in power votes) to pass.
+ min_duration
: minimum voting time (in number of blocks) for a new proposal.
+ max_duration
: maximum voting time (in number of blocks) for a new proposal.
+ min_bond
: minimum deposit a caller have to put to create a new proposal. It includes
the storage fees.
+ NOTE: this parameters are binding for all proposals and can't be changed in the future.
pub fn add_proposal(&mut self, p: NewProposal) -> u32
[src]
Adds a new proposal. Can be called by anyone.
NewProposal is validated against the Contract parameters (min_duration, max_duration)
and the caller have to provide a deposit = max(self.min_bond, this_tx_storage_cost).
Once validate, the proposal is appended to the list of proposals and it's index
is
returned.
pub fn vote(&mut self, proposal_id: u32, vote_yes: bool)
[src]
Vote vote and signs a given proposal. proposal_id must be a valid and active proposal. Proposal is active if the current block is between proposal start and end block. Only a valid signer (member of this multisig) can vote for a proposal. Each signer can vote only once.
pub fn execute(&mut self, proposal_id: u32) -> Promise
[src]
Execute executes given proposal. A proposal can be executed only once and only after the
voting period passed and before the proposal.execute_before
.
Anyone can call this functions.
pub fn proposal(&self, proposal_id: u32) -> ProposalOut
[src]
Returns proposal by id.
Panics when proposal_id
is not found.
pub fn settings(&self) -> Settings
[src]
Returns Conract configuration.
Trait Implementations
impl BorshDeserialize for Contract where
AccountId: BorshDeserialize,
Vec<Voter>: BorshDeserialize,
u32: BorshDeserialize,
u32: BorshDeserialize,
u32: BorshDeserialize,
Balance: BorshDeserialize,
u32: BorshDeserialize,
Vector<Proposal>: BorshDeserialize,
[src]
AccountId: BorshDeserialize,
Vec<Voter>: BorshDeserialize,
u32: BorshDeserialize,
u32: BorshDeserialize,
u32: BorshDeserialize,
Balance: BorshDeserialize,
u32: BorshDeserialize,
Vector<Proposal>: BorshDeserialize,
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
[src]
pub fn try_from_slice(v: &[u8]) -> Result<Self, Error>
[src]
pub fn is_u8() -> bool
[src]
impl BorshSerialize for Contract where
AccountId: BorshSerialize,
Vec<Voter>: BorshSerialize,
u32: BorshSerialize,
u32: BorshSerialize,
u32: BorshSerialize,
Balance: BorshSerialize,
u32: BorshSerialize,
Vector<Proposal>: BorshSerialize,
[src]
AccountId: BorshSerialize,
Vec<Voter>: BorshSerialize,
u32: BorshSerialize,
u32: BorshSerialize,
u32: BorshSerialize,
Balance: BorshSerialize,
u32: BorshSerialize,
Vector<Proposal>: BorshSerialize,
fn serialize<W: Write>(&self, writer: &mut W) -> Result<(), Error>
[src]
pub fn try_to_vec(&self) -> Result<Vec<u8, Global>, Error>
[src]
pub fn is_u8() -> bool
[src]
impl Default for Contract
[src]
Auto Trait Implementations
impl RefUnwindSafe for Contract
[src]
impl Send for Contract
[src]
impl Sync for Contract
[src]
impl Unpin for Contract
[src]
impl UnwindSafe for Contract
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,