Struct human_royalty::state::State

source ·
pub struct State {
Show 13 fields pub wallet: Pubkey, pub owner: Pubkey, pub host: Pubkey, pub total_distributed: u64, pub total_user_distributed: u64, pub settings: Settings, pub drop_idx: u32, pub vouchers_count: u32, pub tokens_held: u64, pub distribution: Option<Distribution>, pub token_mint: Pubkey, pub realm_addr: Pubkey, pub vault_addr: Pubkey,
}

Fields§

§wallet: Pubkey§owner: Pubkey§host: Pubkey§total_distributed: u64

total amount distributed on the contract

§total_user_distributed: u64

total amount distributed minus host and owner split

§settings: Settings§drop_idx: u32

drop_idx is monotonically growing counter to track redeemed voucher voucher could only redeemed if it’s drop_idx matches state’s one on redeem it’s drop_idx is incremented, so it can only be redeemed in next drop. Vouchers are created with current drop_idx, but since they can’t be issued in the middle of distribution, we are safe

§vouchers_count: u32

total vouchers in circulation

§tokens_held: u64

total token balance in stake. counted separately to prevent someone from sending tokens directly to wallet and breaking math in the middle of distribution these tokens will also reduce everyone’s share

§distribution: Option<Distribution>

current distribution

§token_mint: Pubkey

Staking token mint

§realm_addr: Pubkey

While forming voting record, use this field

§vault_addr: Pubkey

Vault addr to add weight to creator vote

Trait Implementations§

source§

impl BorshDeserialize for Statewhere Pubkey: BorshDeserialize, u64: BorshDeserialize, Settings: BorshDeserialize, u32: BorshDeserialize, Option<Distribution>: BorshDeserialize,

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§

impl BorshSerialize for Statewhere Pubkey: BorshSerialize, u64: BorshSerialize, Settings: BorshSerialize, u32: BorshSerialize, Option<Distribution>: BorshSerialize,

source§

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

source§

fn try_to_vec(&self) -> Result<Vec<u8, Global>, Error>

Serialize this instance into a vector of bytes.
source§

impl Debug for State

source§

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

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

impl Entity for State

source§

const SIZE: usize = 512usize

source§

const MAGIC: u8 = 119u8

source§

const DATA_SIZE: usize = Self::SIZE - 1

source§

fn serialize_to(&self, data: &mut [u8]) -> Result<(), ProgramError>

source§

fn deserialize_from(data: &[u8]) -> Result<Self, ProgramError>

source§

fn is_initialized(data: &[u8]) -> bool

Auto Trait Implementations§

§

impl RefUnwindSafe for State

§

impl Send for State

§

impl Sync for State

§

impl Unpin for State

§

impl UnwindSafe for State

Blanket Implementations§

§

impl<T> AbiExample for T

§

default fn example() -> T

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V