Attribute Macro anchor_lang::account

source · []
#[account]
Expand description

A data structure representing a Solana account, implementing various traits:

When implementing account serialization traits the first 8 bytes are reserved for a unique account discriminator, self described by the first 8 bytes of the SHA256 of the account’s Rust ident.

As a result, any calls to AccountDeserialize’s try_deserialize will check this discriminator. If it doesn’t match, an invalid account was given, and the account deserialization will exit with an error.