pub enum FeatureProposalInstruction {
Propose {
tokens_to_mint: u64,
acceptance_criteria: AcceptanceCriteria,
},
Tally,
}
Expand description
Instructions supported by the Feature Proposal program
Variants§
Propose
Propose a new feature.
This instruction will create a variety of accounts to support the feature proposal, all funded by account 0:
- A new token mint with a supply of
tokens_to_mint
, owned by the program and never modified again - A new “distributor” token account that holds the total supply, owned by account 0.
- A new “acceptance” token account that holds 0 tokens, owned by the program. Tokens transfers to this address are irrevocable and permanent.
- A new feature id account that has been funded and allocated (as described in
solana_program::feature
)
On successful execution of the instruction, the feature proposer is expected to distribute the tokens in the distributor token account out to all participating parties.
Based on the provided acceptance criteria, if AcceptanceCriteria::tokens_required
tokens are transferred into the acceptance token account before
AcceptanceCriteria::deadline
then the proposal is eligible to be accepted.
The FeatureProposalInstruction::Tally
instruction must be executed, by any party, to
complete the feature acceptance process.
Accounts expected by this instruction:
[writeable,signer]
Funding account (must be a system account)[writeable,signer]
Unallocated feature proposal account to create[writeable]
Token mint address fromget_mint_address
[writeable]
Distributor token account address fromget_distributor_token_address
[writeable]
Acceptance token account address fromget_acceptance_token_address
[writeable]
Feature id account address fromget_feature_id_address
[]
System program[]
SPL Token program[]
Rent sysvar
Fields
acceptance_criteria: AcceptanceCriteria
Criteria for how this proposal may be activated
Tally
Tally
is a permission-less instruction to check the acceptance criteria for the feature
proposal, which may result in:
- No action
- Feature proposal acceptance
- Feature proposal expiration
Accounts expected by this instruction:
[writeable]
Feature proposal account[]
Acceptance token account address fromget_acceptance_token_address
[writeable]
Derived feature id account address fromget_feature_id_address
[]
System program[]
Clock sysvar
Trait Implementations§
Source§impl BorshDeserialize for FeatureProposalInstruction
impl BorshDeserialize for FeatureProposalInstruction
Source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Source§fn is_u8() -> bool
fn is_u8() -> bool
Vec<u8>
is the most common use-case for serialization and deserialization, it’s
worth handling it as a special case to improve performance.
It’s a workaround for specific Vec<u8>
implementation versus generic Vec<T>
implementation. See https://github.com/rust-lang/rfcs/pull/1210 for details.Source§impl BorshSchema for FeatureProposalInstruction
impl BorshSchema for FeatureProposalInstruction
Source§fn declaration() -> Declaration
fn declaration() -> Declaration
Source§fn add_definitions_recursively(
definitions: &mut HashMap<Declaration, Definition>,
)
fn add_definitions_recursively( definitions: &mut HashMap<Declaration, Definition>, )
Source§fn add_definition(
declaration: String,
definition: Definition,
definitions: &mut HashMap<String, Definition>,
)
fn add_definition( declaration: String, definition: Definition, definitions: &mut HashMap<String, Definition>, )
fn schema_container() -> BorshSchemaContainer
Source§impl BorshSerialize for FeatureProposalInstruction
impl BorshSerialize for FeatureProposalInstruction
fn serialize<W: Write>(&self, writer: &mut W) -> Result<(), Error>
Source§fn try_to_vec(&self) -> Result<Vec<u8>, Error>
fn try_to_vec(&self) -> Result<Vec<u8>, Error>
Source§fn is_u8() -> bool
fn is_u8() -> bool
Vec<u8>
is the most common use-case for serialization and deserialization, it’s
worth handling it as a special case to improve performance.
It’s a workaround for specific Vec<u8>
implementation versus generic Vec<T>
implementation. See https://github.com/rust-lang/rfcs/pull/1210 for details.Source§impl Clone for FeatureProposalInstruction
impl Clone for FeatureProposalInstruction
Source§fn clone(&self) -> FeatureProposalInstruction
fn clone(&self) -> FeatureProposalInstruction
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for FeatureProposalInstruction
impl Debug for FeatureProposalInstruction
Source§impl Pack for FeatureProposalInstruction
impl Pack for FeatureProposalInstruction
Source§fn get_packed_len() -> usize
fn get_packed_len() -> usize
Source§fn unpack_unchecked(input: &[u8]) -> Result<Self, ProgramError>
fn unpack_unchecked(input: &[u8]) -> Result<Self, ProgramError>
impl Sealed for FeatureProposalInstruction
impl StructuralPartialEq for FeatureProposalInstruction
Auto Trait Implementations§
impl Freeze for FeatureProposalInstruction
impl RefUnwindSafe for FeatureProposalInstruction
impl Send for FeatureProposalInstruction
impl Sync for FeatureProposalInstruction
impl Unpin for FeatureProposalInstruction
impl UnwindSafe for FeatureProposalInstruction
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