I don’t understand what the error is, when you execute the ZapInToken function with a pair of Cake/WBNB or Cake/USDT tokens, everything is completed successfully.
If you take a pair with a commission of 5% (pancakeswap), it returns the error:
Gas estimation errored with the following message (see below).
The transaction execution will likely fail.
Do you want to force sending?
Returned error: {"jsonrpc":"2.0","error":"execution reverted","id":2392006384191628}"
Despite the fact that the contract has the SetFee function and I set the required commission there.
I tried to change the commission size using the SetFee function, approving everything was done, the number of tokens was also sufficient.