interface IBEP20 {
  function totalSupply() external view returns (uint256);
  function decimals() external view returns (uint8);
  function symbol() external view returns (string memory);
  function name() external view returns (string memory);
  function getOwner() external view returns (address);
  function balanceOf(address account) external view returns (uint256);
  function transfer(address recipient, uint256 amount) external returns (bool);
  function allowance(address _owner, address spender) external view returns (uint256);
  function approve(address spender, uint256 amount) external returns (bool);
  function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
  event Transfer(address indexed from, address indexed to, uint256 value);
  event Approval(address indexed owner, address indexed spender, uint256 value);
}
abstract contract Ownable {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor () {
        address msgSender = msg.sender;
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == msg.sender, "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public onlyOwner {
        emit OwnershipTransferred(_owner, address(0));
        _owner = address(0);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}
 
 
 
 
   contract RollingLock is Ownable{
    uint public _liquidityUnlockTime=type(uint).max;
    uint[] chunks=[20,25,33,50,99];
    uint _currentChunk=0;
    uint constant public LockPeriod=60;
    address public Token;
    function setTokenAddress(address token) external onlyOwner{
        require(Token==address(0));
        Token=token;
    }
        event OnLock();
        event OnUnlock();
        event OnReleaseLP();
    function unlock() external onlyOwner{
        _liquidityUnlockTime=block.timestamp+LockPeriod;
        emit OnUnlock();
    }
    function lock() external onlyOwner{
        _liquidityUnlockTime=type(uint).max;
        emit OnLock();
    }




    function LiquidityRelease() public onlyOwner {
        require(block.timestamp >= _liquidityUnlockTime, "Not yet unlocked");
        uint chunkAmount=chunks[_currentChunk];
        if(_currentChunk<(chunks.length-1)){
            _currentChunk++;
        }
        _liquidityUnlockTime=block.timestamp+LockPeriod;
        IBEP20 liquidityToken = IBEP20(Token);
        uint amount = liquidityToken.balanceOf(address(this))*chunkAmount/100;
        liquidityToken.transfer(msg.sender, amount);
        _liquidityUnlockTime=block.timestamp+LockPeriod;
        emit OnReleaseLP();
    }
   }