1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use crate::InvokeSignedInstruction;
use anchor_lang::prelude::*;
use anchor_spl::token;
use vipers::{assert_keys, assert_owner, validate::Validate};
impl<'info> Validate<'info> for InvokeSignedInstruction<'info> {
fn validate(&self) -> ProgramResult {
assert_keys!(
self.owner_authority,
self.nft_account.owner,
"owner_authority"
);
assert_owner!(self.nft_account, token::ID);
require!(self.nft_account.amount == 1, Unauthorized);
Ok(())
}
}