I am currently using ganache and forked mainnet to test if a transaction in advance will fail or not. I get error INSUFFICIENT_INPUT_AMOUNT
on ganache while the tx success on mainnet and observed that this occur if the sender eth balance is less than their input also if they use different token as input. How do I make it relative to the input value to avoid the error?
The snippet:
const localTx =
{
from: tx.from,
to: tx.to,
value: tx.value,
gasPrice: tx.gasPrice,
gasLimit: tx.gas,
input: tx.input,
};
await localWeb3.eth.sendTransaction(localTx)
.on('error', (err) => { console.log(err) })