FV-ANC-3-CL5 No is_initialized check when operating on an account
Bad
// Risk of operating on an uninitialized account
let state = &ctx.accounts.state;
Good
// Explicitly check the `is_initialized` flag before proceeding
if ctx.accounts.state.is_initialized {
return Err(ProgramError::AccountAlreadyInitialized);
}
ctx.accounts.state.is_initialized = true;
PreviousFV-ANC-3-CL4 Usage of UncheckedAccount without manual signer checkNextFV-ANC-3-CL6 Missing account constraints
Last updated
Was this helpful?