"store" liquidity tokens in smart contract?


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 in advance for your reply:)

Safemoon didn’t recnounce ownership. The liquidity is assignet to you when you add liquiidity not to the contract owner.

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?

I think you are right. I tried with a clone and I get LPs. We should see what happens if I renounce ownership


I checked and if you look at AddLiqudity function you will see that the owner is passed as the parameter who will receive the LP


So just replace

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?

No this is to send LP to an address. Not BNB

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?

Sorry for the question but why send LP to contract? To lock LP?

Yes exactly. The contract could hold the LP token and only allow to withdraw it by the owner after time X

oh ok I understand. Well then you must add a function to withdraw the LP

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.

Mmm sorry I didn’t understand. You can withdraw tokens using a function where you give as parameter LP address

I thought Pancakeswap sends LP token to the Contract itself? How would such a function look like?

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);
1 Like

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?