I have a token whose mint address is a PDA, i.e. the token is completely program-controlled.
That's why, in order to add metadata, I have to use create_metadata_accounts_v3
in Rust.
See the full code here.
After some initial hiccups and awesome help from the community, I was finally get it working on Devnet.
So I was excited to try on Mainnet, only to get this error:
Sets the token metadata:
Error: failed to send transaction: Transaction simulation failed: Error processing Instruction 0: Failed to serialize or deserialize account data: Unknown
at Connection.sendEncodedTransaction (node_modules/@solana/web3.js/lib/index.cjs.js:7891:13)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Connection.sendRawTransaction (node_modules/@solana/web3.js/lib/index.cjs.js:7848:20)
at async sendAndConfirmRawTransaction (node_modules/@project-serum/anchor/dist/cjs/provider.js:172:23)
at async AnchorProvider.sendAndConfirm (node_modules/@project-serum/anchor/dist/cjs/provider.js:88:20)
at async MethodsBuilder.rpc [as _rpcFn] (node_modules/@project-serum/anchor/dist/cjs/program/namespace/rpc.js:15:24)
at async Context.<anonymous> (tests/tokmeta.js:28:5)
Basically, it boils down to Failed to serialize or deserialize account data: Unknown
. I am doing the EXACT same thing as on Devnet. All the accounts exist, in both Devnet and Mainnet, like payer, update authority, mint, mint authority.
The metadata account does NOT exist on both networks, and it get created nicely on Devnet. The payer account has enough funds.
What am I doing wrong?