pub fn handler(ctx: Context<MyContext>) -> Result<()> { ctx.accounts.x = new_address; // No validation Ok(()) }
pub fn handler(ctx: Context<MyContext>) -> Result<()> { // prevent system program address // prevent pda or program address // verify address exists and can receive tokens // only then dot he update ctx.accounts.x = new_address; Ok(()) }
Last updated 9 days ago
Was this helpful?