Some questions about libraries, liquidity and functions


I trying to learn the workings and coding of smart contracts. As an IT expert and some coding experience i do manage to understand the basics and can create a Token. But I want to learn more about the workings of the contracts and functions. I started with a standard contract implemented on the Binance Test Chain. After that i moved on the safemoon contract with more functions (also on the binance smart chain). But somethings are still not clear i gathered a couple of questions about the remix, library, safemoon contract and liquidity. I hope that you guys can answer my questions:

I found the following Safemoon Contract on Git (link) and deployed the smart contracts with and metamask.

  1. First question also for others newbies when you copy the Safemoon.sol file what are the correct dependencies you need and where is good spot to find the correct ones and how to import them.

  2. Current version of the contract has hardcoded liquidity pool this can be fixed by changing the ‘0X0123…’’ to pancakeswap v2 router address “0x10ED43C718714eb63d5aA57B78B54704E256024E” , remove “immutable” from the Uniswap declaration and place the setRouterAddress function

    contract SafeMoon_Token is Context, IERC20, Ownable {

     IUniswapV2Router02 public uniswapV2Router; // IUniswapV2Router02 public immutable uniswapV2Router;
     address public uniswapV2Pair; // address public immutable uniswapV2Pair;
     constructor () public {
         _rOwned[_msgSender()] = _rTotal;
         IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x10ED43C718714eb63d5aA57B78B54704E256024E);


     //New Pancakeswap router version?
     //No problem, just change it!
     function setRouterAddress(address newRouter) public onlyOwner() {
        //Thank you FreezyEx
         IUniswapV2Router02 _newPancakeRouter = IUniswapV2Router02(newRouter);
         uniswapV2Pair = IUniswapV2Factory(_newPancakeRouter.factory()).createPair(address(this), _newPancakeRouter.WETH());
         uniswapV2Router = _newPancakeRouter;


  3. From my understanding the first liquidity pool will create the initial price. If the Token smart contract creates a pool isn’t the price then set? And how to check if the Token Smart Contract has created the pool and what the balance is of the pool?

  4. In the Safemoon liquidity functions I see “.weth”. When deploying the smart contract on the Binance Chain will the WETH value change to BNB or WBNB? If the contract tries to deploy liquidity pool with WBNB is it correct to say that you first must approve WBNB spend limit for pancakeswap for the function to work when deploying token?

  5. the function “contract Ownable is Context {}” how do I set a variable in “contract SafeMoon_Token is Context, IERC20, Ownable {}” that sets the locktime and in what time definition uses the lock milliseconds, seconds, minutes, etc…

  6. Tax fees are sent to the contract owner where can I find the line of code that fees are send to that account? I got a little bit dizzy following the “_msgSender()” in the contract and is it possible to create a variable to substitute the fee address.

Hello there!

Did anyone ever answer you?

Did you answer yourself?

…I share many of the same questions