@@ -9,7 +9,7 @@ use anchor_spl::token_2022::spl_token_2022::extension::{
99} ;
1010use anchor_spl:: token_2022:: spl_token_2022:: state:: Mint as MintInner ;
1111use anchor_spl:: token_interface:: {
12- self , Burn , CloseAccount , Mint , MintTo , TokenAccount , TokenInterface , Transfer , TransferChecked ,
12+ self , CloseAccount , Mint , TokenAccount , TokenInterface , Transfer , TransferChecked ,
1313} ;
1414use std:: iter:: Peekable ;
1515use std:: slice:: Iter ;
@@ -137,58 +137,6 @@ pub fn close_vault<'info>(
137137 token_interface:: close_account ( cpi_context)
138138}
139139
140- pub fn mint_tokens < ' info > (
141- token_program : & Interface < ' info , TokenInterface > ,
142- destination : & InterfaceAccount < ' info , TokenAccount > ,
143- authority : & AccountInfo < ' info > ,
144- nonce : u8 ,
145- amount : u64 ,
146- mint : & InterfaceAccount < ' info , Mint > ,
147- ) -> Result < ( ) > {
148- let signature_seeds = get_signer_seeds ( & nonce) ;
149- let signers = & [ & signature_seeds[ ..] ] ;
150-
151- let mint_account_info = mint. to_account_info ( ) ;
152-
153- validate_mint_fee ( & mint_account_info) ?;
154-
155- let cpi_accounts = MintTo {
156- mint : mint_account_info,
157- to : destination. to_account_info ( ) ,
158- authority : authority. to_account_info ( ) ,
159- } ;
160-
161- let cpi_program = token_program. to_account_info ( ) ;
162- let cpi_context = CpiContext :: new_with_signer ( cpi_program, cpi_accounts, signers) ;
163- token_interface:: mint_to ( cpi_context, amount)
164- }
165-
166- pub fn burn_tokens < ' info > (
167- token_program : & Interface < ' info , TokenInterface > ,
168- destination : & InterfaceAccount < ' info , TokenAccount > ,
169- authority : & AccountInfo < ' info > ,
170- nonce : u8 ,
171- amount : u64 ,
172- mint : & InterfaceAccount < ' info , Mint > ,
173- ) -> Result < ( ) > {
174- let signature_seeds = get_signer_seeds ( & nonce) ;
175- let signers = & [ & signature_seeds[ ..] ] ;
176-
177- let mint_account_info = mint. to_account_info ( ) ;
178-
179- validate_mint_fee ( & mint_account_info) ?;
180-
181- let cpi_accounts = Burn {
182- mint : mint_account_info,
183- from : destination. to_account_info ( ) ,
184- authority : authority. to_account_info ( ) ,
185- } ;
186-
187- let cpi_program = token_program. to_account_info ( ) ;
188- let cpi_context = CpiContext :: new_with_signer ( cpi_program, cpi_accounts, signers) ;
189- token_interface:: burn ( cpi_context, amount)
190- }
191-
192140pub fn validate_mint_fee ( account_info : & AccountInfo ) -> Result < ( ) > {
193141 let mint_data = account_info. try_borrow_data ( ) ?;
194142 let mint_with_extension = StateWithExtensions :: < MintInner > :: unpack ( & mint_data) ?;
0 commit comments