[][src]Enum spl_feature_proposal::instruction::FeatureProposalInstruction

pub enum FeatureProposalInstruction {
    Propose {
        tokens_to_mint: u64,
        acceptance_criteria: AcceptanceCriteria,
    },
    Tally,
}

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:

  1. [writeable,signer] Funding account (must be a system account)
  2. [writeable,signer] Unallocated feature proposal account to create
  3. [writeable] Token mint address from get_mint_address
  4. [writeable] Distributor token account address from get_distributor_token_address
  5. [writeable] Acceptance token account address from get_acceptance_token_address
  6. [writeable] Feature id account address from get_feature_id_address
  7. [] System program
  8. [] SPL Token program
  9. [] Rent sysvar

Fields of Propose

tokens_to_mint: u64

Total number of tokens to mint for this proposal

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:

  1. [writeable] Feature proposal account
  2. [] Acceptance token account address from get_acceptance_token_address
  3. [writeable] Derived feature id account address from get_feature_id_address
  4. [] System program
  5. [] Clock sysvar

Trait Implementations

impl BorshDeserialize for FeatureProposalInstruction where
    u64: BorshDeserialize,
    AcceptanceCriteria: BorshDeserialize
[src]

impl BorshSchema for FeatureProposalInstruction[src]

impl BorshSerialize for FeatureProposalInstruction where
    u64: BorshSerialize,
    AcceptanceCriteria: BorshSerialize
[src]

impl Clone for FeatureProposalInstruction[src]

impl Debug for FeatureProposalInstruction[src]

impl Pack for FeatureProposalInstruction[src]

impl PartialEq<FeatureProposalInstruction> for FeatureProposalInstruction[src]

impl Sealed for FeatureProposalInstruction[src]

impl StructuralPartialEq for FeatureProposalInstruction[src]

Auto Trait Implementations

Blanket Implementations

impl<T> AbiExample for T

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,