Polygon (Matic) web3 transaction gets stuck

1k Views Asked by At

I'm sending through web3 a transaction to QuickSwap (polygon) yet it gets stuck and it won't go through. This is the code I'm using:

const Web3 = require('web3')
const HDWalletProvider = require('@truffle/hdwallet-provider');
var provider = new HDWalletProvider(privateKey, rpcEndpoint);

const init = async () => {
    const QuickSwap = new web3.eth.Contract(contracts.QuickSwap.ABI, contracts.QuickSwap.address)
    const path = ["0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270", "0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619"]

    await QuickSwap.methods.swapExactETHForTokens(0, path, addr, "999999999999999999999999999999999999999999999").send({
        value: "10000000000000",
        from: addr,
        gasPrice: "25"
    }).on('transactionHash', function(hash){
        console.log(hash)
    }).on('confirmation', () => {
        console.log("Transaction confirmed")
    })
}

This is the stuck transaction: https://polygonscan.com/tx/0x973d4e85c499a36e0f255afb801eeea3b5945e0e761a892e50f53f8d75f51c17

Is there any way I could solve this?

1

There are 1 best solutions below

0
On

There is no transaction representing this hash. So maybe this transaction never happened on the polygon.