检查令牌是否为NFT,并确保它不是骗局。是否可以局部脱链?

发布于 2025-02-12 12:30:42 字数 567 浏览 0 评论 0原文

我试图了解Metaplex标准。在版本1.1中,已添加了token_standard添加到元数据中,在这种情况下,很容易检查薄荷是否可易于函数(在Metaplex的定义上)。

但是在版本1.0中,我需要检查mint_authority Mint帐户(可能代表NFT)。我的问题是:是否足以将其检查离链,还是我还必须确保该帐户存在并由令牌元数据拥有?

// assume that this mint has decimals = 0 and supply = 1.
let edition_pda = Pubkey::find_program_address(['metadata', token_metadata_program_id, mint_id, 'edition']);
if mint_authority == edition_pda {
  // This is NFT
} else {
  // This can be SCAM
}

也许我完全错了?

I am trying to understand metaplex standard. And in version 1.1 there was added filed token_standard to metadata acount and in that case it's easy to check if mint is fungible or not (in definition of metaplex).

But in version 1.0 I need to checked mint_authority filed of mint account (possible representing NFT). My question is: is it enough to check it off-chain or I must also ensure that this account exist and is owned by Token Metadata Program?

// assume that this mint has decimals = 0 and supply = 1.
let edition_pda = Pubkey::find_program_address(['metadata', token_metadata_program_id, mint_id, 'edition']);
if mint_authority == edition_pda {
  // This is NFT
} else {
  // This can be SCAM
}

Or maybe I am completely wrong?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

若言繁花未落 2025-02-19 12:30:42

由于Solana计划是无状态的,因此最好验证所有进出计划的内容

Since Solana Program's are stateless it is best to validate all the things in and out of your program

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文