having some thoughts about Safemoon and others, they all renounce the ownership and with it the access to the actual liquidity tokens is also lost, or? Couldn’t the liquidity tokens on pancake swap be assigned to the actual contract address rather then the owner? So the owner could be renounced for 1 year and when the ownership is unlocked to the actual owner the contract could send the liquidity tokens to the owner.
Or do I understand it wrong and the liquidity tokens are always send to the contract creator?
Thanks. Right, but on forks they are doing it like that. The contract does swap liquidity once it reaches a specific amount of tokens, so I thought the liquidity tokens from of this swap do get send to the owner as he also creates/initializes the liquidity pool an pancakeswap. Or do I misunderstand tha?
Thank you @FreezyEx , I totally overlooked that bit. If I change this to the contract itself, how can the contract distinguish between the BNB it has a balance and the liquidity token it gets returned form the uniswap router?
Yes I understand. Just thinking to update it from owner() to the contract address so that the liquidity pool token are received in the contract itself.
How could the contract handle a balance for the LP token in addition to the normal BNB token?
I just read that BEP20/ERC20 can’t deal with more then one balance. In order to do so it would be BEP-1155. So this idea won’t work with the standard used on Safemoon.
Yes if you change what we talked about from owner to contract address, the contract will receive LP. Then you can add a timelock and a withdraw function to allow Owner to take the LP.
The function can be somethig like this:
function transferTokens(address _tokenAddr, address _to, uint _amount) public onlyOwner {
Token(_tokenAddr).transfer(_to, _amount);
}
I see… Man, this is an amazing info. Thank you.
But you know to add a contract address, a time lock and a withdraw function to allow Owner to take the LP?
I replaced owner() here with my address. (Exactly to resolve this issue, that the tax LP tokens aren't lost forever). Is this safe? Or can you not guarantee that the contract works properly with this minor change?