Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

distributeformint gives error 6012 #15

Open
krishnawinit opened this issue Mar 19, 2022 · 12 comments
Open

distributeformint gives error 6012 #15

krishnawinit opened this issue Mar 19, 2022 · 12 comments

Comments

@krishnawinit
Copy link

Hi technical geeks, I need help in calling hydra SDK. I am able to sucessfully send airdrop of SOL but when I try using sending SPl20 token with the below given reference code I get error:
{InstructionError: Array(2)}InstructionError: Array(2)0: 11: {Custom: 6012}length: 2[[Prototype]]: Array(0)[[Prototype]]: Object

@austbot
Copy link
Contributor

austbot commented Mar 23, 2022

@krishnawinit can you please send in your code or a transaction example

@krishnawinit
Copy link
Author

async function airdropToken() {
        let i= 0;
        let instr = [];
        let mint = {publicKey: new PublicKey("8LBhhVDsAWbH4WN11Qg2DMc9GTFszLyTbpVEZnCGGi5F")};
        await connection.requestAirdrop(distributionBot.publicKey,2*LAMPORTS_PER_SOL);
        while(i<5) {
            let distributeToMember1 = await fanoutSdk.distributeWalletMemberInstructions(
                {
                    distributeForMint: true,
                    member: wallets[i],
                    fanout: initvar.fanout, // From initialization
                    payer: authority.publicKey,
                    fanoutMint: mint.publicKey,
                },
            );
            instr.push(...distributeToMember1.instructions);
            i++;
        }
        const tx = await fanoutSdk.sendInstructions(
            instr,
            [authority],
            authority.publicKey
        );
        const txdetails = await connection.confirmTransaction(tx.TransactionSignature)
        console.log(txdetails, tx.RpcResponseAndContext.value.err);
        setBalance(await connection.getBalance(distributionBot.publicKey)/LAMPORTS_PER_SOL);
        
}

@krishnawinit
Copy link
Author

Here is the code thanks for reply

@staccDOTsol
Copy link
Collaborator

I don't think either devnet or testnet allows you to airdrop anything >1, haven't for awhile

which line errors?

@krishnawinit
Copy link
Author

const tx = await fanoutSdk.sendInstructions(
            instr,
            [authority],
            authority.publicKey
        );

@krishnawinit
Copy link
Author

it is giving error 6012

@staccDOTsol
Copy link
Collaborator

staccDOTsol commented Mar 24, 2022

are you in cli pr browser? I forget what the error I had earlier was but if you're in browser

        [authority],

not need this, it'll inject signature if you do

[],

instead

@staccDOTsol
Copy link
Collaborator

6012 13th error

IncorrectOwner,

dunno that doesn't help all that much

@krishnawinit
Copy link
Author

didnt get you
with authority still getting incorrect owner

@krishnawinit
Copy link
Author

array of 1 one instruction

@austbot
Copy link
Contributor

austbot commented Apr 3, 2022

sorry for the delay here looking into this

@austbot
Copy link
Contributor

austbot commented Apr 10, 2022

you are airdropping to the distrobution bot not the authority
check to make sure these things are true about your code

what is your membership model?

    assert_owned_by(&fanout_for_mint, &crate::ID)?;
    assert_owned_by(&fanout_mint_member_token_account_info, &Token::id())?;
    assert_owned_by(holding_account, &anchor_spl::token::Token::id())?;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants