Defines a program account with automatic serialization.
#[account]
pub struct UserProfile {
pub authority: Pubkey,
pub name: String,
pub xp: u64,
pub bump: u8,
}
Defines the account validation struct.
#[derive(Accounts)]
pub struct Initialize<'info> {
#[account(init, payer = user, space = 8 + 32 + 32 + 8 + 1)]
pub profile: Account<'info, UserProfile>,
#[account(mut)]
pub user: Signer<'info>,
pub system_program: Program<'info, System>,
}