Struct crate_token::state::CrateToken [−][src]
pub struct CrateToken {
pub mint: Pubkey,
pub bump: u8,
pub fee_setter_authority: Pubkey,
pub fee_to_setter: Pubkey,
pub issue_authority: Pubkey,
pub withdraw_authority: Pubkey,
pub author_fee_to: Pubkey,
pub issue_fee_bps: u16,
pub withdraw_fee_bps: u16,
}
Expand description
Contains the info of a crate token. Immutable. The account associated with this struct is also the mint/freeze authority.
Fields
mint: Pubkey
anchor_spl::token::Mint of the CrateToken.
bump: u8
Bump.
Authority that can modify the CrateToken’s fees.
fee_to_setter: Pubkey
Authority that can modify who can change the fees.
Authority that is allowed to issue new shares of the Crate. This is usually a program that will handle users depositing tokens into the crate + giving them shares of the crate.
Authority that is allowed to withdraw any token from the Crate. Withdrawals may be subject to fees.
Account which is the recipient of issue/withdraw (“author”) fees. If fees do not exist, this is unused.
issue_fee_bps: u16
The issuance fee in bps. crate::ISSUE_FEE_BPS of this fee goes to the Crate DAO.
withdraw_fee_bps: u16
The issuance fee in bps. crate::WITHDRAW_FEE_BPS of this fee goes to the Crate DAO.
Implementations
Applies the issuance fee.
Applies the withdraw fee.
Trait Implementations
Deserializes previously initialized account data. Should fail for all
uninitialized accounts, where the bytes are zeroed. Implementations
should be unique to a particular account type so that one can never
successfully deserialize the data of one account type into another.
For example, if the SPL token program were to implement this trait,
it should be impossible to deserialize a Mint
account into a token
Account
. Read more
impl BorshDeserialize for CrateToken where
Pubkey: BorshDeserialize,
u8: BorshDeserialize,
Pubkey: BorshDeserialize,
Pubkey: BorshDeserialize,
Pubkey: BorshDeserialize,
Pubkey: BorshDeserialize,
Pubkey: BorshDeserialize,
u16: BorshDeserialize,
u16: BorshDeserialize,
impl BorshDeserialize for CrateToken where
Pubkey: BorshDeserialize,
u8: BorshDeserialize,
Pubkey: BorshDeserialize,
Pubkey: BorshDeserialize,
Pubkey: BorshDeserialize,
Pubkey: BorshDeserialize,
Pubkey: BorshDeserialize,
u16: BorshDeserialize,
u16: BorshDeserialize,
impl BorshSerialize for CrateToken where
Pubkey: BorshSerialize,
u8: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
u16: BorshSerialize,
u16: BorshSerialize,
impl BorshSerialize for CrateToken where
Pubkey: BorshSerialize,
u8: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
u16: BorshSerialize,
u16: BorshSerialize,
Returns the “default value” for a type. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for CrateToken
impl Send for CrateToken
impl Sync for CrateToken
impl Unpin for CrateToken
impl UnwindSafe for CrateToken
Blanket Implementations
pub default fn example() -> T
Mutably borrows from an owned value. Read more