Skip to content

Error: Burn transaction has not been checkpointed as yet #358

Description

@Vatshayan

Discussed in #357

Originally posted by Shivam-Vatshayan September 29, 2022
I am trying to do withdrawal using Matic Plasma. but Getting error : Error: Burn transaction has not been checkpointed as yet.
Here is my code :

const burnTransaction = async (plasmaClient, txHash) => {
  try {
    const erc20TokenParent = plasmaClient.erc20(tokenParent, true);

    const burnResult = await erc20TokenParent.withdrawConfirm(txHash);
    const burnTxHash = await burnResult.getTransactionHash();
    const burnTxReceipt = await burnResult.getReceipt();
    console.log("Burn Receipt => ", burnTxReceipt);
    console.log("Hash => ", burnTxHash);

    const exitResult = await erc20TokenParent.withdrawExit();
    const finalTxHash = await exitResult.getTransactionHash();
    const finalTxReceipt = await exitResult.getReceipt();
    console.log("Final Transaction Receipt => ", finalTxReceipt);
    console.log("Hash => ", finalTxHash);
  } catch (error) {
    console.log(error);
  }
};

const execute = async () => {
  const plasmaClient = await getPlasmaClient();
  const erc20TokenChild = plasmaClient.erc20(token);
  const result = await erc20TokenChild.withdrawStart(amount);
  const txHash = await result.getTransactionHash();
  const receipt = await result.getReceipt();
  console.log("Withdrawal Start Receipt => ", receipt);
  console.log("Hash => ", txHash);
  console.log("BlockNumber=", receipt.blockNumber);

  setTimeout(burnTransaction, 1 * 60 * 1000, plasmaClient, txHash);
};

execute()
  .then(() => {
    console.log("transaction confirmed");
  })
  .catch((err) => {
    console.error("err", err);
  });

```</div>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions