i got transfer amount exceeds allowance when call transferFrom to ERC20, i already call approve first and already wait until the approve success..but when i call transferFrom, i got the error.
const wdAmount = ethers.utils.parseUnits(trx, 6)
var ab = await erc20.approve(senderWallet, wdAmount).then(async response => {
var ac = await response.wait();
var approveHash = response.hash;
var tf = erc20.transferFrom(senderWallet, accounts[0], wdAmount).then(response =>{
console.log(response)
}).catch(err => {
console.log(err)
})
}).catch(err => {
console.log(err)
alert('Transaction canceled');
})
maybe something wrong with my code, i hopeless right now.