Skip to content

[Bug]: Direct buy failing with auctionHouse().buy( ... ). #1069

@pranav3714

Description

@pranav3714

Which package is this bug report for?

auction-house

Which Type of Package is this bug report for?

Rust Contract

Issue description

I tried to do the following:

  1. Created a listing with @metaplex-foundation/js 0.18.3:
const { receipt } = await minterplex.auctionHouse().list({
    auctionHouse,
    price: sol(0.0001),
    mintAccount: nft.mint.address,
    tokenAccount: nft.token.address,

}, {
    commitment: "finalized"
})
  1. And tried to buy the item by getting listing using the receipt id and passed it to .buy() mthod:
const directBuy = await metaplex.auctionHouse().buy({
    auctionHouse,
    listing,
    price: sol(0.0001),
    buyer: wallet
}, {
    commitment: "finalized",
    payer: wallet
})

Which is giving the the following error:

Relevant log output

file:///D:/vegavid/r&d/solana/metaplex/starter/node_modules/@metaplex-foundation/js/dist/esm/plugins/rpcModule/RpcClient.mjs:196
      return new FailedToSendTransactionError(error);
             ^

FailedToSendTransactionError: The transaction could not be sent successfully to the network. Please check the underlying error below for more details.

Source: RPC

Caused By: Error: failed to send transaction: Transaction simulation failed: Transaction results in an account (4) without insufficient funds for rent

Program Logs:
| Program hausS13jsjafwWwGqZTUQRmWyvyxn9EQpqMwV1PBBmk invoke [1]
| Program log: Instruction: Buy
| Program 11111111111111111111111111111111 invoke [2]
| Program 11111111111111111111111111111111 success
| Program log: Transfer 897840 lamports to the new account
| Program 11111111111111111111111111111111 invoke [2]
| Program 11111111111111111111111111111111 success
| Program log: Allocate space for the account 34XKtXrTW72gochfsdqDTKaTnEuj6xEeHh5pjdohR5nc
| Program 11111111111111111111111111111111 invoke [2]
| Program 11111111111111111111111111111111 success
| Program log: Assign the account to the owning program
| Program 11111111111111111111111111111111 invoke [2]
| Program 11111111111111111111111111111111 success
| Program log: Completed assignation!
| Program hausS13jsjafwWwGqZTUQRmWyvyxn9EQpqMwV1PBBmk consumed 80358 of 800000 compute units
| Program hausS13jsjafwWwGqZTUQRmWyvyxn9EQpqMwV1PBBmk success
| Program hausS13jsjafwWwGqZTUQRmWyvyxn9EQpqMwV1PBBmk invoke [1]
| Program log: Instruction: PrintBidReceipt
| Program log: Transfer 2763120 lamports to the new account
| Program 11111111111111111111111111111111 invoke [2]
| Program 11111111111111111111111111111111 success
| Program log: Allocate space for the account 4A69x4NSaXpY14Y76hEJzP4D6dVg6Pi9ug3yvBXXU2Ze
| Program 11111111111111111111111111111111 invoke [2]
| Program 11111111111111111111111111111111 success
| Program log: Assign the account to the owning program
| Program 11111111111111111111111111111111 invoke [2]
| Program 11111111111111111111111111111111 success
| Program log: Completed assignation!
| Program hausS13jsjafwWwGqZTUQRmWyvyxn9EQpqMwV1PBBmk consumed 40606 of 719642 compute units
| Program hausS13jsjafwWwGqZTUQRmWyvyxn9EQpqMwV1PBBmk success
| Program hausS13jsjafwWwGqZTUQRmWyvyxn9EQpqMwV1PBBmk invoke [1]
| Program log: Instruction: ExecuteSale
| Program log: cannot pay creator wdRDU179tJA4BbGuUphiVMMYLxs7mNgMzCrhiB8vVTt 0 lamports since balance violates rent exempt minimum
| Program 11111111111111111111111111111111 invoke [2]
| Program 11111111111111111111111111111111 success
| Program 11111111111111111111111111111111 invoke [2]
| Program 11111111111111111111111111111111 success
| Program ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL invoke [2]
| Program log: Create
| Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [3]
| Program log: Instruction: GetAccountDataSize
| Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 1622 of 574059 compute units
| Program return: TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA pQAAAAAAAAA=
| Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success
| Program 11111111111111111111111111111111 invoke [3]
| Program 11111111111111111111111111111111 success
| Program log: Initialize the associated token account
| Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [3]
| Program log: Instruction: InitializeImmutableOwner
| Program log: Please upgrade to SPL Token 2022 for immutable owner support
| Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 1405 of 567569 compute units
| Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success
| Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [3]
| Program log: Instruction: InitializeAccount3
| Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 4241 of 563687 compute units
| Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success
| Program ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL consumed 21793 of 580956 compute units
| Program ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL success
| Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [2]
| Program log: Instruction: Transfer
| Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 4735 of 554109 compute units
| Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success
| Program hausS13jsjafwWwGqZTUQRmWyvyxn9EQpqMwV1PBBmk consumed 135663 of 679036 compute units
| Program hausS13jsjafwWwGqZTUQRmWyvyxn9EQpqMwV1PBBmk success
| Program hausS13jsjafwWwGqZTUQRmWyvyxn9EQpqMwV1PBBmk invoke [1]
| Program log: Instruction: PrintPurchaseReceipt
| Program log: Transfer 2234160 lamports to the new account
| Program 11111111111111111111111111111111 invoke [2]
| Program 11111111111111111111111111111111 success
| Program log: Allocate space for the account G1uj4htG8GvUaJRZvzPGeosxaUVxBuE8v1ombWqFYuVK
| Program 11111111111111111111111111111111 invoke [2]
| Program 11111111111111111111111111111111 success
| Program log: Assign the account to the owning program
| Program 11111111111111111111111111111111 invoke [2]
| Program 11111111111111111111111111111111 success
| Program log: Completed assignation!
| Program hausS13jsjafwWwGqZTUQRmWyvyxn9EQpqMwV1PBBmk consumed 56638 of 543373 compute units
| Program hausS13jsjafwWwGqZTUQRmWyvyxn9EQpqMwV1PBBmk success

    at RpcClient.parseProgramError (file:///D:/vegavid/r&d/solana/metaplex/starter/node_modules/@metaplex-foundation/js/dist/esm/plugins/rpcModule/RpcClient.mjs:196:14)
    at RpcClient.sendTransaction (file:///D:/vegavid/r&d/solana/metaplex/starter/node_modules/@metaplex-foundation/js/dist/esm/plugins/rpcModule/RpcClient.mjs:66:18)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async RpcClient.sendAndConfirmTransaction (file:///D:/vegavid/r&d/solana/metaplex/starter/node_modules/@metaplex-foundation/js/dist/esm/plugins/rpcModule/RpcClient.mjs:91:23)
    ... 2 lines matching cause stack trace ...
    at async file:///D:/vegavid/r&d/solana/metaplex/starter/candy-machine.js:121:19 {
  source: 'rpc',
  sourceDetails: undefined,
  cause: SendTransactionError: failed to send transaction: Transaction simulation failed: Transaction results in an account (4) without insufficient funds for rent
      at Connection.sendEncodedTransaction (D:\vegavid\r&d\solana\metaplex\starter\node_modules\@solana\web3.js\lib\index.cjs.js:9113:13)
      at processTicksAndRejections (node:internal/process/task_queues:96:5)
      at async Connection.sendRawTransaction (D:\vegavid\r&d\solana\metaplex\starter\node_modules\@solana\web3.js\lib\index.cjs.js:9079:20)
      at async RpcClient.sendTransaction (file:///D:/vegavid/r&d/solana/metaplex/starter/node_modules/@metaplex-foundation/js/dist/esm/plugins/rpcModule/RpcClient.mjs:64:14)
      at async RpcClient.sendAndConfirmTransaction (file:///D:/vegavid/r&d/solana/metaplex/starter/node_modules/@metaplex-foundation/js/dist/esm/plugins/rpcModule/RpcClient.mjs:91:23)
      at async TransactionBuilder.sendAndConfirm (file:///D:/vegavid/r&d/solana/metaplex/starter/node_modules/@metaplex-foundation/js/dist/esm/utils/TransactionBuilder.mjs:111:22)
      at async Disposable.run (file:///D:/vegavid/r&d/solana/metaplex/starter/node_modules/@metaplex-foundation/js/dist/esm/utils/Disposable.mjs:18:14)
      at async file:///D:/vegavid/r&d/solana/metaplex/starter/candy-machine.js:121:19 {
    logs: [
      'Program hausS13jsjafwWwGqZTUQRmWyvyxn9EQpqMwV1PBBmk invoke [1]',
      'Program log: Instruction: Buy',
      'Program 11111111111111111111111111111111 invoke [2]',
      'Program 11111111111111111111111111111111 success',
      'Program log: Transfer 897840 lamports to the new account',
      'Program 11111111111111111111111111111111 invoke [2]',
      'Program 11111111111111111111111111111111 success',
      'Program log: Allocate space for the account 34XKtXrTW72gochfsdqDTKaTnEuj6xEeHh5pjdohR5nc',
      'Program 11111111111111111111111111111111 invoke [2]',
      'Program 11111111111111111111111111111111 success',
      'Program log: Assign the account to the owning program',
      'Program 11111111111111111111111111111111 invoke [2]',
      'Program 11111111111111111111111111111111 success',
      'Program log: Completed assignation!',
      'Program hausS13jsjafwWwGqZTUQRmWyvyxn9EQpqMwV1PBBmk consumed 80358 of 800000 compute units',
      'Program hausS13jsjafwWwGqZTUQRmWyvyxn9EQpqMwV1PBBmk success',
      'Program hausS13jsjafwWwGqZTUQRmWyvyxn9EQpqMwV1PBBmk invoke [1]',
      'Program log: Instruction: PrintBidReceipt',
      'Program log: Transfer 2763120 lamports to the new account',
      'Program 11111111111111111111111111111111 invoke [2]',
      'Program 11111111111111111111111111111111 success',
      'Program log: Allocate space for the account 4A69x4NSaXpY14Y76hEJzP4D6dVg6Pi9ug3yvBXXU2Ze',
      'Program 11111111111111111111111111111111 invoke [2]',
      'Program 11111111111111111111111111111111 success',
      'Program log: Assign the account to the owning program',
      'Program 11111111111111111111111111111111 invoke [2]',
      'Program 11111111111111111111111111111111 success',
      'Program log: Completed assignation!',
      'Program hausS13jsjafwWwGqZTUQRmWyvyxn9EQpqMwV1PBBmk consumed 40606 of 719642 compute units',
      'Program hausS13jsjafwWwGqZTUQRmWyvyxn9EQpqMwV1PBBmk success',
      'Program hausS13jsjafwWwGqZTUQRmWyvyxn9EQpqMwV1PBBmk invoke [1]',
      'Program log: Instruction: ExecuteSale',
      'Program log: cannot pay creator wdRDU179tJA4BbGuUphiVMMYLxs7mNgMzCrhiB8vVTt 0 lamports since balance violates rent exempt minimum',
      'Program 11111111111111111111111111111111 invoke [2]',
      'Program 11111111111111111111111111111111 success',
      'Program 11111111111111111111111111111111 invoke [2]',
      'Program 11111111111111111111111111111111 success',
      'Program ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL invoke [2]',
      'Program log: Create',
      'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [3]',
      'Program log: Instruction: GetAccountDataSize',
      'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 1622 of 574059 compute units',
      'Program return: TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA pQAAAAAAAAA=',
      'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success',
      'Program 11111111111111111111111111111111 invoke [3]',
      'Program 11111111111111111111111111111111 success',
      'Program log: Initialize the associated token account',
      'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [3]',
      'Program log: Instruction: InitializeImmutableOwner',
      'Program log: Please upgrade to SPL Token 2022 for immutable owner support',
      'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 1405 of 567569 compute units',
      'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success',
      'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [3]',
      'Program log: Instruction: InitializeAccount3',
      'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 4241 of 563687 compute units',
      'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success',
      'Program ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL consumed 21793 of 580956 compute units',
      'Program ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL success',
      'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [2]',
      'Program log: Instruction: Transfer',
      'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 4735 of 554109 compute units',
      'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success',
      'Program hausS13jsjafwWwGqZTUQRmWyvyxn9EQpqMwV1PBBmk consumed 135663 of 679036 compute units',
      'Program hausS13jsjafwWwGqZTUQRmWyvyxn9EQpqMwV1PBBmk success',
      'Program hausS13jsjafwWwGqZTUQRmWyvyxn9EQpqMwV1PBBmk invoke [1]',
      'Program log: Instruction: PrintPurchaseReceipt',
      'Program log: Transfer 2234160 lamports to the new account',
      'Program 11111111111111111111111111111111 invoke [2]',
      'Program 11111111111111111111111111111111 success',
      'Program log: Allocate space for the account G1uj4htG8GvUaJRZvzPGeosxaUVxBuE8v1ombWqFYuVK',
      'Program 11111111111111111111111111111111 invoke [2]',
      'Program 11111111111111111111111111111111 success',
      'Program log: Assign the account to the owning program',
      'Program 11111111111111111111111111111111 invoke [2]',
      'Program 11111111111111111111111111111111 success',
      'Program log: Completed assignation!',
      'Program hausS13jsjafwWwGqZTUQRmWyvyxn9EQpqMwV1PBBmk consumed 56638 of 543373 compute units',
      'Program hausS13jsjafwWwGqZTUQRmWyvyxn9EQpqMwV1PBBmk success'
    ]
  }
}

Priority this issue should have

Low (slightly annoying)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions