Browse Source

add comment before initializing extension

Valentin Madrid 2 years ago
parent
commit
c3b313f3d8

+ 3 - 0
tokens/token-2022/default-account-state/native/program/src/lib.rs

@@ -54,6 +54,7 @@ fn process_instruction(
     let rent_required = Rent::get()?.minimum_balance(space);
 
     // Create the account for the Mint and allocate space
+
     msg!("Mint account address : {}", mint_account.key);
     invoke(
         &system_instruction::create_account(
@@ -71,6 +72,8 @@ fn process_instruction(
         ],
     )?;
 
+    // This needs to be done before the Mint is initialized
+
     // Initialize the Default Account State as Frozen
     invoke(
         &initialize_default_account_state(

+ 2 - 0
tokens/token-2022/mint-close-authority/native/program/src/lib.rs

@@ -62,6 +62,8 @@ fn process_instruction(
         ],
     )?;
 
+    // This needs to be done before the Mint is initialized
+
     // Initialize the Mint close authority Extension
     invoke(
         &token_instruction::initialize_mint_close_authority(

+ 1 - 1
tokens/token-2022/multiple-extensions/native/program/src/lib.rs

@@ -65,7 +65,7 @@ fn process_instruction(
         ],
     )?;
 
-    // Here, let's enable two extensions for the Mint.
+    // Here, let's enable two extensions for the Mint. This needs to be done before the Mint is initialized
 
     // Initialize the Mint close authority Extension
     invoke(

+ 2 - 0
tokens/token-2022/non-transferable/native/program/src/lib.rs

@@ -61,6 +61,8 @@ fn process_instruction(
         ],
     )?;
 
+    // This needs to be done before the Mint is initialized
+
     // Initialize the Non Transferable Mint Extension
     invoke(
         &token_instruction::initialize_non_transferable_mint(token_program.key, mint_account.key)

+ 1 - 0
tokens/token-2022/transfer-fees/native/program/src/lib.rs

@@ -71,6 +71,7 @@ fn process_instruction(
     // The max fee will be 5 tokens, here we adjust it with the tokens decimals
     let max_fee = 5 * 10u64.pow(args.token_decimals as u32);
 
+    // This needs to be done before the Mint is initialized
     // Initialize the Transfer Fee config
     invoke(
         &initialize_transfer_fee_config(