Struct mpl_token_vault::state::Vault
source · [−]#[repr(C)]pub struct Vault {
pub key: Key,
pub token_program: Pubkey,
pub fraction_mint: Pubkey,
pub authority: Pubkey,
pub fraction_treasury: Pubkey,
pub redeem_treasury: Pubkey,
pub allow_further_share_creation: bool,
pub pricing_lookup_address: Pubkey,
pub token_type_count: u8,
pub state: VaultState,
pub locked_price_per_share: u64,
/* private fields */
}
Fields
key: Key
token_program: Pubkey
Store token program used
fraction_mint: Pubkey
Mint that produces the fractional shares
Authority who can make changes to the vault
fraction_treasury: Pubkey
treasury where fractional shares are held for redemption by authority
redeem_treasury: Pubkey
treasury where monies are held for fractional share holders to redeem(burn) shares once buyout is made
Can authority mint more shares from fraction_mint after activation
pricing_lookup_address: Pubkey
Must point at an ExternalPriceAccount, which gives permission and price for buyout.
token_type_count: u8
In inactive state, we use this to set the order key on Safety Deposit Boxes being added and then we increment it and save so the next safety deposit box gets the next number. In the Combined state during token redemption by authority, we use it as a decrementing counter each time The authority of the vault withdrawals a Safety Deposit contents to count down how many are left to be opened and closed down. Once this hits zero, and the fraction mint has zero shares, then we can deactivate the vault.
state: VaultState
Once combination happens, we copy price per share to vault so that if something nefarious happens to external price account, like price change, we still have the math ‘saved’ for use in our calcs
Implementations
sourceimpl Vault
impl Vault
pub fn from_account_info(a: &AccountInfo<'_>) -> Result<Vault, ProgramError>
pub fn get_token_type_count(a: &AccountInfo<'_>) -> u8
Trait Implementations
sourceimpl BorshDeserialize for Vault where
Key: BorshDeserialize,
Pubkey: BorshDeserialize,
Pubkey: BorshDeserialize,
Pubkey: BorshDeserialize,
Pubkey: BorshDeserialize,
Pubkey: BorshDeserialize,
bool: BorshDeserialize,
Pubkey: BorshDeserialize,
u8: BorshDeserialize,
VaultState: BorshDeserialize,
u64: BorshDeserialize,
u8: BorshDeserialize,
impl BorshDeserialize for Vault where
Key: BorshDeserialize,
Pubkey: BorshDeserialize,
Pubkey: BorshDeserialize,
Pubkey: BorshDeserialize,
Pubkey: BorshDeserialize,
Pubkey: BorshDeserialize,
bool: BorshDeserialize,
Pubkey: BorshDeserialize,
u8: BorshDeserialize,
VaultState: BorshDeserialize,
u64: BorshDeserialize,
u8: BorshDeserialize,
sourceimpl BorshSerialize for Vault where
Key: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
bool: BorshSerialize,
Pubkey: BorshSerialize,
u8: BorshSerialize,
VaultState: BorshSerialize,
u64: BorshSerialize,
u8: BorshSerialize,
impl BorshSerialize for Vault where
Key: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
bool: BorshSerialize,
Pubkey: BorshSerialize,
u8: BorshSerialize,
VaultState: BorshSerialize,
u64: BorshSerialize,
u8: BorshSerialize,
Auto Trait Implementations
impl RefUnwindSafe for Vault
impl Send for Vault
impl Sync for Vault
impl Unpin for Vault
impl UnwindSafe for Vault
Blanket Implementations
impl<T> AbiExample for T
impl<T> AbiExample for T
default fn example() -> T
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more