Hey friend, for this you need to create a function to remove the bnb from the contract! As you did not write I believe that it is not possible to remove…
Even this is Safemoon’s auditing problem.
create a Whitdraw function.
`` `
function sendContractBalance (address payable to) public onlyOwner {
require (address (this) .balance> 0, "07");
to.transfer (address (this) .balance);
}
`` `
** Remembering that you need to deactivate the exchange and liquefy and approve the removal of the bnb from the contract and then write the contract to send the bnb balance to your address **
Spender: You put the address you are going to send, try putting the address of the wallet that owns the contract. Amount: put 1 to see if it goes all bnb.
3)Go to transfer from,
Sender: Here you enter the address of your contract. Recipient: Here you enter the address you approved in the case the wallet that owns the contract. Amount: 1
Try to do this, if not, repeat the same process for the Transfer function above.
It seems like @skynance really do a lot, really thanks!
Emmmm, I am not sure, but I think if you set swapAndLiquifyEnabled as false, maybe your token will lose the original intention, but it all depend on you.
Maybe you can add some more tokens( DAPCAT) to this contract, and then when you swap on the pancake, it will consume some BNB, but I do not think this can fundamentally solve your problem, actually, when you add liquidity by swapping on the pancake, in most cases, either token is left, or BNB is left.
Shortly, the current situation just fits with your contract design, and you do not have a function to withdraw BNB directly.
Kind reminder, you should have a test on the testnet before launching on the mainnet, this will decrease bugs.
The contract collects a percentage of tax (6% Liquidity) and then swaps the tokens to bnb and sends them to the marketing wallet and airdrop wallet. Earlier the marketing divisor was 3 and airdrop divisor was 3. And it would Swap the tokens to bnb and then send the bnb in equal parts to the two wallets mentioned above
I then changed the liquidity fee to 8%. And the marketing divisor to 5 and airdrop divisor to 3. While testing the contract on testnet. It doesn't seem to be swapping the tokens collected in the contract to bnb.
sorry to jump in. But i need some help bro.
I have a just created a token on BSC and when I try to add liquidity using pancakeswap i get this error.
""Add liquidity failed: The input token cannot be transferred. There may be an issue with the input token. (TransferHelper: TRANSFER_FROM_FAILED)
for info:
Contract address: 0x6E4Cf2341698F6a8Be1192dF2A6793c0d7E4f7FE