diff --git a/programs/token/src/instructions/initialize_account_2.rs b/programs/token/src/instructions/initialize_account_2.rs index 430d9e9..9ca72c7 100644 --- a/programs/token/src/instructions/initialize_account_2.rs +++ b/programs/token/src/instructions/initialize_account_2.rs @@ -42,8 +42,8 @@ impl<'a> InitilizeAccount2<'a> { ]; // instruction data - // - [0]: instruction discriminator - // - [1..33]: owner + // - [0]: instruction discriminator (1 byte, u8) + // - [1..33]: owner (32 bytes, Pubkey) let mut instruction_data = [UNINIT_BYTE; 33]; // Set discriminator as u8 at offset [0] diff --git a/programs/token/src/instructions/initialize_account_3.rs b/programs/token/src/instructions/initialize_account_3.rs index 6a573c5..f3dc433 100644 --- a/programs/token/src/instructions/initialize_account_3.rs +++ b/programs/token/src/instructions/initialize_account_3.rs @@ -38,8 +38,8 @@ impl<'a> InitilizeAccount3<'a> { ]; // instruction data - // - [0]: instruction discriminator - // - [1..33]: owner + // - [0]: instruction discriminator (1 byte, u8) + // - [1..33]: owner (32 bytes, Pubkey) let mut instruction_data = [UNINIT_BYTE; 33]; // Set discriminator as u8 at offset [0] diff --git a/programs/token/src/instructions/initialize_mint.rs b/programs/token/src/instructions/initialize_mint.rs index 1e91c89..3cf1fa3 100644 --- a/programs/token/src/instructions/initialize_mint.rs +++ b/programs/token/src/instructions/initialize_mint.rs @@ -42,11 +42,11 @@ impl<'a> InitilizeMint<'a> { ]; // Instruction data layout: - // - [0]: instruction discriminator - // - [1]: decimals - // - [2..34]: mint_authority - // - [34]: freeze_authority presence flag - // - [35..68]: freeze_authority + // - [0]: instruction discriminator (1 byte, u8) + // - [1]: decimals (1 byte, u8) + // - [2..34]: mint_authority (32 bytes, Pubkey) + // - [34]: freeze_authority presence flag (1 byte, u8) + // - [35..67]: freeze_authority (optional, 32 bytes, Pubkey) let mut instruction_data = [UNINIT_BYTE; 67]; // Set discriminator as u8 at offset [0] diff --git a/programs/token/src/instructions/initialize_mint_2.rs b/programs/token/src/instructions/initialize_mint_2.rs index 6a53ca5..51954be 100644 --- a/programs/token/src/instructions/initialize_mint_2.rs +++ b/programs/token/src/instructions/initialize_mint_2.rs @@ -36,11 +36,11 @@ impl<'a> InitilizeMint2<'a> { let account_metas: [AccountMeta; 1] = [AccountMeta::writable(self.mint.key())]; // Instruction data layout: - // - [0]: instruction discriminator - // - [1]: decimals - // - [2..34]: mint_authority - // - [34..35]: freeze_authority presence flag - // - [35..67]: freeze_authority + // - [0]: instruction discriminator (1 byte, u8) + // - [1]: decimals (1 byte, u8) + // - [2..34]: mint_authority (32 bytes, Pubkey) + // - [34]: freeze_authority presence flag (1 byte, u8) + // - [35..67]: freeze_authority (optional, 32 bytes, Pubkey) let mut instruction_data = [UNINIT_BYTE; 67]; // Set discriminator as u8 at offset [0] diff --git a/programs/token/src/instructions/mint_to.rs b/programs/token/src/instructions/mint_to.rs index f0da1d4..e0036db 100644 --- a/programs/token/src/instructions/mint_to.rs +++ b/programs/token/src/instructions/mint_to.rs @@ -42,8 +42,8 @@ impl<'a> MintTo<'a> { ]; // Instruction data layout: - // - [0]: instruction discriminator - // - [1..9]: amount + // - [0]: instruction discriminator (1 byte, u8) + // - [1..9]: amount (8 bytes, u64) let mut instruction_data = [UNINIT_BYTE; 9]; // Set discriminator as u8 at offset [0] diff --git a/programs/token/src/instructions/mint_to_checked.rs b/programs/token/src/instructions/mint_to_checked.rs index 67d0608..32e30b6 100644 --- a/programs/token/src/instructions/mint_to_checked.rs +++ b/programs/token/src/instructions/mint_to_checked.rs @@ -44,9 +44,9 @@ impl<'a> MintToChecked<'a> { ]; // Instruction data layout: - // - [0]: instruction discriminator - // - [1..9]: amount - // - [9]: decimals + // - [0]: instruction discriminator (1 byte, u8) + // - [1..9]: amount (8 bytes, u64) + // - [9]: decimals (1 byte, u8) let mut instruction_data = [UNINIT_BYTE; 10]; // Set discriminator as u8 at offset [0] diff --git a/programs/token/src/instructions/set_authority.rs b/programs/token/src/instructions/set_authority.rs index a658349..2ded29b 100644 --- a/programs/token/src/instructions/set_authority.rs +++ b/programs/token/src/instructions/set_authority.rs @@ -52,9 +52,10 @@ impl<'a> SetAuthority<'a> { ]; // instruction data - // - [0]: instruction discriminator - // - [1]: authority_type - // - [2..35] new_authority + // - [0]: instruction discriminator (1 byte, u8) + // - [1]: authority_type (1 byte, u8) + // - [2]: new_authority presence flag (1 byte, AuthorityType) + // - [3..35] new_authority (optional, 32 bytes, Pubkey) let mut instruction_data = [UNINIT_BYTE; 35]; // Set discriminator as u8 at offset [0] diff --git a/programs/token/src/instructions/transfer.rs b/programs/token/src/instructions/transfer.rs index 027b139..ad58ce1 100644 --- a/programs/token/src/instructions/transfer.rs +++ b/programs/token/src/instructions/transfer.rs @@ -41,8 +41,8 @@ impl<'a> Transfer<'a> { ]; // Instruction data layout: - // - [0]: instruction discriminator - // - [1..9]: amount + // - [0]: instruction discriminator (1 byte, u8) + // - [1..9]: amount (8 bytes, u64) let mut instruction_data = [UNINIT_BYTE; 9]; // Set discriminator as u8 at offset [0] diff --git a/programs/token/src/instructions/transfer_checked.rs b/programs/token/src/instructions/transfer_checked.rs index 3ebe826..c4ded10 100644 --- a/programs/token/src/instructions/transfer_checked.rs +++ b/programs/token/src/instructions/transfer_checked.rs @@ -47,9 +47,9 @@ impl<'a> TransferChecked<'a> { ]; // Instruction data layout: - // - [0]: instruction discriminator - // - [1..9]: amount - // - [9]: decimals + // - [0]: instruction discriminator (1 byte, u8) + // - [1..9]: amount (8 bytes, u64) + // - [9]: decimals (1 byte, u8) let mut instruction_data = [UNINIT_BYTE; 10]; // Set discriminator as u8 at offset [0]