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: Pubkeybump: u8

Bump.

fee_setter_authority: Pubkey

Authority that can modify the CrateToken’s fees.

fee_to_setter: Pubkey

Authority that can modify who can change the fees.

issue_authority: Pubkey

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.

withdraw_authority: Pubkey

Authority that is allowed to withdraw any token from the Crate. Withdrawals may be subject to fees.

author_fee_to: Pubkey

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

Deserializes account data without checking the account discriminator. This should only be used on account initialization, when the bytes of the account are zeroed. Read more

Serializes the account data into writer.

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

Formats the value using the given formatter. Read more

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

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

Performs the conversion.

Performs the conversion.

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.