Solana Metaplex Auction在验证depositboxv2指令中失败了“为空付款帐户提供无效的创建者索引”。

发布于 2025-01-21 11:21:24 字数 858 浏览 1 评论 0原文

我正在将Metaplex拍卖室移植到Mobile Flutter上。

在以0.1包装的Sol创建拍卖时,我在 nativeateSafetyDepositBoxv2 指令的阶段遇到了以下错误。

该错误是“为空支付帐户提供了无效的创建者索引”,只有一个点可以打印此消息是Rust的 Process_empty_payment_acccount ()。

最奇怪的是, process_empty_payment_account 函数仅从 emptypaymentAccount 指令中调用,而我的程序没有称呼它。

知道发生了什么事吗?

实际错误日志:

I/flutter ( 2718):  {accounts: null, err: {InstructionError: [0, {Custom: 63}]}, logs: [Program p1exdMJcjVao65QdewkaZRUnU6VPSXhus9n2GzWfh98 invoke [1], Program log: Instruction: Validate Safety Deposit Box V2, Program log: Supplied an invalid creator index to empty payment account, Program p1exdMJcjVao65QdewkaZRUnU6VPSXhus9n2GzWfh98 consumed 11849 of 200000 compute units, Program p1exdMJcjVao65QdewkaZRUnU6VPSXhus9n2GzWfh98 failed: custom program error: 0x3f], unitsConsumed: 0}

I'm porting metaplex auction-house to Flutter mobile.

When creating auction with instant sale price of 0.1 wrapped sol, I have encountered the following error at the stage of ValidateSafetyDepositBoxV2 instruction.

The error was "Supplied an invalid creator index to empty payment account" and there is only one point where this message can be printed is Rust's process_empty_payment_account().

The most weird thing is that process_empty_payment_account function is called only from EmptyPaymentAccount instruction and my program didn't call it.

any idea what's happening?

Actual error log:

I/flutter ( 2718):  {accounts: null, err: {InstructionError: [0, {Custom: 63}]}, logs: [Program p1exdMJcjVao65QdewkaZRUnU6VPSXhus9n2GzWfh98 invoke [1], Program log: Instruction: Validate Safety Deposit Box V2, Program log: Supplied an invalid creator index to empty payment account, Program p1exdMJcjVao65QdewkaZRUnU6VPSXhus9n2GzWfh98 consumed 11849 of 200000 compute units, Program p1exdMJcjVao65QdewkaZRUnU6VPSXhus9n2GzWfh98 failed: custom program error: 0x3f], unitsConsumed: 0}

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

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

发布评论

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

评论(1

夜声 2025-01-28 11:21:24

我发现了为什么在Rust程序中部署了一些日志的新程序后出现了该错误的原因。正是我将元数据地址的错误价值作为第四个帐户。

pub fn process_validate_safety_deposit_box_v2<'a>(
    program_id: &'a Pubkey,
    accounts: &'a [AccountInfo<'a>],
    safety_deposit_config: SafetyDepositConfig,
) -> ProgramResult {
    let account_info_iter = &mut accounts.iter();
    let safety_deposit_config_info = next_account_info(account_info_iter)?;
    let auction_token_tracker_info = next_account_info(account_info_iter)?;
    let mut auction_manager_info = next_account_info(account_info_iter)?;
    *let metadata_info = next_account_info(account_info_iter)?;*
....

因此,该程序在metadata :: try_from_slice_checked上失败,并在以下代码上返回InvalidCreatorIndex的错误。

impl Metadata {
    pub fn from_account_info(a: &AccountInfo) -> Result<Metadata, ProgramError> {
        let md: Metadata =
            try_from_slice_checked(&a.data.borrow_mut(), Key::MetadataV1, MAX_METADATA_LEN)?;
        Ok(md)
    }
}

可惜代码没有给出更复杂的错误。

I found the reason why that error was given after deploying a new program with some logs to the rust program. It was that I passed the wrong value for the metadata's address as the 4th account.

pub fn process_validate_safety_deposit_box_v2<'a>(
    program_id: &'a Pubkey,
    accounts: &'a [AccountInfo<'a>],
    safety_deposit_config: SafetyDepositConfig,
) -> ProgramResult {
    let account_info_iter = &mut accounts.iter();
    let safety_deposit_config_info = next_account_info(account_info_iter)?;
    let auction_token_tracker_info = next_account_info(account_info_iter)?;
    let mut auction_manager_info = next_account_info(account_info_iter)?;
    *let metadata_info = next_account_info(account_info_iter)?;*
....

So, the program failed at Metadata::try_from_slice_checked and returns error of InvalidCreatorIndex at the following code.

impl Metadata {
    pub fn from_account_info(a: &AccountInfo) -> Result<Metadata, ProgramError> {
        let md: Metadata =
            try_from_slice_checked(&a.data.borrow_mut(), Key::MetadataV1, MAX_METADATA_LEN)?;
        Ok(md)
    }
}

It's a pity that the code didn't give a more elaborate error.

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