9

I am trying to create associated token accounts for SPL Transfers and I keep running into Provided Owner not allowed. I have never seen this error before and I am checking to make sure the token account is oncurve. Here is a sample transaction https://solscan.io/tx/272uxvnGqYUb9Ri8E7y5u5153oSCAvjrT1quE298kLS8tmhMp5Q9SNfYgrx1Lcv9L6bif4nUeKBRFRSeFPo75Ec9 The code to create the associated tokenaccount:

splToken.getOrCreateAssociatedTokenAccount(
      connection,
      keypair,
      mintPk,
      toWalletPk,
      false,
      'finalized',
      { skipPreflight: true, maxRetries: 100 },
      splToken.TOKEN_PROGRAM_ID,
      splToken.ASSOCIATED_TOKEN_PROGRAM_ID,
    ),
  );

Transaction log output:

> Program log: Create
> Program Associated Token Account Program  consumed 3709 of 200000 compute units
> Program returned error: Provided owner is not allowed

Any ideas what could be causing this? Seems like a new error.

6
  • Can you confirm that toWalletPk is a PublicKey and not a KeyPair
    – C.OG
    Commented Aug 7, 2022 at 17:56
  • Yep, this is the toWalletPk: const toWalletPk = new web3Js.PublicKey(toWallet);
    – 0xDon
    Commented Aug 7, 2022 at 19:36
  • how are you getting the toWallet?
    – john
    Commented Aug 7, 2022 at 20:41
  • 1
    Just a string of addresses i'm looping through, basically this just an NFT airdrop so its a list of holders of NFTs
    – 0xDon
    Commented Aug 7, 2022 at 20:59
  • 1
    ahh, are you sure that toWallet isn't an ATA already? Are you able to share an example public key?
    – C.OG
    Commented Aug 12, 2022 at 13:31

2 Answers 2

1

Because it's ATA 2BYpRXiHUkr83cZaj1acT4xcNwVC9xW4vr9NbWmG2DMm is closed by this transaction 53KbVo5VjtMd67pe9Wh9KsQiQowYLkKHsDfQKncPBCkA35KeFYYJ4tB2fCQ3nYEywH6zCpLLwHjHKoouchJmCv9o.

1
  • Don't see how this factors in here since this transaction is from today rather than what happened 18 days ago. Appreciate the answer tho.
    – 0xDon
    Commented Aug 26, 2022 at 0:04
1

Looks like you have allowOwnerOffCurve set to false. It should be set to true when you're creating an ATA whose owner is based on a PDA. I'm not sure if that's the case for the account in question, but the error you're getting is the same.

https://github.com/solana-labs/solana-program-library/blob/5d16d5b926cd677d40c3f207906085dd8f1a6aa5/token/js/src/actions/getOrCreateAssociatedTokenAccount.ts#L22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.