I am in bsc-testnet
and have 0.3 WBNB
in my wallet and I try to swap 0.1 WBNB
for USDT
with the function swapExactTokensForTokens()
Token1 = '0xae13d989daC2f0dEbFf460aC112a837C89BAa7cd'
Token2 = '0xeD24FC36d5Ee211Ea25A80239Fb8C4Cfd80f12Ee'
Pancakerouter = interface.IPancakeRouter01('0x9Ac64Cc6e4415144C455BD8E4837Fea55603e5c3')
Executeswap = Pancakerouter.swapExactTokensForTokens(
Web3.toWei(0.1, "ether"),
0,
[Token1,Token2],
account,
int(time.time()) + 10 * 600,
{"from": account, "gas_limit": 10000000, "allow_revert": True},
)
Executeswap.wait(1)
Here is my error and tx: VirtualMachineError: revert: TransferHelper::transferFrom: transferFrom failed
https://testnet.bscscan.com/tx/0x6c8a7b802863afc92f61195dc952de1cb21d9b65b6df4205d5ad2e4a6813ed36