Skip to content

Commit a8f816e

Browse files
mikemaccanaclaude
andcommitted
Fix metadata quasar: use opcode 45 for TokenMetadataExtension
In token-2022 v7: opcode 44 = PausableExtension, 45 = TokenMetadataExtension. Previous code used 44 which was being dispatched to PausableInstruction::Initialize. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent f4311a4 commit a8f816e

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

  • tokens/token-2022/metadata/quasar/src

tokens/token-2022/metadata/quasar/src/lib.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,15 +140,16 @@ pub fn handle_initialize(
140140
)
141141
.invoke()?;
142142

143-
// TokenMetadataInitialize: TokenInstruction::TokenMetadataExtension = 44, sub = 0
144-
// Data: [44, 0, update_authority(32), mint(32),
143+
// TokenMetadataInitialize: TokenInstruction::TokenMetadataExtension = 45, sub = 0
144+
// Data: [45, 0, update_authority(32), mint(32),
145145
// name_len(u32 LE), name, symbol_len(u32 LE), symbol, uri_len(u32 LE), uri]
146146
// Accounts: [metadata(=mint, writable), update_authority(readonly),
147147
// mint(readonly), mint_authority(signer)]
148+
// In token-2022 v7: 44=PausableExtension, 45=TokenMetadataExtension
148149
const MAX_META_IX: usize = 512;
149150
let mut buf = [0u8; MAX_META_IX];
150151
let mut pos = 0usize;
151-
buf[pos] = 44;
152+
buf[pos] = 45;
152153
pos += 1;
153154
buf[pos] = 0;
154155
pos += 1;

0 commit comments

Comments
 (0)