You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// we constrain the `metadata` account in every case.
168
+
// 1. if mint is token-2022 with embedded metadata, we return that metadata (in this case, `metadata` == `mint`. `token_metadata_parser` ensures this)
169
+
// 2. if mint is token-2022 with external metadata pointer, we verify `metadata` matches the pointer
170
+
// a. if `metadata` is owned by spl-token-metadata, we verify the pda and deserialise it as standard Metaplex metadata
171
+
// b. if `metadata` is not owned by spl-token-metadata, we don't verify that it's a pda (we know it matches the pointer already)
172
+
// 3. if mint doesn't include a metadata pointer, we ensure `metadata` is the metaplex pda.
173
+
// this is the legacy case, but it applies to token2022 tokens as well (that have no metadata pointer extension)
174
+
//
175
+
// Note that in every case other than 1 (which is a well-defined spec via
176
+
// the token metadata extension), we parse the `metadata` account following
177
+
// the standard metaplex format.
178
+
//
179
+
// In case of 2b, this is a best-effort guess, because the metadata pointer
180
+
// extension makes no guarantees about the shape of the metadata account. However, a common practice is to just follow the metaplex format.
181
+
// What this means is that if the metadata account is not owned by the metaplex program, and is not in the metaplex format, the deserialisation will fail.
0 commit comments