Struct human_program::state::ContractStateV4
source · #[repr(C)]pub struct ContractStateV4 {
pub token: Pubkey,
pub owner: Pubkey,
pub admin: Pubkey,
pub commission_addr: Pubkey,
pub treasury_addr: Pubkey,
pub swap_state: Pubkey,
pub sold: u64,
pub vest: VestState,
pub drop: Option<DropV2>,
pub current_round: Option<Pubkey>,
pub completed_rounds_count: u64,
}
Fields§
§token: Pubkey
Associated token mint
owner: Pubkey
Alice
admin: Pubkey
required for priveleged operations
commission_addr: Pubkey
comission WSOL account
treasury_addr: Pubkey
owner treasury
swap_state: Pubkey
swap state
sold: u64
tokens sold
vest: VestState
vesting state
drop: Option<DropV2>
in progress drop. use helper methods to access this field
current_round: Option<Pubkey>
round in progress, used for vesting 10% of tokens
completed_rounds_count: u64
completed rounds count
Implementations§
source§impl ContractStateV4
impl ContractStateV4
pub fn calculate_buy_split( &self, now: UnixTimestamp, token_amount: u64, expected_price: u64 ) -> Result<BuySplit, ProgramError>
pub fn calculate_split_by_lamports(lamports: u64) -> Option<BuySplit>
pub fn create_drop( &mut self, price: u64, id: u64, amount: u64, now: UnixTimestamp, start_date: UnixTimestamp, end_date: UnixTimestamp ) -> Result<(), ProgramError>
pub fn clear_drop(&mut self)
Trait Implementations§
source§impl BorshDeserialize for ContractStateV4where
Pubkey: BorshDeserialize,
u64: BorshDeserialize,
VestState: BorshDeserialize,
Option<DropV2>: BorshDeserialize,
Option<Pubkey>: BorshDeserialize,
impl BorshDeserialize for ContractStateV4where Pubkey: BorshDeserialize, u64: BorshDeserialize, VestState: BorshDeserialize, Option<DropV2>: BorshDeserialize, Option<Pubkey>: BorshDeserialize,
source§impl BorshSerialize for ContractStateV4where
Pubkey: BorshSerialize,
u64: BorshSerialize,
VestState: BorshSerialize,
Option<DropV2>: BorshSerialize,
Option<Pubkey>: BorshSerialize,
impl BorshSerialize for ContractStateV4where Pubkey: BorshSerialize, u64: BorshSerialize, VestState: BorshSerialize, Option<DropV2>: BorshSerialize, Option<Pubkey>: BorshSerialize,
source§impl Debug for ContractStateV4
impl Debug for ContractStateV4
source§impl Entity for ContractStateV4
impl Entity for ContractStateV4
Auto Trait Implementations§
impl RefUnwindSafe for ContractStateV4
impl Send for ContractStateV4
impl Sync for ContractStateV4
impl Unpin for ContractStateV4
impl UnwindSafe for ContractStateV4
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
Mutably borrows from an owned value. Read more