I know I'm over thinking this issue, but I cannot seem to figure out what to do. I have a smart contract for a BEP20 token. It's set up to convert the buy/sell taxes into BUSD instead of sending tokens to designated addresses. This is currently done with a threshold using SwapTokensAtAmount.
The problem is whatever the amount is set at (e.g., 100 tokens), it's currently swapping when it reaches 100 tokens but only converting 100 tokens instead of swapping all tokens in the contract balance. I've written it a few different ways and cannot figure out how to set the threshold to an amount, while ensuring that it swaps all tokens in the contract when a sale happens over that token amount. I tried using a boolean value for SwapAtTokenAmount, so that it executes SwapAllTokens in contractbalance, but I'm missing something.
I may not even need the threshold SwapTokensAtAmount if I wrote something for always dealing with SwapAllTokens whenever the sell transaction occurs.
Does someone mind looking at the contract I deployed and helping me identify the needed code to swapAllTokens instead of only the SwapTokensAtAmount value?
The code is verified in BSCscan: Contract Address 0x280abe1ef12e185503bc78afb3001308c66dbf20 | BscScan