Skip to main content

TransferHook

Struct TransferHook 

Source
pub struct TransferHook<'a> {
    pub authority: &'a [u8; 32],
    pub program_id: &'a [u8; 32],
}
Expand description

Transfer-hook binding extracted from a Token-2022 mint.

Layout of the TransferHook extension value (64 bytes):

  0..32   authority  (Pubkey - may be rotated via SetTransferHook)
 32..64   program_id (Pubkey - the hook program invoked on transfer)

References are borrowed from the mint buffer, so the caller typically clones .to_bytes() into an owned Address before further use. This is R6 audit closure; see [examples/hopper-token-2022-transfer-hook] for the end-to-end reference program.

Fields§

§authority: &'a [u8; 32]

Authority allowed to update the hook program binding.

§program_id: &'a [u8; 32]

Program ID of the hook that Token-2022 invokes on every transfer.

Auto Trait Implementations§

§

impl<'a> Freeze for TransferHook<'a>

§

impl<'a> RefUnwindSafe for TransferHook<'a>

§

impl<'a> Send for TransferHook<'a>

§

impl<'a> Sync for TransferHook<'a>

§

impl<'a> Unpin for TransferHook<'a>

§

impl<'a> UnsafeUnpin for TransferHook<'a>

§

impl<'a> UnwindSafe for TransferHook<'a>

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