Search code examples
solananftmetaplex

Bad ATA account


When using metaplex auction-house contract, some users are unable to complete a sell command. Confirmed that if the same NFT is sent to a different wallet, that wallet can sell just fine.

The issue seems to be bad ATA. Initially , the ATA account that returned via https://github.com/metaplex-foundation/metaplex/blob/b7760611d0838307757b831505eaaffee25b1b2a/js/packages/cli/src/auction-house-cli.ts#L260 didn't have owner or token inside.

See failure: https://explorer.solana.com/tx/4Y6ZBqeWH1yFvaEJ2Hv6mkCxqdVNt9GQ9iHq15PoJY5JVxmTzHJx3MSKABchMBaY3Jd5WY4HpeN4a9bSTQKEJv1Z

When sent to another wallet, was able to complete just fine. https://explorer.solana.com/tx/GUybhU53qY56bu4j2raQyp7uecGLgaFge6GBvRNtX1u8gqDzocKk8MDg52upZV985UPW8FAregpwTv7JGyWdNwf

After manually setting up the ATA, still didn't help. https://explorer.solana.com/address/Cu6Dru1j6PZa3f9K2acuqsHcaVDRxniFVqPPk7WX7RaC

Seems like due toe the token being 0.

Tried finding the correct ATA by using getTokenLargestAccounts but then I'm getting 0x12c which says PublicKeyMismatch.

Would love some help in finding a stable way to complete this, this is happening to many users sporadically.


Solution

  • The code that you linked, getATAForMint, does not actually create the ATA, which is why owner and token weren't populated.

    The succeeding transaction that you linked correctly creates the ATA, which is why it succeeds.

    So one way to resolve this is: