Last active
May 24, 2022 07:43
-
-
Save alecchendev/c872ed76541b339ce3d71c72783c7d7b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// calling token program to burn some tokens | |
invoke( | |
&spl_token::instruction::burn( | |
&spl_token::id(), | |
user_token_account_ai.key, | |
vending_machine_mint.key, | |
&user.key, | |
&[], | |
price, | |
)?, | |
&[user_token_account_ai.clone(), vending_machine_mint.clone(), user.clone()], | |
)?; | |
// allocating data for a mint account | |
invoke_signed( | |
&system_instruction::create_account( | |
user.key, | |
pool_mint_ai.key, | |
rent::Rent::get()?.minimum_balance(mint_data_len), | |
mint_data_len as u64, | |
&spl_token::id(), | |
), | |
&[user.clone(), pool_mint_ai.clone(), system_program.clone()], | |
&[pool_mint_seeds], | |
)?; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment