This commit is contained in:
Hardhat Chad
2024-05-02 15:03:56 +00:00
parent 813006cc99
commit dc84a347e7
8 changed files with 47 additions and 7 deletions

View File

@@ -7,6 +7,13 @@ use crate::{
instruction::StakeArgs, loaders::*, MINT_ADDRESS, MINT_V1_ADDRESS, TREASURY, TREASURY_BUMP,
};
/// Upgrade allows a user to migrate a v1 token to a v2 token one-for-one. Its responsibilies include:
/// 1. Burns the v1 tokens.
/// 2. Mints an equivalent number of v2 tokens to the user.
///
/// Safety requirements:
/// - Upgrade is a permissionless instruction and can be called by any user.
/// - The provided beneficiary, mint, mint v1, sender, and token program must be valid.
pub fn process_upgrade<'a, 'info>(
_program_id: &Pubkey,
accounts: &'a [AccountInfo<'info>],