Skip to main content

AllowlistInstruction

Enum AllowlistInstruction 

Source
pub enum AllowlistInstruction {
    InitializeAdminAuthority,
    UpdateAdminAuthority,
    AdminAddPrivateAllowlist,
    AdminRemovePrivateAllowlist,
    Thaw {
        user_system_account: Pubkey,
    },
    AdminAddPublicAllowedAccount,
    AdminAddPrivateAllowedAccount,
    AdminRemovePublicAllowedAccount,
    AdminRemovePrivateAllowedAccount,
    AdminFreeze,
    AdminBurn {
        amount: u64,
        decimals: u8,
    },
}

Variants§

§

InitializeAdminAuthority

Initializes the allowlist admin account.

It creates a new system account.

This can only be called once.

The InitializeAdminAuthority instruction MUST be in the same Transaction as the program deployment Otherwise another party can acquire ownership of the uninitialized admin account.

Accounts expected by this instruction:

  1. [signer] The Admin Authority account
  2. [writable] The Admin’s Program Derived Account
  3. [] System Program
§

UpdateAdminAuthority

Updates the allowlist admin account.

This can only be called by the existing admin authority.

Accounts expected by this instruction:

  1. [signer] The current Admin Authority account
  2. [signer] The new Admin Authority account
  3. [writable] The Admin’s Program Derived Account
§

AdminAddPrivateAllowlist

Associates a Token Mint as a Private Instrument.

This can only be called by the existing admin authority.

Accounts expected by this instruction:

  1. [signer] The Admin Authority account
  2. [] The Admin’s Program Derived Account
  3. [] The token mint for the private instrument
  4. [writable] The Private Allowlist’s Program Derived Account
  5. [] System Program
§

AdminRemovePrivateAllowlist

Changes Token Mint from a Public Instrument to a Private Instrument.

This can only be called by the existing admin authority.

Accounts expected by this instruction:

  1. [signer] The Admin Authority account
  2. [] The Admin’s Program Derived Account
  3. [] The token mint for the private instrument
  4. [writable] The Private Allowlist’s Program Derived Account
  5. [] System Program
§

Thaw

Thaws the underlying Token Account of the provided system wallet account if the wallet is on the allow list.

Accounts expected by this instruction:

  1. [] The token mint
  2. [] The wallet system account Program Derived Address for the Public Instrument Allowlist
  3. [] The wallet system account Program Derived Address for the Private Instrument Allowlist
  4. [writable] The wallet’s Token Account for the Mint
  5. [] The token program
  6. [] The Allowlist PDA for the Freeze Authority

Fields

§user_system_account: Pubkey

The wallet system account that is being thawed (e.g. the Token Account owner)

§

AdminAddPublicAllowedAccount

Adds a new account to the Public Instrument Allowlist, and can only be called by the Admin Authority.

Accounts expected by this instruction:

  1. [signer] The Admin Authority account
  2. [] The Admin’s Program Derived Account
  3. [signer] The wallet system account to add to the allow list. Note: this can optionally be a signer.
  4. [] The wallet system account Program Derived Address for the Private Instrument Allowlist
  5. [] System Program
§

AdminAddPrivateAllowedAccount

Adds a new account to the Private Instrument Allowlist, and can only be called by the Admin Authority.

Accounts expected by this instruction:

  1. [signer] The Admin Authority account
  2. [] The Admin’s Program Derived Account
  3. [signer] The wallet system account to add to the allow list. Note: this can optionally be a signer.
  4. [] The wallet system account Program Derived Address for the Private Instrument Allowlist
  5. [] The token mint for the private instrument
  6. [] System Program
§

AdminRemovePublicAllowedAccount

Removes an existing account from the allowlist, and can only be called by the Admin Authority.

This instruction WILL NOT freeze existing Token Accounts, which is instead done via AdminFreeze.

Accounts expected by this instruction:

  1. [signer] The Admin Authority account
  2. [] The Admin’s Program Derived Account
  3. [] The wallet system account to remove from the allow list.
  4. [] The wallet system account Program Derived Address for the allow list
§

AdminRemovePrivateAllowedAccount

Removes an existing account from the allowlist, and can only be called by the Admin Authority.

This instruction WILL NOT freeze existing Token Accounts, which is instead done via AdminFreeze.

Accounts expected by this instruction:

  1. [signer] The Admin Authority account
  2. [] The Admin’s Program Derived Account
  3. [] The wallet system account to remove from the allow list.
  4. [] The wallet system account Program Derived Address for the allow list
  5. [] The token mint for the private instrument
§

AdminFreeze

Freezes an Token Account, and can only be called by the Admin Authority.

Accounts expected by this instruction:

  1. [signer] The Admin Authority account
  2. [] The Admin’s Program Derived Account
  3. [] The wallet system account
  4. [writable] The wallet’s Token Account for the Mint
  5. [] The token mint
  6. [] The token program
  7. [] The Allowlist PDA for the Freeze Authority
§

AdminBurn

Burns tokens by removing them from an account. If they account is frozen, it will unfreeze it first, and then refreeze it.

This instruction can only be called by the Admin Authority

The wallet address does NOT need to be on the allowlist to be burned.

Accounts expected by this instruction:

  1. [signer] The Admin Authority account
  2. [] The Admin’s Program Derived Account
  3. [] The wallet system account
  4. [writable] The wallet’s Token Account for the Mint
  5. [] The token mint
  6. [] The token program
  7. [] The Allowlist PDA for the Freeze Authority

Fields

§amount: u64

The amount of tokens to burn.

§decimals: u8

Expected number of base 10 digits to the right of the decimal place.

Trait Implementations§

Source§

impl BorshDeserialize for AllowlistInstruction

Source§

fn deserialize_reader<__R: Read>(reader: &mut __R) -> Result<Self, Error>

Source§

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

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

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

Deserialize this instance from a slice of bytes.
Source§

fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>
where R: Read,

Source§

impl BorshSerialize for AllowlistInstruction

Source§

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

Source§

impl Clone for AllowlistInstruction

Source§

fn clone(&self) -> AllowlistInstruction

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for AllowlistInstruction

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl EnumExt for AllowlistInstruction

Source§

fn deserialize_variant<__R: Read>( reader: &mut __R, variant_tag: u8, ) -> Result<Self, Error>

Deserialises given variant of an enum from the reader. Read more
Source§

impl PartialEq for AllowlistInstruction

Source§

fn eq(&self, other: &AllowlistInstruction) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for AllowlistInstruction

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

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>,

Source§

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>,

Source§

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.