pub struct Proposal {Show 15 fields
pub governor: Pubkey,
pub index: u64,
pub bump: u8,
pub proposer: Pubkey,
pub quorum_votes: u64,
pub for_votes: u64,
pub against_votes: u64,
pub abstain_votes: u64,
pub canceled_at: i64,
pub created_at: i64,
pub activated_at: i64,
pub voting_ends_at: i64,
pub queued_at: i64,
pub queued_transaction: Pubkey,
pub instructions: Vec<ProposalInstruction>,
}Expand description
A Proposal is a pending transaction that may or may not be executed by the DAO.
Fields§
§governor: PubkeyThe public key of the governor.
index: u64The unique ID of the proposal, auto-incremented.
bump: u8Bump seed
proposer: PubkeyThe public key of the proposer.
quorum_votes: u64The number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed
for_votes: u64Current number of votes in favor of this proposal
against_votes: u64Current number of votes in opposition to this proposal
abstain_votes: u64Current number of votes for abstaining for this proposal
canceled_at: i64The timestamp when the proposal was canceled.
created_at: i64The timestamp when the proposal was created.
activated_at: i64The timestamp in which the proposal was activated. This is when voting begins.
voting_ends_at: i64The timestamp when voting ends. This only applies to active proposals.
queued_at: i64The timestamp in which the proposal was queued, i.e. approved for execution on the Smart Wallet.
queued_transaction: PubkeyIf the transaction was queued, this is the associated Goki Smart Wallet transaction.
instructions: Vec<ProposalInstruction>The instructions associated with the proposal.
Implementations§
Source§impl Proposal
impl Proposal
Sourcepub fn get_state(&self) -> Result<ProposalState>
pub fn get_state(&self) -> Result<ProposalState>
Gets the state.
Sourcepub fn meets_quorum(&self, quorum_votes: u64) -> Option<bool>
pub fn meets_quorum(&self, quorum_votes: u64) -> Option<bool>
Checks if the proposal meets quorum; that is, enough votes were made on the proposal.
Sourcepub fn state(&self, current_time: i64) -> Option<ProposalState>
pub fn state(&self, current_time: i64) -> Option<ProposalState>
The state of the proposal. See ProposalState for more details. Adapted from https://github.com/compound-finance/compound-protocol/blob/4a8648ec0364d24c4ecfc7d6cae254f55030d65f/contracts/Governance/GovernorBravoDelegate.sol#L205
Sourcepub fn to_smart_wallet_instructions(&self) -> Vec<TXInstruction>
pub fn to_smart_wallet_instructions(&self) -> Vec<TXInstruction>
Converts this proposal to Smart Wallet smart_wallet::TXInstructions.
Trait Implementations§
Source§impl AccountDeserialize for Proposal
impl AccountDeserialize for Proposal
Source§fn try_deserialize(buf: &mut &[u8]) -> Result<Self>
fn try_deserialize(buf: &mut &[u8]) -> Result<Self>
Mint account into a token
Account.Source§fn try_deserialize_unchecked(buf: &mut &[u8]) -> Result<Self>
fn try_deserialize_unchecked(buf: &mut &[u8]) -> Result<Self>
Source§impl AccountSerialize for Proposal
impl AccountSerialize for Proposal
Source§impl BorshDeserialize for Proposal
impl BorshDeserialize for Proposal
Source§impl BorshSerialize for Proposalwhere
Pubkey: BorshSerialize,
u64: BorshSerialize,
u8: BorshSerialize,
i64: BorshSerialize,
Vec<ProposalInstruction>: BorshSerialize,
impl BorshSerialize for Proposalwhere
Pubkey: BorshSerialize,
u64: BorshSerialize,
u8: BorshSerialize,
i64: BorshSerialize,
Vec<ProposalInstruction>: BorshSerialize,
Source§impl Discriminator for Proposal
impl Discriminator for Proposal
fn discriminator() -> [u8; 8]
Auto Trait Implementations§
impl Freeze for Proposal
impl RefUnwindSafe for Proposal
impl Send for Proposal
impl Sync for Proposal
impl Unpin for Proposal
impl UnwindSafe for Proposal
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> 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