I want to swap a token to BNB
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
I do not know what to put on calldata path
, I've tried this
path
{
tokenContractAddres,
wBNBAdress
}
And when I do a manual swap on pancakeSwap and check the input data , it basically does this, I've search around , it looks like I have to approve it first, when I look at the transaction hash it shows that approve takes an address (the pancake router) and a uint256
So my questions are:
- In the approve function what goes in the uint256 argument?
- After the approve function, how do I get the calldata path for the
swapExactTokensForETHSupportingFeeOnTransferTokens
function?