Hello, I want to try adding a fee during the _transfer in my code, and I want to convert and retrieve it as BNB. However, I'm encountering the error "Unknown error: Execution reverted with reason: STF." on PancakeSwap. It suggests trying to increase slippage tolerance, but my slippage tolerance is set to 49%. I'm using BSC Testnet, and my router address is 0xD99D1c33F9fC3444f8101754aBC46c52416550D1. What could be the issue?

Here is my code https://pastecode.io/s/usw3enfc

Dec 24, 2023, 2:58 AM
_approve(address(this), address(this), tokenAmount);
why?
try swapping tokens to bnb before updating balances inside the transfer function
Dec 24, 2023, 3:13 AM
Yes, I noticed. I'm a bit sleep-deprived and feeling a bit down. I updated the code like this:

_approve(msg.sender, address(router), tokenAmount);

However, the issue still persists.
The issue still continues :(
Dec 24, 2023, 3:25 AM

© 2024 Draquery.com All rights reserved.