0

I'm trying to create an instruction to transfer an OCP standard token.

I'm using Magic Eden's OSS sdk --> https://github.com/magiceden-oss/open_creator_protocol

Here is the call being made:

const transferIx = createTransferInstruction({
        policy: policy,
        freezeAuthority: freezeAuth,
        mint: mint,
        metadata: metadata,
        mintState: mintState,
        from: from,
        fromAccount: senderAccount,
        cmtProgram: CMT_PROGRAM,
        instructions: SYSVAR_INSTRUCTIONS_PUBKEY,
        to: to,
        toAccount: receiverAccount,
    });

It is returning the instructions, which I then send to appended to some other instructions, partially sign and returned to then be signed by a wallet adapter.

Tx simulation fails and is spitting out custom program error 0xbc4, error processing instruction 0 (which is the interaction with the OCP on chain program (ocp4vWUzA2z2XMYJ3QhM9vWdyoyoQwAFJhRdVTbvo9E))

The policy publickey is being retrieved using a function as shown below...

export const findPolicyPk = (uuid: PublicKey) => {
    return PublicKey.findProgramAddressSync(
        [utils.bytes.utf8.encode("policy"), uuid.toBuffer()],
        PROGRAM_ID
    )[0];
};

To be honest, I'm passing in the token mint address to this function, but am not sure if I'm supposed to... I can't find documentation on what the uuid should be other than a publickey.

This policy is then used to find the freeze authority publickey like this...

export const findFreezeAuthorityPk = (policy: PublicKey) => {
    return PublicKey.findProgramAddressSync([policy.toBuffer()], CMT_PROGRAM)[0];
};

Sending the token in the wallet and then viewing the transaction on an explorer shows different publickeys for the Policy and FreezeAuthority. I've also entered those directly passing in the string to the new PublicKey() object creator...

pls help.

0

Your Answer

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