Skip to content

Commit 81da8e5

Browse files
mikemaccanaclaude
andcommitted
Fix metadata: remove update_authority/mint from instruction data
spl-token-metadata-interface Initialize passes update_authority and mint as accounts, not instruction data. Only name/symbol/uri go in the data after the 8-byte discriminator. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 5d25100 commit 81da8e5

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

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

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,9 @@ pub fn handle_initialize(
145145
// instructions rather than simple opcode bytes.
146146
// Discriminator = sha256("spl_token_metadata_interface:initialize_account")[0..8]
147147
// = [210, 225, 30, 162, 88, 184, 77, 141]
148-
// Data: [discriminator(8), update_authority(32), mint(32),
149-
// name_len(u32 LE), name, symbol_len(u32 LE), symbol, uri_len(u32 LE), uri]
148+
// Data: [discriminator(8), name_len(u32 LE), name, symbol_len(u32 LE), symbol,
149+
// uri_len(u32 LE), uri]
150+
// (update_authority and mint are passed as accounts, not instruction data)
150151
// Accounts: [metadata(=mint, writable), update_authority(readonly),
151152
// mint(readonly), mint_authority(signer)]
152153
const MAX_META_IX: usize = 512;
@@ -155,11 +156,6 @@ pub fn handle_initialize(
155156
let discriminator: [u8; 8] = [210, 225, 30, 162, 88, 184, 77, 141];
156157
buf[pos..pos + 8].copy_from_slice(&discriminator);
157158
pos += 8;
158-
buf[pos..pos + 32].copy_from_slice(accounts.payer.to_account_view().address().as_ref());
159-
pos += 32;
160-
buf[pos..pos + 32]
161-
.copy_from_slice(accounts.mint_account.to_account_view().address().as_ref());
162-
pos += 32;
163159
buf[pos..pos + 4].copy_from_slice(&(name.len() as u32).to_le_bytes());
164160
pos += 4;
165161
buf[pos..pos + name.len()].copy_from_slice(name);

0 commit comments

Comments
 (0)