I am trying to make a trade using the following method. The contract is already deployed on the blockchain and makes dual swap using two dexes
console.log('>>>>>>>>>>>>>>>>> Making Trade >>>>>>>>>>>>>>>>>>>>>>')
const tx = await attArb.connect(admin).duelDexTrade(router1,router2,token1,token2,amount,
{
gasPrice: ethers.utils.parseUnits('200', 'gwei'),
gasLimit: 1000000
}
)
The trouble is, when ever I specify gasPrice & gasLimit, transaction fails with the error:
Trade Failed. Error: transaction failed [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ]
it doesn't matter even if I specify one of them. But on block chain explorer, both gasPrice & gasLimit is set according to values I have passesd.
when both gasPrice & gasLimit is removed, the method works as intended. But I want to give it a high priority by defining a higher gas price. I am using ethers js and HH. What is wrong with this code or any specific reason this is happening?