I've seen some scams that :
- In deploy stage all tokens goes to the owner.
- The owner go to PancakeSwap and create a liquidity pool using some BNB he have and all supply of tokens.
- After some time the owner pulls the rug and clean the LP.
I need to create a more transparent and reliable token and then I think I could allow the own contract to receive some BNB (an ICO maybe?) and then decides when to create the liquidity pool.
So after renounce the contract it cannot be any way to pull back the LP. It could give the investors some peace.
I can see any cheap way to lock the LP.... it can be a solution to this question too.
So my question is: how can I use solidity to create (inside the contract) a new Liquidity Pool just the way I would create using PancakeSwap ?
Some MootRat clones have this code:
function addLiquidity(
address routerAddress,
address owner,
uint256 tokenAmount,
uint256 ethAmount
) public {
IPancakeRouter02 pancakeRouter = IPancakeRouter02(routerAddress);
// add the liquidity
pancakeRouter.addLiquidityETH{value : ethAmount}(
address(this),
tokenAmount,
0, // slippage is unavoidable
0, // slippage is unavoidable
owner,
block.timestamp + 360
);
}
But I think it is missing something...