Hi all - I have been battling this error for 3 weeks now. I have searched all over with regards to this error to no avail. The error appears on the first line below. I had first assumed it was due to the function in question appearing more than once on the contract and in the abi so I even went to the abi and renamed the function in question as it contains an internalType that distinguishes it from the other function of the same name. The function definitely exists I have checked spelling etc. With this information could anyone direct me as to what the error might mean. When I change the function to one that appears once on the contract I receive no errors. Kindly direct me.
const txData = contractAddress.methods.function().encodeABI()
const gasPrice = await web3.eth.getGasPrice()
const permitTX = {
from: initiator,
to: contractAddress,
nonce: web3.utils.toHex(initiatorNonce),
gasLimit: web3.utils.toHex(98000),
gasPrice: web3.utils.toHex(Math.floor(Number(gasPrice * (BigInt(13)/BigInt(10))))),
value: "0x",
data: txData
}
const signedPermitTX = await web3.eth.accounts.signTransaction(permitTX, initiatorPK)
web3.eth.sendSignedTransaction(signedPermitTX.rawTransaction)