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

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

Open
Vatshayan opened this issue Oct 3, 2022 Discussed in #357 · 1 comment
Open

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

Vatshayan opened this issue Oct 3, 2022 Discussed in #357 · 1 comment

Comments

@Vatshayan
Copy link

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>
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

2 participants
@Vatshayan and others