I have deployed a Flash Loan Arbitrage smart contract on BSC Testnet. I then loaded 1 BNB on smart contract now when I call a function of Smart Contract it gives me the following error.
"Gas estimation errored with the following message (see below). The transaction execution will likely fail. Do you want to force sending? Internal JSON-RPC error. { "code": -32000, "message": "execution reverted" }"
function startArbitrage(
address token0,
address token1,
uint amount0,
uint amount1
) external {
address pairAddress = IUniswapV2Factory(pancakeFactory).getPair(token0, token1);
emit test_value(pairAddress); // log the current value
require(pairAddress != address(0), 'This pool does not exist');
IUniswapV2Pair(pairAddress).swap(
amount0,
amount1,
address(this),
bytes('not empty')
);
}