#[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,
}Fields§
§key: Key§token_program: PubkeyStore token program used
fraction_mint: PubkeyMint that produces the fractional shares
Authority who can make changes to the vault
fraction_treasury: Pubkeytreasury where fractional shares are held for redemption by authority
redeem_treasury: Pubkeytreasury 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: PubkeyMust point at an ExternalPriceAccount, which gives permission and price for buyout.
token_type_count: u8In 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: VaultStateOnce 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§
Source§impl Vault
impl Vault
pub fn from_account_info(a: &AccountInfo<'_>) -> Result<Vault, ProgramError>
pub fn get_token_type_count(a: &AccountInfo<'_>) -> u8
Trait Implementations§
Source§impl BorshDeserialize for Vault
impl BorshDeserialize for Vault
Source§impl BorshSerialize for Vaultwhere
Key: BorshSerialize,
Pubkey: BorshSerialize,
bool: BorshSerialize,
u8: BorshSerialize,
VaultState: BorshSerialize,
u64: BorshSerialize,
impl BorshSerialize for Vaultwhere
Key: BorshSerialize,
Pubkey: BorshSerialize,
bool: BorshSerialize,
u8: BorshSerialize,
VaultState: BorshSerialize,
u64: BorshSerialize,
Auto Trait Implementations§
impl Freeze for Vault
impl RefUnwindSafe for Vault
impl Send for Vault
impl Sync for Vault
impl Unpin for Vault
impl UnwindSafe for Vault
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