You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Candy Machine mintV2问题:铸币费用与设置值不符

Candy Machine铸币价格与设置不符问题排查

在Devnet环境下通过Candy Machine铸造NFT时,已将Sol payment guard的铸币价格设置为0.6 SOL,但实际铸币时始终仅收取约0.02 SOL,与设置值不符。使用MintV2指令铸币时,所有NFT均出现该错误收费情况。

相关截图:
铸币费用错误截图1
铸币费用错误截图2

问题代码实现

const nftMint =  generateSigner(props.umi)  
const transaction = await transactionBuilder()
  .add(setComputeUnitLimit(props.umi, { units: 800_000 }))
  .add(
    mintV2(props.umi, {
      candyMachine: candyMachine.publicKey,
      candyGuard: candyGuard.publicKey,
      nftMint,
      collectionMint:props.mintedNft.collectionMintId,
      collectionUpdateAuthority:props.mintedNft.collectionUpdateAuthorityId,
        mintArgs: {
          mintLimit: some({ id: 1 }),
          solPayment: some({destination: candyMachine.authority }),
      },
    })
  )
 
const { signature } = await transaction.sendAndConfirm(props.umi, {
  confirm: { commitment: "confirmed" },
});

问题原因及解决方法

核心问题是调用mintV2时的solPayment参数未传入amount值,导致Candy Machine未使用你配置的0.6 SOL铸币价格,转而使用默认值或无效值,最终出现异常收费。

解决步骤:

  1. 在mintArgs.solPayment中显式传入匹配配置的金额
    需要将0.6 SOL转换为Solana原生的lamports单位(1 SOL = 1e9 lamports),可以通过Umi的sol工具函数快速转换。修改后的代码如下:

    mintArgs: {
      mintLimit: some({ id: 1 }),
      solPayment: some({
        destination: candyMachine.authority,
        amount: props.umi.helpers.sol(0.6) // 等价于直接传入600000000
      }),
    },
    
  2. 验证Candy Guard的配置正确性
    使用Metaplex CLI确认Sol Payment Guard的金额是否确实设置为0.6 SOL:

    metaplex candy-guards show --candy-guard <你的Candy Guard地址> --env devnet
    

    输出中需确保solPayment的amount字段值为600000000(对应0.6 SOL)。

内容的提问来源于stack exchange,提问作者omairhasan17

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.27 23:03:19