EatTheBlocks Forum

Adding liquidity

Hello.I have problem adding liquidity.So first i created token and deployed with remix on BSC,then created pair mytoken/wbnb using the code from deploying liquidity pool video it was successful,but then i tried with code from the video to also add liquidity but it fails with TransferHelper: TRANSFER_FROM_FAILED i approved both token but it fails.Can someone help me ?

const pairAddress = await factory.createPair.call(‘0x786e79562cebed1cc30178e16ae4696790370ffb’, ‘0xae13d989daC2f0dEbFf460aC112a837C89BAa7cd’);
const tx = await factory.createPair(‘0x786e79562cebed1cc30178e16ae4696790370ffb’, ‘0xae13d989daC2f0dEbFf460aC112a837C89BAa7cd’); that’s snippet of how i created the pair

await router.addLiquidity(
token1.address,
token2.address,
10000,
1,
10000,
1,
admin,
Math.floor(Date.now() / 1000) + 60 * 10
); that’s the failing code