#[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: Keytoken_program: Pubkey

Store token program used

fraction_mint: Pubkey

Mint that produces the fractional shares

authority: Pubkey

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

allow_further_share_creation: bool

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: VaultStatelocked_price_per_share: u64

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

Trait Implementations

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

Deserialize this instance from a slice of bytes.

Serialize this instance into a vector of bytes.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.