The problem can be with checkpointed time. when you run this script it gives an error because the burn process takes some time, I suggest that you make a delay logic and keep checking if the burn tx is checkpointed before continuing the process.
Visit documentation: https://wiki.polygon.technology/docs/develop/ethereum-polygon/matic-js/pos/is-check-pointed/
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article