-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlib.rs
More file actions
33 lines (28 loc) · 959 Bytes
/
lib.rs
File metadata and controls
33 lines (28 loc) · 959 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#![allow(unexpected_cfgs, deprecated)]
use anchor_lang::prelude::*;
use light_token::instruction::FreezeCpi;
declare_id!("JBMzMJX4sqCQfNVbosP2oqP1KZ5ZDWiwYTrupk687qXZ");
#[program]
pub mod light_token_anchor_freeze {
use super::*;
pub fn freeze(ctx: Context<FreezeAccounts>) -> Result<()> {
FreezeCpi {
token_account: ctx.accounts.token_account.to_account_info(),
mint: ctx.accounts.mint.to_account_info(),
freeze_authority: ctx.accounts.freeze_authority.to_account_info(),
}
.invoke()?;
Ok(())
}
}
#[derive(Accounts)]
pub struct FreezeAccounts<'info> {
/// CHECK: Light token program for CPI
pub light_token_program: AccountInfo<'info>,
/// CHECK: Validated by light-token CPI
#[account(mut)]
pub token_account: AccountInfo<'info>,
/// CHECK: Validated by light-token CPI
pub mint: AccountInfo<'info>,
pub freeze_authority: Signer<'info>,
}